文档
测试

商品列表查询

GET
http://search.qxmall.com/front/search/list.html

接口描述

商品列表查询含各种聚合查询,为了减低你们前端封装查询参数的工作量,我只要求你们传入几个参数即可,其实可以传更多,我日后会告诉你们

请求参数

参数名
类型
描述
必填
keyword
String
商家名(就是品牌名)可为空,是string类型
必填
catalog3Id
Long
第三级分类的id,比如手机就是225,是long类型
必填
attrs
String
15_海思(Hisilicon):A13 这个你们别传,别写,你们不会用的
必填
skuPrice
String
6000_ 先别弄,等有空教你们
必填

响应参数

参数名
类型
描述
必填
msg
string
示例:success
必填
code
int
示例:0
必填
data
object
数据字典
必填
product
array
数据列表
必填
skuId
int
示例:35
必填
spuId
int
示例:19 指的就是——华为 HUAWEI Mate 30 Pro
必填
skuTitle
string
示例:<b style='color:red'>华为</b> HUAWEI Mate 30 Pro 蓝色 12GB
必填
skuPrice
int
示例:8676 这家伙的价格
必填
skuImg
string
商品图片 示例:https://qxmall.oss-cn-shenzhen.aliyuncs.com/2020-11-20//aeef54ca-2ec0-4fe5-8654-663eb44f64bc_1f15cdbcf9e1273c.jpg
必填
saleCount
int
示例:0 销量
必填
hasStock
boolean
示例:false 是否有库存
必填
hotScore
int
示例:0 热度评分
必填
brandId
int
示例:9 品牌id
必填
catalogId
int
示例:225 分类id,手机不就是225吗哈哈哈
必填
brandName
string
示例:华为 品牌名
必填
brandImg
string
示例:https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-18/de2426bd-a689-41d0-865a-d45d1afa7cde_huawei.png
必填
catalogName
string
示例:手机
必填
attrs
array
数据列表
必填
attrId
int
示例:15
必填
attrName
string
示例:CPU品牌
必填
attrValue
string
示例:海思(Hisilicon)
必填
pageNum
int
示例:1
必填
total
int
示例:2
必填
totalPages
int
示例:1
必填
pageNavs
array
数据列表
必填
brands
array
数据列表
必填
brandId
int
示例:9
必填
brandName
string
示例:华为
必填
brandImg
string
示例:https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-18/de2426bd-a689-41d0-865a-d45d1afa7cde_huawei.png
必填
attrs
array
数据列表
必填
attrId
int
示例:15
必填
attrName
string
示例:CPU品牌
必填
attrValue
array
数据列表
必填
catalogs
array
数据列表
必填
catalogId
int
示例:225
必填
catalogName
string
示例:手机
必填
navs
array
数据列表
必填

说明 / 示例

```json 如果传入了品牌名(商家名),或者三级分类的id则会获取后端发回来的这个数据 { "msg": "success", "code": 0, "data": { "product": [ { "skuId": 35, "spuId": 19, "skuTitle": "<b style='color:red'>华为</b> HUAWEI Mate 30 Pro 蓝色 12GB", "skuPrice": 8676.0, "skuImg": "https://qxmall.oss-cn-shenzhen.aliyuncs.com/2020-11-20//aeef54ca-2ec0-4fe5-8654-663eb44f64bc_1f15cdbcf9e1273c.jpg", "saleCount": 0, "hasStock": false, "hotScore": 0, "brandId": 9, "catalogId": 225, "brandName": "华为", "brandImg": "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-18/de2426bd-a689-41d0-865a-d45d1afa7cde_huawei.png", "catalogName": "手机", "attrs": [ { "attrId": 15, "attrName": "CPU品牌", "attrValue": "海思(Hisilicon)" }, { "attrId": 16, "attrName": "CPU型号", "attrValue": "HUAWEI Kirin 980" } ] }, { "skuId": 8, "spuId": 11, "skuTitle": "<b style='color:red'>华为</b> HUAWEI Mate 30 Pro 罗兰紫 8GB+128GB麒麟990旗舰芯片OLED环幕屏双4000万徕卡电影四摄4G全网通手机", "skuPrice": 5799.0, "skuImg": "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-26/60e65a44-f943-4ed5-87c8-8cf90f403018_d511faab82abb34b.jpg", "saleCount": 0, "hasStock": false, "hotScore": 0, "brandId": 9, "catalogId": 225, "brandName": "华为", "brandImg": "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-18/de2426bd-a689-41d0-865a-d45d1afa7cde_huawei.png", "catalogName": "手机", "attrs": [ { "attrId": 15, "attrName": "CPU品牌", "attrValue": "海思(Hisilicon)" }, { "attrId": 16, "attrName": "CPU型号", "attrValue": "HUAWEI Kirin 970" } ] } ], "pageNum": 1, "total": 2, "totalPages": 1, "pageNavs": [ 1 ], "brands": [ { "brandId": 9, "brandName": "华为", "brandImg": "https://gulimall-hello.oss-cn-beijing.aliyuncs.com/2019-11-18/de2426bd-a689-41d0-865a-d45d1afa7cde_huawei.png" } ], "attrs": [ { "attrId": 15, "attrName": "CPU品牌", "attrValue": [ "海思(Hisilicon)" ] }, { "attrId": 16, "attrName": "CPU型号", "attrValue": [ "HUAWEI Kirin 970", "HUAWEI Kirin 980" ] } ], "catalogs": [ { "catalogId": 225, "catalogName": "手机" } ], "navs": [] } } ``` ```java /** * @Description: 封装页面所有可能传递过来的查询条件 * 封装页面可能传递过来的查询条件 */ @Data public class SearchParam { /** * 页面传递过来的全文匹配关键字 */ private String keyword; /** * 三级分类id */ private Long catalog3Id; /** * 品牌id,可以多选 */ private List<Long> brandId; /** * 排序条件:sort=skuprice/salecount/hotscore _desc/_asc 形式为sort=hotScore_asc 要么 sort=hotScore_desc */ private String sort; /** * 是否显示有货 1是有库存 0 是无库存 */ private Integer hasStock; /** * 价格区间查询 * 1_500/_500小于500/500_ 大于500 */ private String skuPrice; /** * 按照属性进行筛选 */ private List<String> attrs; /** * 页码 */ private Integer pageNum = 1; /** * 原生的所有查询条件 */ private String _queryString; }