refactor: adjust project structure

This commit is contained in:
2024-11-14 01:15:55 +08:00
parent c219d81b89
commit 58232c403e
19 changed files with 316 additions and 128 deletions

20
util/ginRes.go Normal file
View File

@ -0,0 +1,20 @@
package util
import "github.com/gin-gonic/gin"
func ReturnJson(c *gin.Context, httpCode int, code int, msg string, data interface{}) {
c.JSON(httpCode, gin.H{
"code": code,
"msg": msg,
"data": data,
})
}
func ReturnInvalid(c *gin.Context) {
response := gin.H{
"code": 4,
"msg": "无效请求参数",
"data": nil,
}
c.JSON(200, response)
}