This commit is contained in:
2025-04-16 22:52:54 +08:00
parent 1a0d461f03
commit 47407b4fd2
4 changed files with 85 additions and 33 deletions

View File

@@ -1,5 +1,42 @@
const _ = require("../import");
/**
* @api {post} /type/titleList titleList
* @apiDescription 获取分类页面,横向分类的标题 接口
* @apiName titleList
* @apiGroup type
* @apiSuccessExample {json} 请求成功的返回:
* {
* "status" : 200,
* "message" : "请求成功"
* "result" : "asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ"
* }
* @apiErrorExample {json} 请求失败的返回
* {
* "status": 404,
* "message" : "请求失败"
* "result": null
* }
* @apiSampleRequest http://127.0.0.1:9090/type/titleList
* @apiVersion 1.0.0
*/
_.router.post('/titleList', async function (req, res, next) {
res.json({
status: 200,
message: '请求成功',
result: [
{ id: 1, title: '小米', content: []},
{ id: 2, title: '魅族', content: [] },
{ id: 3, title: '华为', content: [] },
{ id: 4, title: 'iphone', content: [] },
{ id: 5, title: '三星', content: [] },
{ id: 6, title: '锤子', content: [] },
{ id: 7, title: '诺基亚', content: [] },
]
});
});
/**
* @api {post} /type/list list
* @apiDescription 分类页面获取分类商品的接口