feat: file upload and download
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package controllers
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type APIResponse struct {
|
||||
Data interface{} `json:"data"`
|
||||
Msg string `json:"msg"`
|
||||
Code int `json:"code"`
|
||||
}
|
||||
|
||||
func writeSuccess(c *gin.Context, httpStatus int, msg string, data interface{}) {
|
||||
c.JSON(httpStatus, APIResponse{Data: data, Msg: msg, Code: httpStatus})
|
||||
}
|
||||
|
||||
func writeError(c *gin.Context, httpStatus int, msg string) {
|
||||
c.JSON(httpStatus, APIResponse{Data: nil, Msg: msg, Code: httpStatus})
|
||||
}
|
||||
Reference in New Issue
Block a user