mirror of https://gitee.com/answerdev/answer.git
fix: upload add siteinfo service
This commit is contained in:
parent
8ac92750a4
commit
498b7f4893
|
@ -108,7 +108,7 @@ func initApplication(debug bool, serverConf *conf.Server, dbConf *data.Database,
|
||||||
userService := service.NewUserService(userRepo, userActiveActivityRepo, emailService, authService, serviceConf, siteInfoCommonService)
|
userService := service.NewUserService(userRepo, userActiveActivityRepo, emailService, authService, serviceConf, siteInfoCommonService)
|
||||||
captchaRepo := captcha.NewCaptchaRepo(dataData)
|
captchaRepo := captcha.NewCaptchaRepo(dataData)
|
||||||
captchaService := action.NewCaptchaService(captchaRepo)
|
captchaService := action.NewCaptchaService(captchaRepo)
|
||||||
uploaderService := uploader.NewUploaderService(serviceConf)
|
uploaderService := uploader.NewUploaderService(serviceConf, siteInfoCommonService)
|
||||||
userController := controller.NewUserController(authService, userService, captchaService, emailService, uploaderService)
|
userController := controller.NewUserController(authService, userService, captchaService, emailService, uploaderService)
|
||||||
commentRepo := comment.NewCommentRepo(dataData, uniqueIDRepo)
|
commentRepo := comment.NewCommentRepo(dataData, uniqueIDRepo)
|
||||||
commentCommonRepo := comment.NewCommentCommonRepo(dataData, uniqueIDRepo)
|
commentCommonRepo := comment.NewCommentCommonRepo(dataData, uniqueIDRepo)
|
||||||
|
|
|
@ -33,7 +33,8 @@ type UploaderService struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewUploaderService new upload service
|
// NewUploaderService new upload service
|
||||||
func NewUploaderService(serviceConfig *service_config.ServiceConfig) *UploaderService {
|
func NewUploaderService(serviceConfig *service_config.ServiceConfig,
|
||||||
|
siteInfoService *siteinfo_common.SiteInfoCommonService) *UploaderService {
|
||||||
err := dir.CreateDirIfNotExist(filepath.Join(serviceConfig.UploadPath, avatarSubPath))
|
err := dir.CreateDirIfNotExist(filepath.Join(serviceConfig.UploadPath, avatarSubPath))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -43,7 +44,8 @@ func NewUploaderService(serviceConfig *service_config.ServiceConfig) *UploaderSe
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
return &UploaderService{
|
return &UploaderService{
|
||||||
serviceConfig: serviceConfig,
|
serviceConfig: serviceConfig,
|
||||||
|
siteInfoService: siteInfoService,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue