fix:支付
This commit is contained in:
@@ -45,8 +45,31 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
||||
// 如果是,返回未授权的错误码
|
||||
return resp.SetStatus(basic.CodeUnAuth)
|
||||
}
|
||||
var nowTime = time.Now().UTC()
|
||||
if req.LogoSelectedId == 0 {
|
||||
return resp.SetStatus(basic.CodeLogoSetCategory, "logo logo_selected_id not null")
|
||||
NewFsUserMaterialModel1 := gmodel.NewFsUserMaterialModel(l.svcCtx.MysqlConn)
|
||||
NewFsUserMaterialModelRow1 := NewFsUserMaterialModel1.RowSelectBuilder(nil).Where("id = ?", 0)
|
||||
|
||||
defaultMaterialInfo, err := NewFsUserMaterialModel1.FindOne(l.ctx, NewFsUserMaterialModelRow1.Model(&gmodel.FsUserMaterial{}))
|
||||
if err != nil {
|
||||
logc.Errorf(l.ctx, "defaultMaterialInfo FindOne err:%+v", err)
|
||||
return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find")
|
||||
}
|
||||
var defaultMaterial = gmodel.FsUserMaterial{
|
||||
Module: defaultMaterialInfo.Module,
|
||||
UserId: &userinfo.UserId,
|
||||
GuestId: &userinfo.GuestId,
|
||||
ResourceId: defaultMaterialInfo.ResourceId,
|
||||
ResourceUrl: defaultMaterialInfo.ResourceUrl,
|
||||
Ctime: &nowTime,
|
||||
}
|
||||
MaterialCreateRes := l.svcCtx.MysqlConn.Create(&defaultMaterial)
|
||||
err = MaterialCreateRes.Error
|
||||
if err != nil {
|
||||
logc.Errorf(l.ctx, "defaultMaterialInfo Create err:%+v", err)
|
||||
return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find")
|
||||
}
|
||||
req.LogoSelectedId = defaultMaterial.Id
|
||||
}
|
||||
if req.SetLogoCategory == 1 && req.CategoryId == 0 {
|
||||
return resp.SetStatus(basic.CodeLogoSetCategory, "logo category_id not null")
|
||||
@@ -73,7 +96,6 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
|
||||
return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find")
|
||||
}
|
||||
|
||||
var nowTime = time.Now().UTC()
|
||||
err = l.svcCtx.MysqlConn.WithContext(l.ctx).Transaction(func(tx *gorm.DB) error {
|
||||
var metadataMapOldUserMaterial map[string]interface{}
|
||||
if userMaterialInfo.Metadata != nil {
|
||||
|
||||
Reference in New Issue
Block a user