This commit is contained in:
2025-10-21 20:55:29 +08:00
parent 37037acac9
commit 625beff086
13 changed files with 568 additions and 7 deletions
+37
View File
@@ -0,0 +1,37 @@
package routers
import (
"encoding/json"
"fmt"
"os"
"github.com/gin-gonic/gin"
)
var ErrorCode map[string]interface{}
func init() {
//读取默认配置
fmt.Println("尝试读取错误码文件")
data, err := os.ReadFile("./defConfig/errorCodes.json")
if err != nil {
fmt.Println("读取错误码文件失败", err)
}
if err := json.Unmarshal(data, &ErrorCode); err != nil {
fmt.Println("解析错误码文件失败", err)
}
}
func ApiRoot(r *gin.RouterGroup) {
// r.GET("/", func(ctx *gin.Context) {
// //ReturnJson(ctx, "apiOK", nil)
// })
r.GET("/", func(ctx *gin.Context) {
})
}