This commit is contained in:
2026-04-25 11:59:10 +08:00
parent e246271a24
commit ba463ae38d
33 changed files with 1600 additions and 112 deletions

View File

@@ -49,8 +49,6 @@ func (r *CertificationRoutes) Register(router *http.GinRouter) {
authGroup := certificationGroup.Group("")
authGroup.Use(r.auth.Handle())
{
authGroup.GET("", r.handler.ListCertifications) // 查询认证列表(管理员)
// 1. 获取认证详情
authGroup.GET("/details", r.handler.GetCertification)
@@ -71,10 +69,6 @@ func (r *CertificationRoutes) Register(router *http.GinRouter) {
// 前端确认是否完成签署
authGroup.POST("/confirm-sign", r.handler.ConfirmSign)
// 管理员代用户完成认证(暂不关联合同)
authGroup.POST("/admin/complete-without-contract", r.handler.AdminCompleteCertificationWithoutContract)
}
// 管理端企业审核(需管理员权限,以状态机状态为准)
@@ -82,6 +76,8 @@ func (r *CertificationRoutes) Register(router *http.GinRouter) {
adminGroup.Use(r.auth.Handle())
adminGroup.Use(r.admin.Handle())
{
adminGroup.GET("", r.handler.ListCertifications) // 查询认证列表(管理员)
adminGroup.POST("/complete-without-contract", r.handler.AdminCompleteCertificationWithoutContract)
adminGroup.POST("/transition-status", r.handler.AdminTransitionCertificationStatus)
}
adminCertGroup := adminGroup.Group("/submit-records")

View File

@@ -0,0 +1,46 @@
package routes
import (
"tyapi-server/internal/infrastructure/http/handlers"
sharedhttp "tyapi-server/internal/shared/http"
"tyapi-server/internal/shared/middleware"
"go.uber.org/zap"
)
// SubordinateRoutes 下属与邀请路由
type SubordinateRoutes struct {
handler *handlers.SubordinateHandler
auth *middleware.JWTAuthMiddleware
logger *zap.Logger
}
// NewSubordinateRoutes 构造
func NewSubordinateRoutes(
handler *handlers.SubordinateHandler,
auth *middleware.JWTAuthMiddleware,
logger *zap.Logger,
) *SubordinateRoutes {
return &SubordinateRoutes{handler: handler, auth: auth, logger: logger}
}
// Register 注册
func (r *SubordinateRoutes) Register(router *sharedhttp.GinRouter) {
g := router.GetEngine()
g.POST("/api/v1/sub-portal/register", r.handler.SubPortalRegister)
sub := g.Group("/api/v1/subordinate")
sub.Use(r.auth.Handle())
{
sub.POST("/invitations", r.handler.CreateInvitation)
sub.GET("/subordinates", r.handler.ListSubordinates)
sub.POST("/allocate", r.handler.Allocate)
sub.GET("/allocations", r.handler.ListAllocations)
sub.POST("/assign-subscription", r.handler.AssignSubscription)
sub.GET("/child-subscriptions", r.handler.ListChildSubscriptions)
sub.DELETE("/child-subscriptions/:subscription_id", r.handler.RemoveChildSubscription)
}
r.logger.Info("下属账号路由注册完成")
}