This commit is contained in:
2025-08-18 18:12:37 +08:00
7 changed files with 840 additions and 14 deletions

View File

@@ -10,11 +10,12 @@ import (
// CertificationRoutes 认证路由
type CertificationRoutes struct {
handler *handlers.CertificationHandler
router *http.GinRouter
logger *zap.Logger
auth *middleware.JWTAuthMiddleware
optional *middleware.OptionalAuthMiddleware
handler *handlers.CertificationHandler
router *http.GinRouter
logger *zap.Logger
auth *middleware.JWTAuthMiddleware
optional *middleware.OptionalAuthMiddleware
dailyRateLimit *middleware.DailyRateLimitMiddleware
}
// NewCertificationRoutes 创建认证路由
@@ -24,13 +25,15 @@ func NewCertificationRoutes(
logger *zap.Logger,
auth *middleware.JWTAuthMiddleware,
optional *middleware.OptionalAuthMiddleware,
dailyRateLimit *middleware.DailyRateLimitMiddleware,
) *CertificationRoutes {
return &CertificationRoutes{
handler: handler,
router: router,
logger: logger,
auth: auth,
optional: optional,
handler: handler,
router: router,
logger: logger,
auth: auth,
optional: optional,
dailyRateLimit: dailyRateLimit,
}
}
@@ -48,8 +51,8 @@ func (r *CertificationRoutes) Register(router *http.GinRouter) {
// 1. 获取认证详情
authGroup.GET("/details", r.handler.GetCertification)
// 2. 提交企业信息
authGroup.POST("/enterprise-info", r.handler.SubmitEnterpriseInfo)
// 2. 提交企业信息(应用每日限流)
authGroup.POST("/enterprise-info", r.dailyRateLimit.Handle(), r.handler.SubmitEnterpriseInfo)
// 3. 申请合同签署
authGroup.POST("/apply-contract", r.handler.ApplyContract)