Add ability to export table to JSON and XML

This commit is contained in:
Dan Sosedoff
2016-01-04 18:03:53 -06:00
parent bc1f876fb5
commit 73a97893e9
6 changed files with 74 additions and 36 deletions

View File

@@ -22,6 +22,17 @@ type Error struct {
Message string `json:"error"`
}
func getQueryParam(c *gin.Context, name string) string {
result := ""
q := c.Request.URL.Query()
if len(q[name]) > 0 {
result = q[name][0]
}
return result
}
func assetContentType(name string) string {
ext := filepath.Ext(name)
result := mime.TypeByExtension(ext)