refactor: set http return code to static

This commit is contained in:
2024-11-14 01:41:34 +08:00
parent 70d7229dd8
commit c64d80951c
5 changed files with 69 additions and 89 deletions

View File

@ -1,9 +1,12 @@
package util
import "github.com/gin-gonic/gin"
import (
"github.com/gin-gonic/gin"
"net/http"
)
func ReturnJson(c *gin.Context, httpCode int, code int, msg string, data interface{}) {
c.JSON(httpCode, gin.H{
func ReturnJson(c *gin.Context, code int, msg string, data interface{}) {
c.JSON(http.StatusOK, gin.H{
"code": code,
"msg": msg,
"data": data,