feat: file upload and download

This commit is contained in:
2026-04-28 19:38:02 +08:00
parent f9077dafcf
commit f6c06bd7ad
7 changed files with 512 additions and 8 deletions
+17
View File
@@ -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})
}