新增几大中心功能

This commit is contained in:
Administrator
2026-04-23 15:29:07 +08:00
parent 5c2a146a44
commit c6354ee065
123 changed files with 13074 additions and 229 deletions

View 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)
}
}

View File

@@ -0,0 +1,7 @@
package app
type RouterGroup struct {
PublicAuthRouter
AppAuthRouter
InviteCodeRouter
}

View 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)
}
}

View 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)
}
}

View File

@@ -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
}

View File

@@ -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
)

View 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)
}
}

View 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)
}
}

View File

@@ -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) // 获取参数变更审计
}
}