注册api
This commit is contained in:
@@ -84,6 +84,7 @@ func NewApplication(configPath string) (*Application, error) {
|
||||
pigTradeRepo := repository.NewGormPigTradeRepository(storage.GetDB())
|
||||
pigSickPigLogRepo := repository.NewGormPigSickLogRepository(storage.GetDB())
|
||||
medicationLogRepo := repository.NewGormMedicationLogRepository(storage.GetDB())
|
||||
rawMaterialRepo := repository.NewGormRawMaterialRepository(storage.GetDB())
|
||||
|
||||
// 初始化事务管理器
|
||||
unitOfWork := repository.NewGormUnitOfWork(storage.GetDB(), logger)
|
||||
@@ -98,6 +99,20 @@ func NewApplication(configPath string) (*Application, error) {
|
||||
// --- 业务逻辑处理器初始化 ---
|
||||
pigFarmService := service.NewPigFarmService(pigFarmRepo, pigPenRepo, pigBatchRepo, unitOfWork, logger)
|
||||
pigBatchService := service.NewPigBatchService(pigBatchDomain, logger)
|
||||
monitorService := service.NewMonitorService(
|
||||
sensorDataRepo,
|
||||
deviceCommandLogRepo,
|
||||
executionLogRepo,
|
||||
pendingCollectionRepo,
|
||||
userActionLogRepo,
|
||||
rawMaterialRepo,
|
||||
medicationLogRepo,
|
||||
pigBatchRepo,
|
||||
pigBatchLogRepo,
|
||||
pigTransferLogRepo,
|
||||
pigSickPigLogRepo,
|
||||
pigTradeRepo,
|
||||
)
|
||||
|
||||
// 初始化审计服务
|
||||
auditService := audit.NewService(userActionLogRepo, logger)
|
||||
@@ -160,6 +175,7 @@ func NewApplication(configPath string) (*Application, error) {
|
||||
planRepo,
|
||||
pigFarmService,
|
||||
pigBatchService,
|
||||
monitorService,
|
||||
userActionLogRepo,
|
||||
tokenService,
|
||||
auditService,
|
||||
|
||||
Reference in New Issue
Block a user