Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop
This commit is contained in:
commit
6c717ce30e
|
@ -2,7 +2,6 @@ package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fusenapi/model"
|
"fusenapi/model"
|
||||||
"fusenapi/product/internal/svc"
|
"fusenapi/product/internal/svc"
|
||||||
"fusenapi/product/internal/types"
|
"fusenapi/product/internal/types"
|
||||||
|
@ -30,10 +29,7 @@ func NewGetProductListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
|
||||||
func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, loginInfo auth.UserInfo) (resp *types.Response, err error) {
|
func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, loginInfo auth.UserInfo) (resp *types.Response, err error) {
|
||||||
//校验前台登录情况
|
//校验前台登录情况
|
||||||
if loginInfo.UserId == 0 {
|
if loginInfo.UserId == 0 {
|
||||||
return &types.Response{
|
return &types.Response{Code: 402, Message: "please sign in"}, nil
|
||||||
Code: 401,
|
|
||||||
Message: "please sign in",
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
//获取合适尺寸
|
//获取合适尺寸
|
||||||
if req.Size > 0 {
|
if req.Size > 0 {
|
||||||
|
@ -46,7 +42,7 @@ func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, login
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if userInfo.Id == 0 {
|
if userInfo.Id == 0 {
|
||||||
return nil, errors.New("user not exists")
|
return &types.Response{Code: 402, Message: "please sign in"}, nil
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ func GetCurrentSize(clientSize uint32) uint32 {
|
||||||
return newSizeArray[lenNewSize-1]
|
return newSizeArray[lenNewSize-1]
|
||||||
}
|
}
|
||||||
//小于最小尺寸则返回规则最小尺寸
|
//小于最小尺寸则返回规则最小尺寸
|
||||||
if clientSize < newSizeArray[0] {
|
if clientSize <= newSizeArray[0] {
|
||||||
return newSizeArray[0]
|
return newSizeArray[0]
|
||||||
}
|
}
|
||||||
for _, v := range newSizeArray {
|
for _, v := range newSizeArray {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user