fix
This commit is contained in:
parent
6d3a3b2dda
commit
56a8b32d90
@ -184,18 +184,21 @@ func (l *GetTagProductListLogic) GetTagProductList(req *types.GetTagProductListR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//最终值提取最高级别那一层出来
|
//最终值提取最高级别那一层出来
|
||||||
menus := make([]types.TagItem, 0, len(mapTagLevel))
|
tagListRsp := make([]types.TagItem, 0, len(mapTagLevel))
|
||||||
for _, v := range mapTagLevel {
|
for _, v := range mapTagLevel {
|
||||||
if v.Level != minLevel {
|
if v.Level != minLevel {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
menus = append(menus, *v)
|
tagListRsp = append(tagListRsp, *v)
|
||||||
}
|
}
|
||||||
//排序
|
//排序
|
||||||
sort.Slice(menus, func(i, j int) bool {
|
sort.Slice(tagListRsp, func(i, j int) bool {
|
||||||
return menus[i].Sort < menus[j].Sort
|
return tagListRsp[i].Sort < tagListRsp[j].Sort
|
||||||
|
})
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", types.GetTagProductListRsp{
|
||||||
|
TotalCategory: len(mapTagLevel),
|
||||||
|
TagList: tagListRsp,
|
||||||
})
|
})
|
||||||
return resp.SetStatusWithMessage(basic.CodeOK, "success", menus)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取对应tag的产品列表
|
// 获取对应tag的产品列表
|
||||||
|
@ -250,7 +250,8 @@ type GetTagProductListReq struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GetTagProductListRsp struct {
|
type GetTagProductListRsp struct {
|
||||||
TagList []TagItem `json:"tag_list"`
|
TotalCategory int `json:"totalCategory"`
|
||||||
|
TagList []TagItem `json:"tag_list"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TagItem struct {
|
type TagItem struct {
|
||||||
|
@ -266,7 +266,8 @@ type GetTagProductListReq {
|
|||||||
Size uint32 `form:"size,optional"` //尺寸
|
Size uint32 `form:"size,optional"` //尺寸
|
||||||
}
|
}
|
||||||
type GetTagProductListRsp {
|
type GetTagProductListRsp {
|
||||||
TagList []TagItem `json:"tag_list"`
|
TotalCategory int `json:"totalCategory"`
|
||||||
|
TagList []TagItem `json:"tag_list"`
|
||||||
}
|
}
|
||||||
type TagItem {
|
type TagItem {
|
||||||
TypeName string `json:"type_name"`
|
TypeName string `json:"type_name"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user