From e35ba06a97a87c012072b509af2b60368c25d3a9 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 24 Oct 2023 12:28:44 +0800 Subject: [PATCH] fix --- .../internal/logic/gettagproductlistlogic.go | 8 ---- server/product/internal/types/types.go | 4 +- server_api/product.api | 4 +- utils/image/image_size.go | 37 ------------------- 4 files changed, 2 insertions(+), 51 deletions(-) delete mode 100644 utils/image/image_size.go diff --git a/server/product/internal/logic/gettagproductlistlogic.go b/server/product/internal/logic/gettagproductlistlogic.go index 4ffae478..1dc76dd1 100644 --- a/server/product/internal/logic/gettagproductlistlogic.go +++ b/server/product/internal/logic/gettagproductlistlogic.go @@ -7,7 +7,6 @@ import ( "fusenapi/model/gmodel" "fusenapi/utils/auth" "fusenapi/utils/basic" - "fusenapi/utils/image" "fusenapi/utils/s3url_to_s3id" "gorm.io/gorm" "sort" @@ -42,10 +41,6 @@ func (l *GetTagProductListLogic) GetTagProductList(req *types.GetTagProductListR logx.Error(err) return resp.SetStatusWithMessage(basic.CodeServiceErr, "get user info err") } - //获取合适尺寸 - if req.Size > 0 { - req.Size = image.GetCurrentSize(req.Size) - } //查询分类列表 tStatus := int64(1) tReq := gmodel.GetAllTagByParamsReq{ @@ -127,7 +122,6 @@ func (l *GetTagProductListLogic) GetTagProductList(req *types.GetTagProductListR MapTagLevel: mapTagLevel, MapProductHaveOptionFitting: mapProductHaveOptionFitting, MapResourceMetadata: mapResourceMetadata, - Size: req.Size, User: user, MinLevel: &minLevel, }); err != nil { @@ -279,7 +273,6 @@ type dealWithTagMenuDataReq struct { MapTagLevel map[string]*types.TagItem MapProductHaveOptionFitting map[int64]struct{} MapResourceMetadata map[string]map[string]interface{} - Size uint32 User gmodel.FsUser MinLevel *int //层级最小的 } @@ -312,7 +305,6 @@ func (l *GetTagProductListLogic) dealWithTagMenuData(req dealWithTagMenuDataReq) MapProductSizeCount: req.MapProductSizeCount, MapProductHaveOptionFitting: req.MapProductHaveOptionFitting, MapResourceMetadata: req.MapResourceMetadata, - Size: req.Size, User: req.User, }) //tag中产品 diff --git a/server/product/internal/types/types.go b/server/product/internal/types/types.go index 493a8530..a7df34c5 100644 --- a/server/product/internal/types/types.go +++ b/server/product/internal/types/types.go @@ -30,7 +30,6 @@ type GetRecommandProductListRsp struct { type GetTagProductListReq struct { Cid int64 `form:"cid,optional"` //分类id - Size uint32 `form:"size,optional"` //尺寸 TemplateTag string `form:"template_tag,optional"` //模板标签 WithProduct bool `form:"with_product,optional"` //是否携带分类下的产品 } @@ -152,8 +151,7 @@ type GetRenderSettingByPidRsp struct { } type HomePageRecommendProductListReq struct { - Size uint32 `form:"size"` - MerchantType int64 `form:"merchant_type"` + MerchantType int64 `form:"merchant_type"` } type HomePageRecommendProductListRsp struct { diff --git a/server_api/product.api b/server_api/product.api index 2ffb9847..2c64516f 100644 --- a/server_api/product.api +++ b/server_api/product.api @@ -73,7 +73,6 @@ type GetRecommandProductListRsp { //获取分类产品列表 type GetTagProductListReq { Cid int64 `form:"cid,optional"` //分类id - Size uint32 `form:"size,optional"` //尺寸 TemplateTag string `form:"template_tag,optional"` //模板标签 WithProduct bool `form:"with_product,optional"` //是否携带分类下的产品 } @@ -188,8 +187,7 @@ type GetRenderSettingByPidRsp { } //获取列表页推荐产品(返回是这个维度数组) type HomePageRecommendProductListReq { - Size uint32 `form:"size"` - MerchantType int64 `form:"merchant_type"` + MerchantType int64 `form:"merchant_type"` } type HomePageRecommendProductListRsp { Id int64 `json:"id"` diff --git a/utils/image/image_size.go b/utils/image/image_size.go deleted file mode 100644 index 2863876e..00000000 --- a/utils/image/image_size.go +++ /dev/null @@ -1,37 +0,0 @@ -package image - -// 定义尺寸规则 -var sizeArray = []uint32{1200, 1000, 750, 500, 128} - -// 裁剪尺寸阶梯 -var newSizeArray = []uint32{200, 400, 600, 800} - -// 获取合适尺寸 -func GetCurrentSize(clientSize uint32) uint32 { - lenNewSize := len(newSizeArray) - //大于最大尺寸则返回规则最大尺寸 - if clientSize >= newSizeArray[lenNewSize-1] { - return newSizeArray[lenNewSize-1] - } - //小于最小尺寸则返回规则最小尺寸 - if clientSize <= newSizeArray[0] { - return newSizeArray[0] - } - for _, v := range newSizeArray { - if v >= clientSize { - return v - } - } - return clientSize -} - -// 千人前面图像拼接 -type ThousandFaceImageFormatReq struct { - Size int - IsThousandFace int - Cover string - CoverImg string - CoverDefault string - ProductId int64 - UserId int64 -}