改造成api

This commit is contained in:
2025-07-02 14:51:23 +08:00
parent c8a81d0f49
commit 39e91e85ba
27 changed files with 665 additions and 519 deletions

View File

@@ -41,7 +41,7 @@ func Initialize(conf *config.Config, log *logger.Logger) (http.Handler, func(),
return nil, nil, err
}
token, err := token.NewPasetoMaker(conf.JWT.SigningKey)
tokenMaker, err := token.NewPasetoMaker(conf.JWT.SigningKey)
if err != nil {
dbClose()
rdClose()
@@ -85,7 +85,7 @@ func Initialize(conf *config.Config, log *logger.Logger) (http.Handler, func(),
configService := system2.NewConfigService(service, configRepository)
captchaService := common.NewCaptchaService()
auditLogService := system2.NewAuditLogService(service, auditLogRepository)
authService := auth.NewAuth(log, rd, nil, userService, roleService, loginLogService)
authService := auth.NewAuth(conf, log, rd, tokenMaker, userService, roleService, loginLogService)
// =================================================================================================================
// task
@@ -116,7 +116,7 @@ func Initialize(conf *config.Config, log *logger.Logger) (http.Handler, func(),
Conf: conf,
Log: log,
Render: rdr,
Token: token,
Token: tokenMaker,
TaskDistributor: taskDistributor,
CaptchaService: captchaService,
AuthService: authService,