feat: client 增删改查

This commit is contained in:
Blizzard
2025-05-08 23:03:00 +08:00
parent 75e9157e5e
commit ab51ba91bc
41 changed files with 1093 additions and 57 deletions
+2
View File
@@ -31,6 +31,8 @@ func MigrateTable() {
db := global.DB
err := db.AutoMigrate(
system.User{},
system.Client{},
system.SysOperationRecord{},
)
if err != nil {
global.Logger.Error("Migrate table failed,err:", zap.Error(err))
+5 -3
View File
@@ -5,6 +5,7 @@ import (
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"sundynix-go/global"
"sundynix-go/middleware"
"sundynix-go/router"
)
@@ -24,15 +25,16 @@ func Routers() {
PublicGroup := Router.Group(global.Config.System.RouterPrefix)
//鉴权中间件
//NeedAuthGroup.Use(middleware.JWTAuthMiddleware())
NeedAuthGroup.Use(middleware.AuthMiddleware())
{
//无须鉴权的路由
systemRouter.InitLoginRouter(PublicGroup) //登录和验证码不需要鉴权
systemRouter.InitAuthRouter(PublicGroup) //登录和验证码不需要鉴权
}
{
//需要鉴权的路由
systemRouter.InitUserRouter(NeedAuthGroup)
systemRouter.InitUserRouter(NeedAuthGroup) //用户相关
systemRouter.InitClientRouter(NeedAuthGroup) //客户端相关
}
address := fmt.Sprintf(":%d", global.Config.System.Addr)