info delete table
This commit is contained in:
@@ -2,12 +2,9 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/basic"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"fusenapi/server/product/internal/svc"
|
||||
"fusenapi/server/product/internal/types"
|
||||
|
||||
@@ -33,18 +30,18 @@ func (l *GetLastProductDesignLogic) GetLastProductDesign(req *types.Request, use
|
||||
return resp.SetStatusAddMessage(basic.CodeUnAuth, "please sign in")
|
||||
}
|
||||
//获取用户信息
|
||||
user, err := l.svcCtx.AllModels.FsUser.FindUserById(l.ctx, userinfo.UserId)
|
||||
if err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return resp.SetStatusWithMessage(basic.CodeUnAuth, "user not found")
|
||||
}
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get user info")
|
||||
}
|
||||
//若没打开了个性化渲染按钮
|
||||
if *user.IsOpenRender != 1 {
|
||||
return resp.SetStatusWithMessage(basic.CodeOK, "success:IsOpenRender switch is closed")
|
||||
}
|
||||
// user, err := l.svcCtx.AllModels.FsUser.FindUserById(l.ctx, userinfo.UserId)
|
||||
// if err != nil {
|
||||
// if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
// return resp.SetStatusWithMessage(basic.CodeUnAuth, "user not found")
|
||||
// }
|
||||
// logx.Error(err)
|
||||
// return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get user info")
|
||||
// }
|
||||
// //若没打开了个性化渲染按钮
|
||||
// if *user.IsOpenRender != 1 {
|
||||
// return resp.SetStatusWithMessage(basic.CodeOK, "success:IsOpenRender switch is closed")
|
||||
// }
|
||||
//查询用户最近下单成功的数据
|
||||
// orderInfo, err := l.svcCtx.AllModels.FsOrder.FindLastSuccessOneOrder(l.ctx, user.Id, int64(constants.STATUS_NEW_NOT_PAY))
|
||||
// if err != nil {
|
||||
|
||||
@@ -377,8 +377,8 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, useri
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get user info")
|
||||
}
|
||||
isLowRendering = *user.IsLowRendering > 0
|
||||
isRemoveBg = *user.IsRemoveBg > 0
|
||||
isLowRendering = true
|
||||
isRemoveBg = true
|
||||
lastDesign = l.getLastDesign(user)
|
||||
}
|
||||
var renderDesign interface{}
|
||||
|
||||
@@ -12,12 +12,13 @@ import (
|
||||
"fusenapi/utils/basic"
|
||||
"fusenapi/utils/format"
|
||||
"fusenapi/utils/image"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"gorm.io/gorm"
|
||||
"math"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type GetProductListLogic struct {
|
||||
@@ -163,7 +164,7 @@ func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, useri
|
||||
UserId: user.Id,
|
||||
}
|
||||
if user.Id != 0 {
|
||||
r.IsThousandFace = int(*user.IsThousandFace)
|
||||
r.IsThousandFace = 1
|
||||
}
|
||||
image.ThousandFaceImageFormat(&r)
|
||||
item.Cover = r.Cover
|
||||
|
||||
@@ -77,8 +77,8 @@ func (l *GetRenderSettingByPidLogic) GetRenderSettingByPid(req *types.GetRenderS
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get user info")
|
||||
}
|
||||
isLowRendering = *user.IsLowRendering > 0
|
||||
isRemoveBg = *user.IsRemoveBg > 0
|
||||
isLowRendering = true
|
||||
isRemoveBg = true
|
||||
lastDesign, err = l.checkLastDesignExists(user.Id)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/basic"
|
||||
"fusenapi/utils/image"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -75,7 +76,7 @@ func (l *GetSuccessRecommandLogic) GetSuccessRecommand(req *types.GetSuccessReco
|
||||
UserId: user.Id,
|
||||
}
|
||||
if user.Id > 0 {
|
||||
r.IsThousandFace = int(*user.IsThousandFace)
|
||||
r.IsThousandFace = int(1)
|
||||
}
|
||||
image.ThousandFaceImageFormat(&r)
|
||||
data.Cover = r.Cover
|
||||
|
||||
@@ -8,9 +8,10 @@ import (
|
||||
"fusenapi/utils/basic"
|
||||
"fusenapi/utils/format"
|
||||
"fusenapi/utils/image"
|
||||
"gorm.io/gorm"
|
||||
"strings"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"fusenapi/server/product/internal/svc"
|
||||
"fusenapi/server/product/internal/types"
|
||||
|
||||
@@ -83,7 +84,7 @@ func (l *OtherProductListLogic) OtherProductList(req *types.OtherProductListReq,
|
||||
UserId: user.Id,
|
||||
}
|
||||
if user.Id > 0 {
|
||||
r.IsThousandFace = int(*user.IsThousandFace)
|
||||
r.IsThousandFace = 1
|
||||
}
|
||||
image.ThousandFaceImageFormat(r)
|
||||
v.Cover = r.Cover
|
||||
|
||||
Reference in New Issue
Block a user