增加操作历史model
This commit is contained in:
@@ -29,6 +29,9 @@ type Application struct {
|
||||
// UserRepo 用户仓库实例
|
||||
UserRepo repository.UserRepo
|
||||
|
||||
// OperationHistoryRepo 操作历史仓库实例
|
||||
OperationHistoryRepo repository.OperationHistoryRepo
|
||||
|
||||
// Config 应用配置
|
||||
Config *config.Config
|
||||
|
||||
@@ -53,19 +56,23 @@ func NewApplication(cfg *config.Config) *Application {
|
||||
// 初始化用户仓库
|
||||
userRepo := repository.NewUserRepo(store.GetDB())
|
||||
|
||||
// 初始化操作历史仓库
|
||||
operationHistoryRepo := repository.NewOperationHistoryRepo(store.GetDB())
|
||||
|
||||
// 初始化API组件
|
||||
apiInstance := api.NewAPI(cfg, userRepo)
|
||||
apiInstance := api.NewAPI(cfg, userRepo, operationHistoryRepo)
|
||||
|
||||
// 初始化任务执行器组件(使用5个工作协程)
|
||||
taskExecutor := task.NewExecutor(5)
|
||||
|
||||
return &Application{
|
||||
Storage: store,
|
||||
API: apiInstance,
|
||||
TaskExecutor: taskExecutor,
|
||||
UserRepo: userRepo,
|
||||
Config: cfg,
|
||||
logger: logs.NewLogger(),
|
||||
Storage: store,
|
||||
API: apiInstance,
|
||||
TaskExecutor: taskExecutor,
|
||||
UserRepo: userRepo,
|
||||
OperationHistoryRepo: operationHistoryRepo,
|
||||
Config: cfg,
|
||||
logger: logs.NewLogger(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user