✨ 新增几大中心功能
This commit is contained in:
18
server/router/app/app_auth.go
Normal file
18
server/router/app/app_auth.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
api "git.echol.cn/loser/Go-Web-Template/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var appAuthApi = api.ApiGroupApp.AppApiGroup.AppAuthApi
|
||||
|
||||
type AppAuthRouter struct{}
|
||||
|
||||
// InitAppAuthRouter 玩家端登录态接口(/app/*)
|
||||
func (s *AppAuthRouter) InitAppAuthRouter(Router *gin.RouterGroup) {
|
||||
group := Router.Group("app")
|
||||
{
|
||||
group.GET("me", appAuthApi.Me)
|
||||
}
|
||||
}
|
||||
7
server/router/app/enter.go
Normal file
7
server/router/app/enter.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package app
|
||||
|
||||
type RouterGroup struct {
|
||||
PublicAuthRouter
|
||||
AppAuthRouter
|
||||
InviteCodeRouter
|
||||
}
|
||||
18
server/router/app/invite_code.go
Normal file
18
server/router/app/invite_code.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
api "git.echol.cn/loser/Go-Web-Template/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var inviteCodeApi = api.ApiGroupApp.AppApiGroup.InviteCodeApi
|
||||
|
||||
type InviteCodeRouter struct{}
|
||||
|
||||
func (s *InviteCodeRouter) InitInviteCodeRouter(Router *gin.RouterGroup) {
|
||||
group := Router.Group("app/invite-code")
|
||||
{
|
||||
group.POST("generate", inviteCodeApi.GenerateInviteCode)
|
||||
group.GET("current", inviteCodeApi.CurrentInviteCode)
|
||||
}
|
||||
}
|
||||
20
server/router/app/public_auth.go
Normal file
20
server/router/app/public_auth.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
api "git.echol.cn/loser/Go-Web-Template/server/api/v1"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var publicAuthApi = api.ApiGroupApp.AppApiGroup.PublicAuthApi
|
||||
|
||||
type PublicAuthRouter struct{}
|
||||
|
||||
// InitPublicAuthRouter 玩家端注册/登录(public,不鉴权)
|
||||
func (s *PublicAuthRouter) InitPublicAuthRouter(PublicRouter *gin.RouterGroup) {
|
||||
group := PublicRouter.Group("public/app")
|
||||
{
|
||||
group.GET("register/status", publicAuthApi.RegisterStatus)
|
||||
group.POST("register", publicAuthApi.Register)
|
||||
group.POST("login", publicAuthApi.Login)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/Go-Web-Template/server/router/app"
|
||||
"git.echol.cn/loser/Go-Web-Template/server/router/common"
|
||||
"git.echol.cn/loser/Go-Web-Template/server/router/system"
|
||||
)
|
||||
@@ -10,4 +11,5 @@ var RouterGroupApp = new(RouterGroup)
|
||||
type RouterGroup struct {
|
||||
System system.RouterGroup
|
||||
Common common.RouterGroup
|
||||
App app.RouterGroup
|
||||
}
|
||||
|
||||
@@ -7,9 +7,11 @@ type RouterGroup struct {
|
||||
JwtRouter
|
||||
SysRouter
|
||||
BaseRouter
|
||||
PublicAuthRouter
|
||||
InitRouter
|
||||
MenuRouter
|
||||
UserRouter
|
||||
InviteCodeRouter
|
||||
CasbinRouter
|
||||
AuthorityRouter
|
||||
DictionaryRouter
|
||||
@@ -39,4 +41,6 @@ var (
|
||||
dictionaryDetailApi = api.ApiGroupApp.SystemApiGroup.DictionaryDetailApi
|
||||
mcpApi = api.ApiGroupApp.SystemApiGroup.McpApi
|
||||
sysErrorApi = api.ApiGroupApp.SystemApiGroup.SysErrorApi
|
||||
publicAuthApi = api.ApiGroupApp.SystemApiGroup.PublicAuthApi
|
||||
inviteCodeApi = api.ApiGroupApp.SystemApiGroup.InviteCodeApi
|
||||
)
|
||||
|
||||
19
server/router/system/invite_code.go
Normal file
19
server/router/system/invite_code.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/Go-Web-Template/server/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type InviteCodeRouter struct{}
|
||||
|
||||
func (s *InviteCodeRouter) InitInviteCodeRouter(Router *gin.RouterGroup) {
|
||||
group := Router.Group("user/invite-code").Use(middleware.OperationRecord())
|
||||
{
|
||||
group.POST("generate", inviteCodeApi.GenerateInviteCode)
|
||||
}
|
||||
groupWithoutRecord := Router.Group("user/invite-code")
|
||||
{
|
||||
groupWithoutRecord.GET("current", inviteCodeApi.CurrentInviteCode)
|
||||
}
|
||||
}
|
||||
14
server/router/system/public_auth.go
Normal file
14
server/router/system/public_auth.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package system
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type PublicAuthRouter struct{}
|
||||
|
||||
// InitPublicAuthRouter public 注册状态与注册接口(不鉴权)
|
||||
func (s *PublicAuthRouter) InitPublicAuthRouter(PublicRouter *gin.RouterGroup) {
|
||||
registerRouter := PublicRouter.Group("public/auth/register")
|
||||
{
|
||||
registerRouter.GET("status", publicAuthApi.RegisterStatus)
|
||||
registerRouter.POST("", publicAuthApi.PublicRegister)
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,9 @@ func (s *SysParamsRouter) InitSysParamsRouter(Router *gin.RouterGroup, PublicRou
|
||||
sysParamsRouter.PUT("updateSysParams", sysParamsApi.UpdateSysParams) // 更新参数
|
||||
}
|
||||
{
|
||||
sysParamsRouterWithoutRecord.GET("findSysParams", sysParamsApi.FindSysParams) // 根据ID获取参数
|
||||
sysParamsRouterWithoutRecord.GET("getSysParamsList", sysParamsApi.GetSysParamsList) // 获取参数列表
|
||||
sysParamsRouterWithoutRecord.GET("getSysParam", sysParamsApi.GetSysParam) // 根据Key获取参数
|
||||
sysParamsRouterWithoutRecord.GET("findSysParams", sysParamsApi.FindSysParams) // 根据ID获取参数
|
||||
sysParamsRouterWithoutRecord.GET("getSysParamsList", sysParamsApi.GetSysParamsList) // 获取参数列表
|
||||
sysParamsRouterWithoutRecord.GET("getSysParam", sysParamsApi.GetSysParam) // 根据Key获取参数
|
||||
sysParamsRouterWithoutRecord.GET("getChangeLogList", sysParamsApi.GetSysParamChangeLogList) // 获取参数变更审计
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user