feat: client 增删改查
This commit is contained in:
@@ -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,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)
|
||||
|
||||
Reference in New Issue
Block a user