重构core包

This commit is contained in:
2025-10-26 15:48:38 +08:00
parent 6a8e8f1f7d
commit 40eb57ee47
6 changed files with 444 additions and 333 deletions

View File

@@ -43,7 +43,7 @@ type API struct {
engine *gin.Engine // Gin 引擎实例,用于处理 HTTP 请求
logger *logs.Logger // 日志记录器,用于输出日志信息
userRepo repository.UserRepository // 用户数据仓库接口,用于用户数据操作
tokenService token.TokenService // Token 服务接口,用于 JWT token 的生成和解析
tokenService token.Service // Token 服务接口,用于 JWT token 的生成和解析
auditService audit.Service // 审计服务,用于记录用户操作
httpServer *http.Server // 标准库的 HTTP 服务器实例,用于启动和停止服务
config config.ServerConfig // API 服务器的配置,使用 infra/config 包中的 ServerConfig
@@ -69,7 +69,7 @@ func NewAPI(cfg config.ServerConfig,
pigFarmService service.PigFarmService,
pigBatchService service.PigBatchService,
monitorService service.MonitorService,
tokenService token.TokenService,
tokenService token.Service,
auditService audit.Service,
notifyService domain_notify.Service,
deviceService domain_device.Service,