From cd5cd205bf84455ec14b2e2cc0b313f2641088ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Mon, 21 Jul 2025 10:00:13 +0800 Subject: [PATCH] add api swagger --- mock-config.json | 255 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) diff --git a/mock-config.json b/mock-config.json index aefdae9..128ad2f 100644 --- a/mock-config.json +++ b/mock-config.json @@ -823,7 +823,262 @@ } } } +},{ + "method": "GET", + "path": "/api/nursing-home/list", + "response": { + "area": "锦泽安康", + "list": [ + { + "id": "nh_001", + "name": "泰康之家·锦绣府", + "location": "杨浦区", + "distance": "5.2km", + "pricePerDay": 200.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-01.png" + }, + { + "id": "nh_002", + "name": "幸福家园养老中心", + "location": "杨浦区", + "distance": "5.2km", + "pricePerDay": 120.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-02.png" + }, + { + "id": "nh_003", + "name": "祥和老年之家", + "location": "杨浦区", + "distance": "5.2km", + "pricePerDay": 500.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-03.png" + }, + { + "id": "nh_004", + "name": "夕阳红养老院", + "location": "杨浦区", + "distance": "5.2km", + "pricePerDay": 120.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-04.png" + }, + { + "id": "nh_005", + "name": "福寿康宁养老院", + "location": "杨浦区", + "distance": "8.2km", + "pricePerDay": 620.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-05.png" + }, + { + "id": "nh_006", + "name": "乐龄康养老院", + "location": "杨浦区", + "distance": "5.2km", + "pricePerDay": 120.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-06.png" + }, + { + "id": "nh_007", + "name": "薛城康养老院", + "location": "薛城区", + "distance": "44.2km", + "pricePerDay": 120.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-07.png" + },{ + "id": "nh_008", + "name": "峄城康养老院", + "location": "峄城区", + "distance": "19.2km", + "pricePerDay": 120.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-08.png" + },{ + "id": "nh_009", + "name": "台儿庄康养老院", + "location": "台儿庄", + "distance": "25.2km", + "pricePerDay": 120.0, + "image": "https://res.klyj.jinzejk.com/nursing/nh-09.png" + } + ] + }, + "swagger": { + "summary": "获取养老院列表", + "description": "返回指定区域下的养老院信息,包括名称、位置、价格、距离和图片", + "responses": { + "200": { + "description": "养老院列表数据", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "area": { "type": "string" }, + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { "type": "string" }, + "name": { "type": "string" }, + "location": { "type": "string" }, + "distance": { "type": "string" }, + "pricePerDay": { "type": "number" }, + "image": { "type": "string" } + } + } + } + } + } + } + } + } + } + } +}, +{ + "method": "GET", + "path": "/api/nursing/detail", + "response": { + "code": 200, + "message": "ok", + "data": { + "id": 1, + "name": "福寿康宁养老院-杨浦店", + "coverImage": "https://res.klyj.jinzejk.com/nursing/cover.png", + "price": { + "amount": 200.00, + "unit": "天/起" + }, + "location": { + "district": "杨浦区", + "distance": "5.2km", + "address": "山东省济南市某某区幸福小区5号10楼1003室", + "mapUrl": "https://map.example.com/?q=福寿康宁养老院-杨浦店" + }, + "contact": { + "phone": "400-800-1234", + "wechatShare": true + }, + "description": "泰康之家·锦绣府于2021年7月30日开业,位于上海市中心城区浦东内环内,临近陆家嘴CBD和优质三甲医院——交通大学附属仁济医院,是泰康之家在上海继和熹之后的第二个养老社区项目。", + "album": { + "total": 225, + "categories": ["全部照片", "视频", "门店环境", "服务展示"], + "images": [ + "https://res.klyj.jinzejk.com/nursing/1.png", + "https://res.klyj.jinzejk.com/nursing/2.png", + "https://res.klyj.jinzejk.com/nursing/3.png", + "https://res.klyj.jinzejk.com/nursing/4.png", + "https://res.klyj.jinzejk.com/nursing/5.png", + "https://res.klyj.jinzejk.com/nursing/6.png", + "https://res.klyj.jinzejk.com/nursing/7.png", + "https://res.klyj.jinzejk.com/nursing/9.png", + "https://res.klyj.jinzejk.com/nursing/10.png", + "https://res.klyj.jinzejk.com/nursing/11.png", + "https://res.klyj.jinzejk.com/nursing/12.png", + "https://res.klyj.jinzejk.com/nursing/13.png", + "https://res.klyj.jinzejk.com/nursing/14.png" + ] + }, + "tags": ["机构介绍", "地理位置", "环境优质", "医养结合"], + "actions": { + "canReserve": true, + "reserveText": "立即预约", + "consultText": "电话咨询" + } + } + }, + "swagger": { + "summary": "获取养老院详情", + "description": "返回指定 ID 的养老机构详情信息,包括价格、地址、图片、机构介绍等内容。", + "parameters": [ + { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "integer" + }, + "description": "养老院ID" + } + ], + "responses": { + "200": { + "description": "养老院详情", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { "type": "integer" }, + "message": { "type": "string" }, + "data": { + "type": "object", + "properties": { + "id": { "type": "integer" }, + "name": { "type": "string" }, + "coverImage": { "type": "string" }, + "price": { + "type": "object", + "properties": { + "amount": { "type": "number" }, + "unit": { "type": "string" } + } + }, + "location": { + "type": "object", + "properties": { + "district": { "type": "string" }, + "distance": { "type": "string" }, + "address": { "type": "string" }, + "mapUrl": { "type": "string" } + } + }, + "contact": { + "type": "object", + "properties": { + "phone": { "type": "string" }, + "wechatShare": { "type": "boolean" } + } + }, + "description": { "type": "string" }, + "album": { + "type": "object", + "properties": { + "total": { "type": "integer" }, + "categories": { + "type": "array", + "items": { "type": "string" } + }, + "images": { + "type": "array", + "items": { "type": "string" } + } + } + }, + "tags": { + "type": "array", + "items": { "type": "string" } + }, + "actions": { + "type": "object", + "properties": { + "canReserve": { "type": "boolean" }, + "reserveText": { "type": "string" }, + "consultText": { "type": "string" } + } + } + } + } + } + } + } + } + } + } + } } + + ]