ElderlyCare-MockServer/mock-config.json

299 lines
6.9 KiB
JSON

[
{
"method": "GET",
"path": "/api/demo/user",
"response": {
"code": 200,
"msg": "mock success",
"users|5": [
{
"id|+1": 6,
"name": "@cname",
"age": "@integer(20,40)",
"email": "@email"
}
]
}
},
{
"method": "GET",
"path": "/api/notice/list",
"response": {
"list|3": [
{
"id|+1": 3000,
"title": "@ctitle(10, 20)",
"content": "@cparagraph(2, 4)",
"author": "@cname",
"publishDate": "@date"
}
]
}
},
{
"method": "GET",
"path": "/api/mall/recommend",
"response": {
"products|4": [
{
"id|+1": 1001,
"name": "@pick(['老年精纺防尿湿纸尿裤 医用护理','防摔防滑地垫 卫生间适老化改造专用','多功能床边扶手 起夜支撑辅助器','老人专用加厚棉拖鞋'])",
"price": "@float(39, 9999, 2, 2)",
"image": "@image('200x200', '#f4f4f4', '商品图')",
"soldCount": "@natural(50, 999)"
}
]
}
},
{
"method": "GET",
"path": "/api/mall/category/list",
"response": {
"categories": [
{
"id": 1,
"name": "推荐",
"icon": "✨",
"description": "系统精选热销好物"
},
{
"id": 2,
"name": "居家安全",
"icon": "🪑",
"description": "适老化家具与防护设施"
},
{
"id": 3,
"name": "出行助理",
"icon": "🧳",
"description": "轮椅、手杖、出行辅助工具"
},
{
"id": 4,
"name": "洗护用品",
"icon": "🧼",
"description": "护理垫、洗护、日常消毒"
}
]
}
},
{
"method": "GET",
"path": "/api/user/address/list",
"response": {
"list": [
{
"id": 1,
"name": "张伟",
"phone": "13812345678",
"fullAddress": "北京市朝阳区光华路8号",
"isDefault": true,
"locationStatus": "正常",
"canEdit": true,
"canDelete": true
},
{
"id": 2,
"name": "李芳",
"phone": "13987654321",
"fullAddress": "上海市浦东新区陆家嘴环路100号",
"isDefault": false,
"locationStatus": "正常",
"canEdit": true,
"canDelete": false
}
]
},
"swagger": {
"summary": "获取用户收货地址列表",
"description": "用于地址管理页展示用户所有地址",
"responses": {
"200": {
"description": "返回地址列表",
"content": {
"application/json": {
"example": {
"code": 200,
"message": "success",
"result": {
"list": [
{
"id": 1,
"name": "刘先生",
"phone": "134****7788",
"fullAddress": "山东省济南市某某区幸福小区5号10楼1003室",
"isDefault": true,
"locationStatus": "正常",
"canEdit": true,
"canDelete": true
},
{
"id": 2,
"name": "刘先生",
"phone": "134****7788",
"fullAddress": "山东省济南市某某区幸福小区5号10楼1003室",
"isDefault": false,
"locationStatus": "选中地址为高亮跳回",
"canEdit": true,
"canDelete": true
}
]
}
}
}
}
}
}
}
},
{
"method": "POST",
"path": "/api/user/address/add",
"response": {
"code": 200,
"message": "地址新增成功",
"result": {
"id": 10086
}
},
"swagger": {
"summary": "新增收货地址",
"description": "用于添加用户的新收货地址信息",
"responses": {
"200": {
"description": "成功响应",
"content": {
"application/json": {
"example": {
"code": 200,
"message": "地址新增成功",
"result": {
"id": 10086
}
}
}
}
}
}
}
},{
"method": "POST",
"path": "/api/user/address/delete",
"response": {
"message": "地址已删除"
},
"swagger": {
"summary": "删除收货地址",
"description": "根据地址ID删除用户地址",
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"example": {
"code": 200,
"message": "地址已删除",
"result": null
}
}
}
}
}
}
},
{
"method": "POST",
"path": "/api/user/address/update",
"response": {
"message": "地址已更新"
},
"swagger": {
"summary": "修改收货地址",
"description": "根据地址ID更新地址信息",
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"example": {
"code": 200,
"message": "地址已更新",
"result": null
}
}
}
}
}
}
}
,{
"method": "POST",
"path": "/api/user/address/set-default",
"response": {
"message": "已设置为默认地址"
},
"swagger": {
"summary": "设置默认地址",
"description": "将指定地址设为默认",
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"example": {
"code": 200,
"message": "已设置为默认地址",
"result": null
}
}
}
}
}
}
},
{
"method": "GET",
"path": "/api/user/address/detail",
"response": {
"id": 2,
"name": "刘先生",
"phone": "134****7788",
"fullAddress": "山东省济南市某某区幸福小区5号10楼1003室",
"isDefault": false
},
"swagger": {
"summary": "获取单个收货地址详情",
"description": "根据地址 ID 获取详细信息,用于编辑表单回显",
"responses": {
"200": {
"description": "成功返回地址信息",
"content": {
"application/json": {
"example": {
"code": 200,
"message": "success",
"result": {
"id": 2,
"name": "刘先生",
"phone": "134****7788",
"fullAddress": "山东省济南市某某区幸福小区5号10楼1003室",
"isDefault": false
},
"extras": null,
"time": "2025-07-10 16:30:00"
}
}
}
}
}
}
}
]