fix:裁剪业务逻辑调整
This commit is contained in:
@@ -22,6 +22,7 @@ type Config struct {
|
||||
}
|
||||
}
|
||||
BLMService struct {
|
||||
Url string
|
||||
ImageProcess struct {
|
||||
Url string
|
||||
}
|
||||
|
||||
@@ -126,6 +126,15 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us
|
||||
Source: "upload-logo",
|
||||
})
|
||||
|
||||
// 是否去背景
|
||||
if req.IsRemoveBg == 1 {
|
||||
// res, err := l.svcCtx.Repositories.ImageHandle.LogoInfoSet(l.ctx, &repositories.LogoInfoSetReq{})
|
||||
|
||||
// if err != nil {
|
||||
// return resp.SetStatus(basic.CodeServiceErr)
|
||||
// }
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatus(basic.CodeFileUploadErr, "upload file failed")
|
||||
|
||||
@@ -21,9 +21,10 @@ type ServiceContext struct {
|
||||
Config config.Config
|
||||
SharedState *shared.SharedState
|
||||
|
||||
MysqlConn *gorm.DB
|
||||
AllModels *gmodel.AllModelsGen
|
||||
AwsSession *session.Session
|
||||
MysqlConn *gorm.DB
|
||||
AllModels *gmodel.AllModelsGen
|
||||
AwsSession *session.Session
|
||||
Repositories *initalize.Repositories
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
@@ -39,6 +40,11 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
MysqlConn: initalize.InitMysql(c.SourceMysql),
|
||||
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
||||
AwsSession: session.Must(session.NewSession(&config)),
|
||||
Repositories: initalize.NewAllRepositories(&initalize.NewAllRepositorieData{
|
||||
GormDB: initalize.InitMysql(c.SourceMysql),
|
||||
BLMServiceUrl: &c.BLMService.Url,
|
||||
AwsSession: session.Must(session.NewSession(&config)),
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user