yapi接口管理工具使用
一 官网地址
二 首先先进行登录或者注册
选择添加项目
示例接口,可以直接导入
[
{
"index": 0,
"name": "分类相关接口",
"desc": "Category Controller",
"add_time": 1656056920,
"up_time": 1656056920,
"list": [
{
"query_path": {
"path": "/admin/category",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "static",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"分类相关接口"
],
"_id": 323246,
"method": "PUT",
"title": "修改分类",
"path": "/admin/category",
"req_params": [],
"req_body_form": [],
"req_headers": [
{
"required": "1",
"_id": "62b571353e1263907bf1feff",
"name": "Content-Type",
"value": "application/json"
}
],
"req_query": [],
"req_body_type": "json",
"res_body_type": "json",
"res_body": "{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"data\":{\"type\":\"string\"},\"msg\":{\"type\":\"string\"}},\"title\":\"R«string»\",\"$$ref\":\"#/definitions/R«string»\",\"required\":[\"code\"]}",
"req_body_other": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\",\"description\":\"分类id\"},\"name\":{\"type\":\"string\",\"description\":\"分类名称\"},\"sort\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"排序\"},\"type\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"分类类型\"}},\"title\":\"CategoryDTO\",\"$$ref\":\"#/definitions/CategoryDTO\",\"required\":[\"id\",\"name\",\"sort\",\"type\"]}",
"project_id": 10518,
"catid": 105908,
"uid": 12769,
"add_time": 1656056920,
"up_time": 1656058165,
"__v": 0,
"desc": "",
"markdown": ""
},
{
"query_path": {
"path": "/admin/category/page",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "static",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"分类相关接口"
],
"_id": 323252,
"method": "GET",
"title": "分类分页查询",
"path": "/admin/category/page",
"req_params": [],
"req_body_form": [],
"req_headers": [],
"req_query": [
{
"required": "0",
"_id": "62b5734b3e12637221f1ff20",
"name": "name",
"example": "传统主食",
"desc": "分类名称"
},
{
"required": "1",
"_id": "62b5734b3e1263549af1ff1f",
"name": "page",
"example": "1",
"desc": "页码"
},
{
"required": "1",
"_id": "62b5734b3e1263289cf1ff1e",
"name": "pageSize",
"example": "10",
"desc": "每页记录数"
},
{
"required": "0",
"_id": "62b5734b3e12630237f1ff1d",
"name": "type",
"example": "1",
"desc": "分类类型:1为菜品分类,2为套餐分类"
}
],
"req_body_type": "raw",
"res_body_type": "json",
"res_body": "{\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"number\"},\"msg\":{\"type\":\"null\"},\"data\":{\"type\":\"object\",\"properties\":{\"total\":{\"type\":\"number\"},\"records\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"number\"},\"type\":{\"type\":\"number\"},\"name\":{\"type\":\"string\"},\"sort\":{\"type\":\"number\"},\"status\":{\"type\":\"number\"},\"createTime\":{\"type\":\"string\"},\"updateTime\":{\"type\":\"string\"},\"createUser\":{\"type\":\"number\"},\"updateUser\":{\"type\":\"number\"}},\"required\":[\"id\",\"type\",\"name\",\"sort\",\"status\",\"createTime\",\"updateTime\",\"createUser\",\"updateUser\"]}}},\"required\":[\"total\",\"records\"]}},\"required\":[\"code\",\"data\"]}",
"project_id": 10518,
"catid": 105908,
"uid": 12769,
"add_time": 1656056921,
"up_time": 1656058699,
"__v": 0,
"desc": "",
"markdown": ""
},
{
"query_path": {
"path": "/admin/category/status/{status}",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "var",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"分类相关接口"
],
"_id": 323254,
"method": "POST",
"title": "启用、禁用分类",
"path": "/admin/category/status/{status}",
"req_params": [
{
"_id": "62b577403e126381baf1ff68",
"name": "status",
"example": "1",
"desc": "1为启用,0为禁用"
}
],
"req_body_form": [],
"req_headers": [
{
"required": "1",
"_id": "62b577403e126329e1f1ff6a",
"name": "Content-Type",
"value": "application/json"
}
],
"req_query": [
{
"required": "1",
"_id": "62b577403e1263dec6f1ff69",
"name": "id",
"example": "100",
"desc": "分类id"
}
],
"req_body_type": "json",
"res_body_type": "json",
"res_body": "{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"data\":{\"type\":\"string\"},\"msg\":{\"type\":\"string\"}},\"title\":\"R«string»\",\"$$ref\":\"#/definitions/R«string»\",\"required\":[\"code\"]}",
"project_id": 10518,
"catid": 105908,
"uid": 12769,
"add_time": 1656056921,
"up_time": 1656059712,
"__v": 0,
"desc": "",
"markdown": "",
"req_body_other": ""
},
{
"query_path": {
"path": "/admin/category",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "static",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"分类相关接口"
],
"_id": 323244,
"method": "POST",
"title": "新增分类",
"path": "/admin/category",
"req_params": [],
"req_body_form": [],
"req_headers": [
{
"required": "1",
"_id": "62b570fb3e1263f42df1fefe",
"name": "Content-Type",
"value": "application/json"
}
],
"req_query": [],
"req_body_type": "json",
"res_body_type": "json",
"res_body": "{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"data\":{\"type\":\"string\"},\"msg\":{\"type\":\"string\"}},\"title\":\"R«string»\",\"$$ref\":\"#/definitions/R«string»\",\"required\":[\"code\"]}",
"req_body_other": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\",\"description\":\"分类名称\"},\"sort\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"排序,按照升序排序\"},\"type\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"分类类型:1为菜品分类,2为套餐分类\"}},\"title\":\"CategoryDTO\",\"$$ref\":\"#/definitions/CategoryDTO\",\"required\":[\"name\",\"sort\",\"type\"]}",
"project_id": 10518,
"catid": 105908,
"uid": 12769,
"add_time": 1656056920,
"up_time": 1656058107,
"__v": 0,
"desc": "",
"markdown": ""
},
{
"query_path": {
"path": "/admin/category",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "static",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"分类相关接口"
],
"_id": 323248,
"method": "DELETE",
"title": "根据id删除分类",
"path": "/admin/category",
"req_params": [],
"req_body_form": [],
"req_headers": [],
"req_query": [
{
"required": "1",
"_id": "62b571bb3e1263ab86f1ff06",
"name": "id",
"example": "100",
"desc": "分类id"
}
],
"req_body_type": "raw",
"res_body_type": "json",
"res_body": "{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"data\":{\"type\":\"string\"},\"msg\":{\"type\":\"string\"}},\"title\":\"R«string»\",\"$$ref\":\"#/definitions/R«string»\",\"required\":[\"code\"]}",
"project_id": 10518,
"catid": 105908,
"uid": 12769,
"add_time": 1656056920,
"up_time": 1656058299,
"__v": 0,
"desc": "",
"markdown": "",
"req_body_other": ""
},
{
"query_path": {
"path": "/admin/category/list",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "static",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"分类相关接口"
],
"_id": 323250,
"method": "GET",
"title": "根据类型查询分类",
"path": "/admin/category/list",
"req_params": [],
"req_body_form": [],
"req_headers": [],
"req_query": [
{
"required": "0",
"_id": "62b572323e12631e94f1ff0a",
"name": "type",
"example": "2",
"desc": "分类类型:1为菜品分类,2为套餐分类"
}
],
"req_body_type": "raw",
"res_body_type": "json",
"res_body": "{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"data\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"createTime\":{\"type\":\"string\",\"format\":\"date-time\"},\"createUser\":{\"type\":\"integer\",\"format\":\"int64\"},\"id\":{\"type\":\"integer\",\"format\":\"int64\"},\"name\":{\"type\":\"string\"},\"sort\":{\"type\":\"integer\",\"format\":\"int32\"},\"status\":{\"type\":\"integer\",\"format\":\"int32\"},\"type\":{\"type\":\"integer\",\"format\":\"int32\"},\"updateTime\":{\"type\":\"string\",\"format\":\"date-time\"},\"updateUser\":{\"type\":\"integer\",\"format\":\"int64\"}},\"title\":\"Category\",\"$$ref\":\"#/definitions/Category\"}},\"msg\":{\"type\":\"string\"}},\"title\":\"R«List«Category»»\",\"$$ref\":\"#/definitions/R«List«Category»»\",\"required\":[\"code\"]}",
"project_id": 10518,
"catid": 105908,
"uid": 12769,
"add_time": 1656056921,
"up_time": 1656058418,
"__v": 0,
"desc": "",
"markdown": ""
}
]
},
{
"index": 0,
"name": "员工相关接口",
"desc": "Employee Controller",
"add_time": 1656056920,
"up_time": 1656056920,
"list": [
{
"query_path": {
"path": "/admin/employee/editPassword",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "static",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"员工相关接口"
],
"_id": 323276,
"method": "PUT",
"title": "修改密码",
"path": "/admin/employee/editPassword",
"req_params": [],
"req_body_form": [],
"req_headers": [
{
"required": "1",
"_id": "62b575263e1263d67ef1ff41",
"name": "Content-Type",
"value": "application/json"
}
],
"req_query": [],
"req_body_type": "json",
"res_body_type": "json",
"res_body": "{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"data\":{\"type\":\"string\"},\"msg\":{\"type\":\"string\"}},\"title\":\"R«string»\",\"$$ref\":\"#/definitions/R«string»\",\"required\":[\"code\"]}",
"req_body_other": "{\"type\":\"object\",\"properties\":{\"empId\":{\"type\":\"integer\",\"format\":\"int64\",\"description\":\"员工id\"},\"newPassword\":{\"type\":\"string\",\"description\":\"新密码\"},\"oldPassword\":{\"type\":\"string\",\"description\":\"旧密码\"}},\"title\":\"PasswordEditDTO\",\"$$ref\":\"#/definitions/PasswordEditDTO\",\"required\":[\"empId\",\"newPassword\",\"oldPassword\"]}",
"project_id": 10518,
"catid": 105911,
"uid": 12769,
"add_time": 1656056922,
"up_time": 1656059174,
"__v": 0,
"desc": "",
"markdown": ""
},
{
"query_path": {
"path": "/admin/employee/status/{status}",
"params": []
},
"edit_uid": 0,
"status": "undone",
"type": "var",
"req_body_is_json_schema": true,
"res_body_is_json_schema": true,
"api_opened": false,
"index": 0,
"tag": [
"员工相关接口"
],
"_id": 323284,
"method": "POST",
"title": "启用、禁用员工账号",
"path": "/admin/employee/status/{status}",
"req_params": [
{
"_id": "62b5772b3e12638732f1ff63",
"name": "status",
"example": "1",
"desc": "状态,1为启用 0为禁用"
}
],
"req_body_form": [],
"req_headers": [
{
"required": "1",
"_id": "62b5772b3e126300d3f1ff65",
"name": "Content-Type",
"value": "application/json"
}
],
"req_query": [
{
"required": "1",
"_id": "62b5772b3e1263e3faf1ff64",
"name": "id",
"desc": "员工id"
}
],
"req_body_type": "json",
"res_body_type": "json",
"res_body": "{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\"},\"data\":{\"type\":\"string\"},\"msg\":{\"type\":\"string\"}},\"title\":\"R«string»\",\"$$ref\":\"#/definitions/R«string»\",\"required\":[\"code\"]}",
"project_id": 10518,
"catid": 105911,
"uid": 12769,
"add_time": 1656056922,
"up_time": 1656059691,
"__v": 0,
"desc": "",
"markdown": "",
"req_body_other": ""
}
]
}
]
本作品采用《CC 协议》,转载必须注明作者和本文链接
说实话 不好用