feat: add object storage and points leaderboard
This commit is contained in:
+23
-2
@@ -53,9 +53,30 @@ func New(cfg *config.Config) (*App, error) {
|
||||
taskService := tasks.New(st)
|
||||
mallService := mall.New(st)
|
||||
financeService := finance.New(st, redisClient, cfg.Auth)
|
||||
attachmentService := attachments.New(st, cfg.Upload)
|
||||
uploadConfig := cfg.Upload
|
||||
uploadCtx, uploadCancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
uploadValues, err := st.UploadConfigValues(uploadCtx)
|
||||
uploadCancel()
|
||||
if err != nil {
|
||||
_ = redisClient.Close()
|
||||
_ = st.Close()
|
||||
return nil, err
|
||||
}
|
||||
config.ApplyUploadSystemConfig(&uploadConfig, uploadValues)
|
||||
config.ApplyUploadEnv(&uploadConfig)
|
||||
if err = config.ValidateUpload(uploadConfig); err != nil {
|
||||
_ = redisClient.Close()
|
||||
_ = st.Close()
|
||||
return nil, err
|
||||
}
|
||||
attachmentService, err := attachments.New(st, uploadConfig)
|
||||
if err != nil {
|
||||
_ = redisClient.Close()
|
||||
_ = st.Close()
|
||||
return nil, err
|
||||
}
|
||||
supportService := support.New(st, imclient.New(cfg.IM), cfg.Auth)
|
||||
return &App{store: st, redis: redisClient, api: httpapi.New(authenticator, accountService, portalService, taskService, mallService, financeService, attachmentService, supportService), frontendPath: cfg.FrontendDir, upload: cfg.Upload}, nil
|
||||
return &App{store: st, redis: redisClient, api: httpapi.New(authenticator, accountService, portalService, taskService, mallService, financeService, attachmentService, supportService), frontendPath: cfg.FrontendDir, upload: uploadConfig}, nil
|
||||
}
|
||||
|
||||
func (a *App) Handler() http.Handler {
|
||||
|
||||
Reference in New Issue
Block a user