feat app 模块化启动

This commit is contained in:
2025-12-13 18:22:35 +08:00
parent 71d4e593c7
commit bc656247c9
41 changed files with 730 additions and 253 deletions

View File

@@ -0,0 +1,30 @@
package render
import (
"github.com/gin-gonic/gin"
"net/http"
)
type RespJsonData struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data interface{} `json:"data"`
}
func Json(c *gin.Context, code *Code, data interface{}) {
result := &RespJsonData{
Code: code.Code(),
Msg: code.Message(),
Data: data,
}
c.JSON(http.StatusOK, result)
}
func AbortJson(c *gin.Context, code *Code, data interface{}) {
result := &RespJsonData{
Code: code.Code(),
Msg: code.Message(),
Data: data,
}
c.AbortWithStatusJSON(http.StatusOK, result)
}