本文档描述了小程序基础的不需要登录的查询接口,包括产品、Banner、配置信息等模块的查询功能。
GET /applet/product/list
type
(必填): 产品类型pageNo
(可选): 页码,默认1pageSize
(可选): 每页大小,默认10classId
(可选): 分类IDkeyword
(可选): 关键词,支持产品名称、描述、详情模糊搜索{
"success": true,
"message": "操作成功!",
"code": 200,
"result": {
"records": [
{
"id": "xxx",
"name": "产品名称",
"info": "产品描述",
"type": "产品类型",
"classId": "分类ID",
"originalPrice": 100.00,
"currentPrice": 80.00,
"unit": "单位",
"detail": "产品详情",
"sold": 100,
"content": "产品内容"
}
],
"total": 100,
"size": 10,
"current": 1
}
}
GET /applet/product/detail
id
(必填): 产品ID{
"success": true,
"message": "操作成功!",
"code": 200,
"result": {
"id": "xxx",
"name": "产品名称",
"info": "产品描述",
"type": "产品类型",
"classId": "分类ID",
"originalPrice": 100.00,
"currentPrice": 80.00,
"unit": "单位",
"detail": "产品详情",
"sold": 100,
"content": "产品内容"
}
}
GET /applet/product/category
type
(必填): 产品类型{
"success": true,
"message": "操作成功!",
"code": 200,
"result": [
{
"id": "xxx",
"name": "分类名称",
"description": "分类描述",
"sortOrder": 1,
"type": "产品类型"
}
]
}
GET /applet/banner/list
{
"success": true,
"message": "操作成功!",
"code": 200,
"result": {
"home": [
{
"id": "xxx",
"imageUrl": "图片地址",
"linkUrl": "跳转链接",
"sortOrder": 1,
"type": "home"
}
],
"product": [
{
"id": "xxx",
"imageUrl": "图片地址",
"linkUrl": "跳转链接",
"sortOrder": 1,
"type": "product"
}
]
}
}
GET /applet/config/list
{
"success": true,
"message": "操作成功!",
"code": 200,
"result": [
{
"id": "xxx",
"code": "配置编码",
"info": "配置描述",
"content": "配置内容",
"type": "配置类型"
}
]
}
curl -X GET "http://localhost:8080/applet/product/list?type=1&pageNo=1&pageSize=10&keyword=测试"
curl -X GET "http://localhost:8080/applet/product/detail?id=xxx"
curl -X GET "http://localhost:8080/applet/product/category?type=1"
curl -X GET "http://localhost:8080/applet/banner/list"
curl -X GET "http://localhost:8080/applet/config/list"