首页 > 其他分享 >《 bilibili-起步级 接口文档设计 经验分享 ~ 》# 用户模块

《 bilibili-起步级 接口文档设计 经验分享 ~ 》# 用户模块

时间:2024-12-09 16:30:55浏览次数:5  
标签:code name data bilibili 文档 模块 msg type id

bilibili - 用户模块接口设计 - 经验分享 ~ #用户模块

数据库er关系图 : 迅速跳转链接
枚举码实体类 : 迅速跳转链接
使用apifox.json格式导入接口文档
步骤

  • 登录Apifox。
  • 新建文件, 将代码粘贴到该文件, 并更改后缀为 .apifox.json
  • 进入项目,点击“导入”。
  • 选择“Apifox”格式,导入文件。

代码

{"apifoxProject":"1.0.0","$schema":{"app":"apifox","type":"project","version":"1.2.0"},"info":{"name":"bilibili","description":"","mockRule":{"rules":[],"enableSystemRule":true}},"apiCollection":[{"name":"根目录","id":46339105,"auth":{},"parentId":0,"serverId":"","description":"","identityPattern":{"httpApi":{"type":"methodAndPath","bodyType":"","fields":[]}},"shareSettings":{},"visibility":"SHARED","preProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"postProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"inheritPostProcessors":{},"inheritPreProcessors":{},"items":[{"name":"用户","id":46339210,"auth":{},"parentId":0,"serverId":"","description":"","identityPattern":{"httpApi":{"type":"inherit","bodyType":"","fields":[]}},"shareSettings":{"folderContentsDisplayingSettings":"CUSTOM_CONTENT"},"visibility":"INHERITED","preProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"postProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"inheritPostProcessors":{},"inheritPreProcessors":{},"items":[{"name":"用户帐号","id":46427186,"auth":{},"parentId":46339210,"serverId":"","description":"","identityPattern":{"httpApi":{"type":"inherit","bodyType":"","fields":[]}},"shareSettings":{},"visibility":"INHERITED","preProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"postProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"inheritPostProcessors":{},"inheritPreProcessors":{},"items":[{"name":"用户登录","api":{"id":"239863959","method":"post","path":"http://localhost:8080/user-accounts/login","parameters":{},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"576782072","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"string"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"200-OK、500-INTERNAL_ERROR 、401-NOT_AUTH","contentType":"json","mediaType":"application/json"}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 200,\n    \"msg\": \"登录成功\",\n    \"data\": \"eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoi6YeR5bq4IiwiaWQiOm51bGwsInVzZXJuYW1lIjoiamlueW9uZyIsImV4cCI6MTczMzIxMDE3OX0.2Fs3N-iT0dFue4zZcO1GL90cW5ZHNjkPPtQEeJJaIS8\"\n}","responseId":576782072,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误!\",\n    \"data\": null\n}","responseId":576782072,"ordering":2},{"name":"认证失败","data":"{\n    \"code\": 401,\n    \"msg\": \"账号或密码不正确\",\n    \"data\": null\n}","responseId":576782072,"ordering":3}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"account":{"type":"string"},"pwd":{"type":"string"}},"required":["account","pwd"],"x-apifox-orders":["account","pwd"]},"example":"{\r\n    \"account\":\"zs123123\",\r\n    \"pwd\":\"123456\"\r\n}","mediaType":""},"description":"用户登录时, 成功则拦截下发JWT令牌, 失败则退回页面","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":10,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.576782072"],"maintainer":"xian","visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"查询账号是否被占用","api":{"id":"240064039","method":"get","path":"http://localhost:8080/user-accounts/{account}","parameters":{"query":[],"path":[{"id":"account#0","name":"account","required":true,"description":"用户的账号","type":"string","enable":true,"example":"zs123123"}]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577139518","code":200,"name":"账号可用","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"boolean","description":"被占用false 可用true 异常null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"200-OK、500-INTERNAL_ERROR、409-CONFLICT","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 200,\n    \"msg\": \"账号可用\",\n    \"data\": true\n}","responseId":577139518,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577139518,"ordering":2},{"name":"账号被占用","data":"{\n    \"code\": 409,\n    \"msg\": \"该账号已被占用\",\n    \"data\": false\n}","responseId":577139518,"ordering":3}],"requestBody":{"type":"none","parameters":[],"example":"{\n    \"account\":\"zs12123\",\n}","mediaType":""},"description":"根据账号检查是否被占用","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":20,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577139518"],"maintainer":"xian","visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"用户注册","api":{"id":"240198495","method":"post","path":"http://localhost:8080/user-accounts/register","parameters":{},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577379404","code":201,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"string","description":"jwt"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"201-CREATED、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 201,\n    \"msg\": \"注册成功\",\n    \"data\": \"eyJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoi6YeR5bq4IiwiaWQiOjEsInVzZXJuYW1lIjoiamlueW9uZyIsImV4cCI6MTczNDIyNTM2MH0.uR1D84PDU39RuP7a6XZWDDveg1qWXCEMSibEunvWLOY\"\n}","responseId":577379404,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577379404,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"account":{"type":"string"},"pwd":{"type":"string"}},"required":["account","pwd"],"x-apifox-orders":["account","pwd"]},"description":"{\n\n}","example":"{\r\n    \"account\":\"zs123123\",\r\n    \"pwd\":\"123123\"\r\n}","mediaType":""},"description":"# 用户注册\n- 注册成功后自动跳转登录, 返回token令牌\n- 后端应该做事务处理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":30,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577379404"],"maintainer":"xian","visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"更改密码","api":{"id":"240214230","method":"put","path":"http://localhost:8080/user-accounts/pwd-update","parameters":{"path":[],"header":[]},"auth":{"type":"jwt","jwt":{"addTokenTo":"header","algorithm":"HS256","secret":"","isSecretBase64Encoded":false,"payload":"","headerPrefix":"","header":""}},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577400339","code":204,"name":"修改成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"204-NOT_CONTENT、500-INTERNAL_ERROR ","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 204,\n    \"msg\": \"修改成功\",\n    \"data\": null\n}","responseId":577400339,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":577400339,"ordering":1}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"uId":{"type":"integer","title":"用户编号"},"pwd":{"type":"string","title":"要更改的密码"}},"required":["uId","pwd"],"x-apifox-orders":["uId","pwd"]},"example":"{\r\n    \"uId\":1,\r\n    \"pwd\":\"123123\"\r\n}","mediaType":""},"description":"# 更改密码\n根据用户编号更改用户账号密码\n- 后端应该做事务处理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":40,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577400339"],"maintainer":"xian","visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"账号注销","api":{"id":"240264236","method":"put","path":"http://localhost:8080/user-accounts/cancel","parameters":{"query":[{"required":false,"description":"前端无需传递,该值由后端自动设置,表示账号是否正常。","type":"string","id":"cTsl9CHs3z","enable":true,"name":"status","schema":{"type":"string","readOnly":true,"const":"1"},"example":"0''注销\" 1\"正常\" 2\"禁用\""}]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577471258","code":204,"name":"注销成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"204-NOT_CONTENT、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 204,\n    \"msg\": \"账号注销成功\",\n    \"data\": null\n}","responseId":577471258,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577471258,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"uId":{"type":"integer"}},"required":["uId"],"x-apifox-orders":["uId"]},"example":"{\r\n    \"uId\":1\r\n}","mediaType":""},"description":"# 账号注销\n根据用户id, 后端处理改变账号状态\n- 后端应该做事务处理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":50,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577471258"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}}]},{"name":"用户","id":46437936,"auth":{},"parentId":46339210,"serverId":"","description":"","identityPattern":{"httpApi":{"type":"inherit","bodyType":"","fields":[]}},"shareSettings":{},"visibility":"INHERITED","preProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"postProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"inheritPostProcessors":{},"inheritPreProcessors":{},"items":[{"name":"用户关注","id":46464480,"auth":{},"parentId":46437936,"serverId":"","description":"","identityPattern":{"httpApi":{"type":"inherit","bodyType":"","fields":[]}},"shareSettings":{},"visibility":"INHERITED","preProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"postProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"inheritPostProcessors":{},"inheritPreProcessors":{},"items":[{"name":"获取关注列表","api":{"id":"240415071","method":"get","path":"http://localhost:8080/users-concerns/{u-id}/concerns","parameters":{"query":[],"path":[{"id":"u-id#0","name":"u-id","required":true,"description":"我的编号","type":"integer","enable":true,"schema":{"type":"integer"},"example":"1"}]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577799135","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"user":{"type":"object","properties":{},"x-apifox-orders":[]}},"x-apifox-orders":["id","user"]},"description":"返回的是当前用户的关注对象"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"200-OK、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\r\n    \"code\": 200,\r\n    \"msg\": \"success\",\r\n    \"data\": [\r\n        {\r\n            \"id\":1,\r\n            \"user\":{\r\n                \"uId\":2,\r\n                \"name\":\"卓卓脑婆\",\r\n                \"picture\":\"xxx.jpg\",\r\n                \"remark\":\"无团队纯个人...\"\r\n            }\r\n        },\r\n        ...\r\n    ]\r\n}","responseId":577799135,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577799135,"ordering":2}],"requestBody":{"type":"none","parameters":[],"mediaType":""},"description":"","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":50,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577799135"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"取消关注","api":{"id":"240521434","method":"delete","path":"http://localhost:8080/user-concerns/cancel","parameters":{"query":[{"required":false,"description":"用户编号","type":"integer","id":"WSa4lFMGTl","enable":true,"name":"u-id","schema":{"type":"integer"},"example":"1"},{"required":false,"description":"关注的人编号","type":"integer","id":"ju92gsOwkm","enable":true,"name":"concern-id","schema":{"type":"integer"},"example":"2"}],"path":[]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577979939","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"OK","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 204,\n    \"msg\": \"已取消关注\",\n    \"data\": null\n}","responseId":577979939,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577979939,"ordering":2}],"requestBody":{"type":"none","parameters":[],"mediaType":""},"description":"# 取消关注\n某个用户{u-id}取消了对某个人{concern-id}的关注\n- 后端应该做事务处理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":60,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577979939"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"关注某人","api":{"id":"240524088","method":"post","path":"http://localhost:8080/user-concerns/concern","parameters":{},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577983686","code":201,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"integer"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"201-CREATED、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 201,\n    \"msg\": \"关注成功\",\n    \"data\": 1\n}","responseId":577983686,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577983686,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"uId":{"type":"integer","title":"ID","description":"我"},"concernId":{"type":"integer","title":"ID","description":"被关注的人"}},"x-apifox-orders":["uId","concernId"],"required":["uId","concernId"]},"example":"{\r\n    \"uId\":1,\r\n    \"concernId\":2\r\n}","mediaType":""},"description":"# 关注\n- 获取当前用户\n- 获取被关注的用户\n- 对用户关注列表资源发起创建请求\n- 后端应该做事务处理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":70,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577983686"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}}]},{"name":"个人资料","api":{"id":"240317584","method":"get","path":"http://localhost:8080/users/{u-id}","parameters":{"query":[],"path":[{"id":"u-id#0","name":"u-id","required":true,"description":"用户ID","type":"string","enable":true,"example":"1"}]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577612242","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"object","properties":{"uId":{"type":"integer"},"name":{"type":"string"},"picture":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"gender":{"type":"integer"},"remark":{"type":"string"},"fansNum":{"type":"integer"},"concernsNum":{"type":"integer"},"likeNum":{"type":"integer"},"collectNum":{"type":"integer"},"issueNum":{"type":"integer"},"commentNum":{"type":"integer"},"acId":{"type":"integer"}},"required":["uId","name","picture","phone","email","gender","remark","fansNum","concernsNum","likeNum","collectNum","issueNum","commentNum","acId"],"x-apifox-orders":["uId","name","picture","phone","email","gender","remark","fansNum","concernsNum","likeNum","collectNum","issueNum","commentNum","acId"]}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"OK","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 200,\n    \"msg\": \"success\",\n    \"data\": {\n        \"uId\": 123,\n        \"name\": \"张三\",\n        \"picture\": \"http://xxx.jpg\",\n        \"phone\": \"13812345678\",\n        \"email\": \"zhangsan@example.com\",\n        \"gender\": 1,\n        \"remark\": \"这是一个简介\",\n        \"fansNum\": 100,\n        \"concernsNum\": 50,\n        \"likeNum\": 200,\n        \"collectNum\": 100,\n        \"issueNum\": 50,\n        \"commentNum\": 100\n    }\n}","responseId":577612242,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577612242,"ordering":2}],"requestBody":{"type":"none","parameters":[],"mediaType":""},"description":"根据编号查询用户基本信息","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":10,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577612242"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"模糊匹配所有用户","api":{"id":"240349936","method":"get","path":"http://localhost:8080/users/{name}","parameters":{"query":[{"required":false,"description":"前端无需传递,该值由后端自动设置,表示账号是否正常。","type":"string","id":"2jkJMofl5Z","enable":true,"name":"status","schema":{"type":"string","readOnly":true},"example":"0''注销\" 1\"正常\" 2\"禁用\""}],"path":[{"id":"name#0","name":"name","required":true,"description":"用户名","type":"string","enable":true,"example":"逗比的雀巢"}]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577649016","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"uId":{"type":"integer"},"name":{"type":"string"},"picture":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"gender":{"type":"integer"},"remark":{"type":"string"},"fansNum":{"type":"integer"},"concernsNum":{"type":"integer"},"likeNum":{"type":"integer"},"collectNum":{"type":"integer"},"issueNum":{"type":"integer"},"commentNum":{"type":"integer"},"userAccount":{"type":"object","properties":{"acId":{"type":"integer"},"status":{"type":"string"}},"required":["acId","status"],"x-apifox-orders":["acId","status"]}},"x-apifox-orders":["uId","name","picture","phone","email","gender","remark","fansNum","concernsNum","likeNum","collectNum","issueNum","commentNum","userAccount"]}}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"OK","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 200,\n    \"msg\": \"success\",\n    \"data\": [\n        {\n            \"uId\": 123,\n            \"name\": \"张三\",\n            \"picture\": \"http://xxx.jpg\",\n            \"phone\": \"13812345678\",\n            \"email\": \"zhangsan@example.com\",\n            \"gender\": 1,\n            \"remark\": \"你好我是张三\",\n            \"fansNum\": 100,\n            \"concernsNum\": 50,\n            \"likeNum\": 200,\n            \"collectNum\": 100,\n            \"issueNum\": 50,\n            \"commentNum\": 100,\n            \"userAccount\": {\n                \"acId\": 1,\n                \"status\": \"1\"\n            }\n        },\n        ...\n    ]\n}","responseId":577649016,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577649016,"ordering":2}],"requestBody":{"type":"none","parameters":[],"mediaType":""},"description":"## 模糊查询\n- 根据姓名对用户进行模糊匹配\n- 返回所有账号状态 0(注销) 和 1(正常) 的用户","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":20,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577649016"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"更新用户资料","api":{"id":"240366367","method":"put","path":"http://localhost:8080/users","parameters":{"path":[],"header":[]},"auth":{"type":"jwt","jwt":{"addTokenTo":"header","algorithm":"HS256","secret":"","isSecretBase64Encoded":false,"payload":"","headerPrefix":"","header":""}},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577701408","code":204,"name":"更新成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"NOT_CONTENT ","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 204,\n    \"msg\": \"更新成功\",\n    \"data\": null\n}","responseId":577701408,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577701408,"ordering":2},{"name":"没有权限","data":"{\n    \"code\": 401,\n    \"msg\": \"NOT_LOGIN\",\n    \"data\": null\n}","responseId":577701408,"ordering":3}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"gender":{"type":"integer"},"remark":{"type":"string"}},"required":["name","phone","email","gender","remark"],"x-apifox-orders":["name","phone","email","gender","remark"]},"example":"{\r\n    \"name\":\"张三\",\r\n    \"phone\":\"18967123781\",\r\n    \"email\":\"zhangsan@qq.com\",\r\n    \"gender\":0,\r\n    \"remark\":\"这个人很懒\"\r\n}","mediaType":""},"description":"更改用户基本信息","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":30,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577701408"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"头像上传","api":{"id":"240395783","method":"post","path":"http://localhost:8080/users/picture-upload","parameters":{"header":[]},"auth":{"type":"jwt","jwt":{"addTokenTo":"header","algorithm":"HS256","secret":"","isSecretBase64Encoded":false,"payload":"","headerPrefix":"Bearer","header":""}},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577748663","code":201,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"string"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"CREATED","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 201,\n    \"msg\": \"上传成功\",\n    \"data\": \"localhost:8080//xxx.jpg\"\n}","responseId":577748663,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577748663,"ordering":2},{"name":"文件过大","data":"{\n    \"code\": 400,\n    \"msg\": \"上传文件过大\",\n    \"data\": null\n}","responseId":577748663,"ordering":3},{"name":"没有权限","data":"{\n    \"code\": 401,\n    \"msg\": \"NOT_LOGIN\",\n    \"data\": null\n}","responseId":577748663,"ordering":4}],"requestBody":{"type":"multipart/form-data","parameters":[{"required":false,"description":"用户头像","type":"file","id":"6rnR1Rsqyg","example":"file://C:\\Users\\贤\\Pictures\\86097313_p0.jpg","enable":true,"name":"picture","schema":{"format":"binary","type":"string"}}],"mediaType":""},"description":"","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":40,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577748663"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}}]},{"name":"用户收藏","id":46484465,"auth":{},"parentId":46339210,"serverId":"","description":"","identityPattern":{"httpApi":{"type":"inherit","bodyType":"","fields":[]}},"shareSettings":{},"visibility":"INHERITED","preProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"postProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"inheritPostProcessors":{},"inheritPreProcessors":{},"items":[{"name":"收藏夹","id":46785518,"auth":{},"parentId":46484465,"serverId":"","description":"","identityPattern":{"httpApi":{"type":"inherit","bodyType":"","fields":[]}},"shareSettings":{},"visibility":"INHERITED","preProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"postProcessors":[{"id":"inheritProcessors","type":"inheritProcessors","data":{}}],"inheritPostProcessors":{},"inheritPreProcessors":{},"items":[{"name":"创建收藏夹","api":{"id":"242091778","method":"post","path":"http://localhost:8080/user-collects/collect-folders/create-1","parameters":{"path":[]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"580837424","code":201,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"CREATED ","contentType":"json","mediaType":"201-CREATED、500-INTERNAL_ERROR"}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 201,\n    \"msg\": \"创建成功\",\n    \"data\": null\n}","responseId":580837424,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":580837424,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"cover":{"type":"string"},"name":{"type":"string"},"creTime":{"type":"string"},"remark":{"type":"string"}},"required":["cover","name","creTime","remark"],"x-apifox-orders":["cover","name","creTime","remark"]},"example":"{\r\n    \"cover\":\"xxx.jpg\",\r\n    \"name\":\"精选收藏夹\",\r\n    \"creTime\":\"2020-12-02\",\r\n    \"remark\":\"在这里输入描述\"\r\n}","mediaType":""},"description":"# 两种方式创建收藏夹\n## 第一种方式\n- 直接在收藏页面中创建收藏夹\n","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":60,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.580837424"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"更新收藏夹","api":{"id":"242160475","method":"put","path":"http://localhost:8080/user-collects/collect-folders","parameters":{},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"580949290","code":204,"name":"删除成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"204-NOT_CONTENT、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 204,\n    \"msg\": \"更新成功\",\n    \"data\": null\n}","responseId":580949290,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":580949290,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{}},"example":"{\r\n    \"uId\":1,\r\n    \"cover\":\"xxx02.jpg\",\r\n    \"name\":\"精选收藏夹02\",\r\n    \"creTime\":\"2020-12-03\",\r\n    \"remark\":\"\"\r\n}","mediaType":""},"description":"对收藏夹信息进行更改","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":60,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.580949290"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"创建收藏夹2","api":{"id":"242100706","method":"post","path":"http://localhost:8080/user-collects/collect-folders/create-2","parameters":{},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"580854735","code":201,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"201-CREATED、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 201,\n    \"msg\": \"创建并收藏成功\",\n    \"data\": null\n}","responseId":580854735,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":580854735,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"collectFolders":{"type":"object","properties":{"uId":{"type":"integer"},"cover":{"type":"string"},"name":{"type":"string"},"creTime":{"type":"string"},"remark":{"type":"string"}},"required":["uId","cover","name","creTime","remark"],"x-apifox-orders":["uId","cover","name","creTime","remark"],"title":"收藏夹"},"userCollect":{"type":"object","properties":{"uId":{"type":"integer"},"issId":{"type":"integer"},"cfId":{"type":"integer"}},"required":["uId","issId","cfId"],"x-apifox-orders":["uId","issId","cfId"],"title":"用户收藏列表"}},"required":["collectFolders","userCollect"],"x-apifox-orders":["collectFolders","userCollect"]},"example":"{\r\n    \"collectFolders\":{\r\n        \"uId\":1,\r\n        \"cover\":\"xxx.jpg\",\r\n        \"name\":\"精选收藏夹\",\r\n        \"creTime\":\"2020-12-02\",\r\n        \"remark\":\"在这里输入描述\"\r\n    },\r\n    \"userCollect\":{\r\n        \"uId\": 1,\r\n        \"issId\": 1,\r\n        \"cfId\": 1\r\n    }\r\n}\r\n","mediaType":""},"description":"# 两种方式创建收藏夹\n## 第二种方式\n- 在收藏作品时创建收藏夹, 主键回显\n- 再根据回显的主键将作品放入到该文件夹中","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":70,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.580854735"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"删除收藏夹","api":{"id":"242178937","method":"delete","path":"http://localhost:8080/user-collects/collect-folders","parameters":{},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"580978942","code":204,"name":"删除成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"204-NOT_CONTENT、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 204,\n    \"msg\": \"删除成功\",\n    \"data\": null\n}","responseId":580978942,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":580978942,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"uId":{"type":"integer","title":"用户编号","description":"获取当前操作的用户"},"cfId":{"type":"integer","title":"收藏夹编号","description":"传递操作的收藏夹"}},"required":["uId","cfId"],"x-apifox-orders":["uId","cfId"]},"example":"{\r\n    \"uId\":1,\r\n    \"cfId\":2\r\n}","mediaType":""},"description":"# 删除收藏夹\n并且批量删除该收藏夹里面所有的收藏作品, 类似于`部门解散`\n- 后端应该做事务管理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":80,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.580978942"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}}]},{"name":"获取收藏夹列表","api":{"id":"240527856","method":"get","path":"http://localhost:8080/user-collects/{u-id}","parameters":{"path":[{"id":"u-id#0","name":"u-id","required":true,"description":"用户编号","type":"string","enable":true,"example":"1"}]},"auth":{"type":"jwt","jwt":{"addTokenTo":"header","algorithm":"HS256","secret":"","isSecretBase64Encoded":false,"payload":"","headerPrefix":"","header":""}},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"577979779","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"creTime":{"type":"string"},"remark":{"type":"string"}},"x-apifox-orders":["name","creTime","remark"],"description":"收藏夹类型"}}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"200-OK、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\r\n    \"code\": 200,\r\n    \"msg\": \"success\",\r\n    \"data\": [\r\n        {\r\n            \"name\":\"收藏夹A\",\r\n            \"creTime\":\"2023-01-04\",\r\n            \"remark\":\"介绍你的收藏夹 ~\"\r\n        },\r\n        ...\r\n    ]\r\n}","responseId":577979779,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":577979779,"ordering":2}],"requestBody":{"type":"none","parameters":[],"mediaType":""},"description":"获取当前用户创建的所有收藏夹","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":10,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.577979779"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"收藏作品","api":{"id":"241021556","method":"post","path":"http://localhost:8080/user-collects","parameters":{"path":[]},"auth":{"type":"jwt","jwt":{"addTokenTo":"header","algorithm":"HS256","secret":"","isSecretBase64Encoded":false,"payload":"","headerPrefix":"","header":""}},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"578893436","code":201,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"CREATED","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 201,\n    \"msg\": \"收藏成功\",\n    \"data\": null\n}","responseId":578893436,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现错误\",\n    \"data\": null\n}","responseId":578893436,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"uId":{"type":"string","description":"当前用户","title":"用户编号"},"issId":{"type":"string","description":"收藏的作品编号","title":"作品编号"},"cfId":{"type":"string","description":"放进那个收藏夹","title":"收藏夹编号"}},"x-apifox-orders":["uId","issId","cfId"],"required":["uId","issId","cfId"]},"example":"{\r\n    \"uId\": 1,\r\n    \"issId\": 1,\r\n    \"cfId\": 1\r\n}","mediaType":""},"description":"# 收藏\n- 获取当前用户编号\n- 获取收藏的作品编号\n- 对用户收藏列表资源发起创建请求\n- 后端应该做事务处理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":20,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.578893436"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"取消收藏","api":{"id":"242085268","method":"delete","path":"http://localhost:8080/user-collects/cancel/{iss-id}","parameters":{"path":[{"id":"iss-id#0","name":"iss-id","required":true,"description":"","type":"string","enable":true}]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"580832545","code":204,"name":"删除成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"null"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 201,\n    \"msg\": \"删除成功\",\n    \"data\": null\n}","responseId":580832545,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":580832545,"ordering":2}],"requestBody":{"type":"none","parameters":[],"mediaType":""},"description":"# 取消收藏\n用户对收藏作品取消收藏\n- 原理是对用户收藏列表资源发起删除请求\n- 后端应该做事务处理","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":30,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.580832545"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"所有收藏","api":{"id":"242086199","method":"get","path":"http://localhost:8080/user-collects/{u-id}","parameters":{"path":[{"id":"u-id#0","name":"u-id","required":true,"description":"用户的编号","type":"string","enable":true,"example":"1"}]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"580832601","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"issId":{"type":"integer"},"itId":{"type":"integer"}},"x-apifox-orders":["issId","itId"]}}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"200-OK、500-INTERNAL_ERROR","contentType":"json","mediaType":""}],"responseExamples":[{"name":"成功示例","data":"{\n    \"code\": 200,\n    \"msg\": \"success\",\n    \"data\": [\n        {\n            \"issId\": 1,\n            \"itId\": 2\n        },\n        ...\n    ]\n}","responseId":580832601,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":580832601,"ordering":2}],"requestBody":{"type":"none","parameters":[],"mediaType":""},"description":"# 获取当前用户的所有收藏信息\n## 后端\n1. 获取收藏的作品类型, 用于分类视频、专栏、音频收藏类型..  \n2. 根据作品的收藏时间进行排序\n3. 仅返回收藏作品的类型\n\n# 前端\n1. 通过后端返回的作品类型进行分类 '普通收藏夹(视频)、专题收藏夹、图文收藏夹...'\n2. 进入页面请求'获取收藏夹列表'接口\n3. 默认打开视频收藏类型的默认收藏夹","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":40,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.580832601"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}},{"name":"打开收藏夹","api":{"id":"242091233","method":"get","path":"http://localhost:8080/user-collects/collect-folders","parameters":{"path":[]},"auth":{},"commonParameters":{"query":[],"body":[],"cookie":[],"header":[]},"responses":[{"id":"580837416","code":200,"name":"成功","headers":[],"jsonSchema":{"type":"object","properties":{"code":{"type":"integer"},"msg":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"uId":{"type":"integer","description":"当前用户编号"},"issue":{"type":"object","properties":{"issId":{"type":"integer"},"title":{"type":"string"},"creTime":{"type":"string"},"user":{"type":"object","properties":{"uId":{"type":"integer","description":"作者编号"},"name":{"type":"string","description":"作者姓名"}},"required":["uId","name"],"x-apifox-orders":["uId","name"]},"commentNum":{"type":"integer"},"watchNum":{"type":"integer"}},"required":["issId","title","creTime","user","commentNum","watchNum"],"x-apifox-orders":["issId","title","creTime","user","commentNum","watchNum"],"description":"收藏的作品信息"}},"x-apifox-orders":["uId","issue"],"description":"收藏的作品信息"},"description":"返回的是一个数组"}},"required":["code","msg","data"],"x-apifox-orders":["code","msg","data"]},"description":"200-OK、500-INTERNAL_ERROR","contentType":"json","mediaType":"application/json"}],"responseExamples":[{"name":"成功示例","data":"{\r\n    \"code\": 200,\r\n    \"msg\": \"success\",\r\n    \"data\": [\r\n        { \r\n            \"uId\":1, \r\n            \"issue\":{\r\n                \"issId\":1,\r\n                \"cover\":\"https://xxx.jpg\",\r\n                \"title\":\"一键三连变成女孩子是坠可爱的\",\r\n                \"creTime\":\"2020-10-20 10:20:30\",\r\n                \"user\":{\r\n                    \"uId\":1,\r\n                    \"name\":\"略nb\"\r\n                },\r\n                \"commentNum\":1000,\r\n                \"watchNum\":1000000\r\n            }\r\n        },\r\n        ...\r\n    ]\r\n}","responseId":580837416,"ordering":1},{"name":"异常示例","data":"{\n    \"code\": 500,\n    \"msg\": \"服务器出现异常\",\n    \"data\": null\n}","responseId":580837416,"ordering":2}],"requestBody":{"type":"application/json","parameters":[],"jsonSchema":{"type":"object","properties":{"uId":{"type":"integer","description":"后端-先过滤出当前用户的收藏列表","title":"用户编号"},"cfId":{"type":"integer","description":"后端-再过滤出当前收藏夹的作品","title":"收藏夹编号"}},"required":["uId","cfId"],"x-apifox-orders":["uId","cfId"]},"example":"{\r\n    \"uId\":1,\r\n    \"cfId\":2\r\n}","mediaType":""},"description":"打开用户点击的收藏夹","tags":[],"status":"developing","serverId":"","operationId":"","sourceUrl":"","ordering":50,"cases":[],"mocks":[],"customApiFields":"{}","advancedSettings":{"disabledSystemHeaders":{}},"mockScript":{},"codeSamples":[],"commonResponseStatus":{},"responseChildren":["BLANK.580837416"],"visibility":"INHERITED","preProcessors":[],"postProcessors":[],"inheritPostProcessors":{},"inheritPreProcessors":{}}}]}]}]}],"socketCollection":[],"docCollection":[],"responseCollection":[{"_databaseId":5790079,"updatedAt":"2024-12-02T02:46:59.000Z","name":"根目录","type":"root","children":[],"parentId":0,"id":5790079,"items":[]}],"schemaCollection":[],"requestCollection":[{"name":"根目录","children":[],"items":[]}],"environments":[],"commonScripts":[],"globalVariables":[{"id":"5547799","variables":[]}],"commonParameters":{"id":686855,"createdAt":"2024-12-02T07:42:17.000Z","updatedAt":"2024-12-02T07:42:17.000Z","deletedAt":null,"parameters":{},"projectId":5547799,"creatorId":2623617,"editorId":2623617},"projectSetting":{"id":"5570421","auth":{},"servers":[{"id":"default","name":"默认服务"}],"gateway":[],"language":"zh-CN","apiStatuses":["developing","testing","released","deprecated"],"mockSettings":{},"preProcessors":[],"postProcessors":[],"advancedSettings":{"enableJsonc":false,"enableBigint":false,"responseValidate":true,"enableTestScenarioSetting":false,"enableYAPICompatScript":false,"isDefaultUrlEncoding":2,"publishedDocUrlRules":{"defaultRule":"RESOURCE_KEY_ONLY","resourceKeyStandard":"NEW"},"folderShareExpandModeSettings":{"expandId":[],"mode":"AUTO"}},"initialDisabledMockIds":[],"cloudMock":{"security":"free","enable":false,"tokenKey":"apifoxToken"}},"customFunctions":[],"projectAssociations":[]}

如果这篇文章帮到你, 帮忙点个关注呗, 点赞或收藏也行鸭 ~ (。•ᴗ-)✧

在这里插入图片描述
'(இ﹏இ`。)

                                                   以下是轻描述


用户帐号

用户登录

URL: POST /user-accounts/login

请求参数:

参数名类型必选描述
accountstring用户账号
pwdstring用户密码

请求示例:

     {
       "account": "zs123123",
       "pwd": "123456"
     }

返回示例:

  • 200 OK: 登录成功,返回 JWT 令牌。
    {
         "code": 200,
         "msg": "登录成功",
         "data": "eyJhbGciOiJIUzI1NiJ9..."
    }
    
  • 401 NOT_AUTH: 账号或密码错误。
    {
         "code": 401,
         "msg": "账号或密码不正确",
         "data": null
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。
    {
         "code": 500,
         "msg": "服务器出现错误!",
         "data": null
    }
    

查询账号是否被占用

URL: GET /user-accounts/{account}

请求参数:

参数名类型必选描述
accountstring用户账号

返回示例:

  • 200 OK: 账号可用。
    {
         "code": 200,
         "msg": "账号可用",
         "data": true
    }
    
  • 409 CONFLICT: 账号已被占用。
    {
         "code": 409,
         "msg": "该账号已被占用",
         "data": false
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。
    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

用户注册

URL: POST /user-accounts/register

请求参数:

参数名类型必选描述
accountstring用户账号
pwdstring用户密码

请求示例:

{
     "account": "zs123123",
     "pwd": "123123"
}

返回示例:

  • 201 CREATED: 注册成功,返回 JWT。
    {
         "code": 201,
         "msg": "注册成功",
         "data": "eyJhbGciOiJIUzI1NiJ9..."
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。
    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

更改密码

URL: PUT /user-accounts/pwd-update

请求参数:

参数名类型必选描述
uIdinteger用户编号
pwdstring新密码

请求示例:

{
     "uId": 1,
     "pwd": "123123"
}

返回示例:

  • 204 NO_CONTENT: 修改成功。
    {
         "code": 204,
         "msg": "修改成功",
         "data": null
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。
    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

账号注销

URL: PUT /user-accounts/cancel

请求参数:

参数名类型必选描述
uIdinteger用户编号

请求示例:

{
     "uId": 1
}

返回示例:

  • 204 NO_CONTENT: 注销成功。
    {
         "code": 204,
         "msg": "账号注销成功",
         "data": null
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。
    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

用户

获取用户基本信息

URL: GET /users/{u-id}

请求参数:

参数名类型必选描述
u-idstring用户ID

请求示例:

GET /users/123

返回示例:

  • 200 OK: 查询成功。

    {
         "code": 200,
         "msg": "success",
         "data": {
              "uId": 123,
              "name": "张三",
              "picture": "http://xxx.jpg",
              "phone": "13812345678",
              "email": "zhangsan@example.com",
              "gender": 1,
              "remark": "这是一个简介",
              "fansNum": 100,
              "concernsNum": 50,
              "likeNum": 200,
              "collectNum": 100,
              "issueNum": 50,
              "commentNum": 100
         }
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。

    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

模糊查询用户

URL: GET /users/{name}

请求参数:

参数名类型必选描述
namestring用户名
statusstring账号状态(由后端自动设置)

请求示例:

GET /users/张三

返回示例:

  • 200 OK: 查询成功。

    {
         "code": 200,
         "msg": "success",
         "data": [
              {
                   "uId": 123,
                   "name": "张三",
                   "picture": "http://xxx.jpg",
                   "phone": "13812345678",
                   "email": "zhangsan@example.com",
                   "gender": 1,
                   "remark": "你好我是张三",
                   "fansNum": 100,
                   "concernsNum": 50,
                   "likeNum": 200,
                   "collectNum": 100,
                   "issueNum": 50,
                   "commentNum": 100,
                   "userAccount": {
                        "acId": 1,
                        "status": "1"
                   }
              }
         ]
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。

    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

更新用户资料

URL: PUT /users

请求参数:

参数名类型必选描述
namestring用户名
phonestring电话号码
emailstring邮箱
genderinteger性别(0: 女, 1: 男)
remarkstring个人简介

请求示例:

{
     "name": "张三",
     "phone": "18967123781",
     "email": "zhangsan@qq.com",
     "gender": 0,
     "remark": "这个人很懒"
}

返回示例:

  • 204 NO_CONTENT: 更新成功。

    {
         "code": 204,
         "msg": "更新成功",
         "data": null
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。

    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    
  • 401 UNAUTHORIZED: 未登录。

    {
         "code": 401,
         "msg": "NOT_LOGIN",
         "data": null
    }
    

头像上传

URL: POST /users/picture-upload

请求参数:

参数名类型必选描述
picturestring头像文件路径

请求示例:

{
     "picture": "file://C:/Users/贤/Pictures/86097313_p0.jpg"
}

返回示例:

  • 201 CREATED: 上传成功。

    {
         "code": 201,
         "msg": "上传成功",
         "data": "localhost:8080//xxx.jpg"
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。

    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    
  • 400 BAD_REQUEST: 上传文件过大。

    {
         "code": 400,
         "msg": "上传文件过大",
         "data": null
    }
    
  • 401 UNAUTHORIZED: 未登录。

    {
         "code": 401,
         "msg": "NOT_LOGIN",
         "data": null
    }
    

获取关注列表

URL: GET /users-concerns/{u-id}/concerns

请求参数:

参数名类型必选描述
u-idinteger用户ID

请求示例:

GET /users-concerns/123/concerns

返回示例:

  • 200 OK: 查询成功。

    {
         "code": 200,
         "msg": "success",
         "data": [
              {
                   "id": 1,
                   "user": {
                        "uId": 2,
                        "name": "卓卓脑婆",
                        "picture": "xxx.jpg",
                        "remark": "无团队纯个人..."
                   }
              }
         ]
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。

    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

取消关注

URL: DELETE /user-concerns/cancel

请求参数:

参数名类型必选描述
u-idinteger用户ID
concern-idinteger被取消关注的用户ID

请求示例:

DELETE /user-concerns/cancel?u-id=123&concern-id=2

返回示例:

  • 204 NO_CONTENT: 已取消关注。

    {
         "code": 204,
         "msg": "已取消关注",
         "data": null
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。

    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

关注某人

URL: POST /user-concerns/concern

请求参数:

参数名类型必选描述
uIdinteger当前用户ID
concernIdinteger被关注的用户ID

请求示例:

{
     "uId": 1,
     "concernId": 2
}

返回示例:

  • 201 CREATED: 关注成功。

    {
         "code": 201,
         "msg": "关注成功",
         "data": 1
    }
    
  • 500 INTERNAL_ERROR: 服务器错误。

    {
         "code": 500,
         "msg": "服务器出现错误",
         "data": null
    }
    

收藏

打开收藏夹

URL: GET /user-collects/collect-folders

请求参数:

{
     "uId": 1,
     "cfId": 2
}
参数名类型必选描述
uIdinteger用户编号
cfIdinteger收藏夹编号

返回示例:

{
     "code": 200,
     "msg": "success",
     "data": [
          {
               "uId": 1,
               "issue": {
                    "issId": 1,
                    "cover": "https://xxx.jpg",
                    "title": "一键三连变成女孩子是坠可爱的",
                    "creTime": "2020-10-20 10:20:30",
                    "user": {
                         "uId": 1,
                         "name": "略nb"
                    },
                    "commentNum": 1000,
                    "watchNum": 1000000
               }
          }
     ]
}

返回说明:

  • 200 OK: 请求成功,返回收藏夹内的作品。
  • 500 INTERNAL_ERROR: 服务器异常,返回错误信息。

获取所有收藏

URL: GET /user-collects/{u-id}

请求参数:

参数名类型必选描述
u-idstring用户编号

返回示例:

{
     "code": 200,
     "msg": "success",
     "data": [
          {
               "issId": 1,
               "itId": 2
          }
     ]
}

返回说明:

  • 200 OK: 请求成功,返回用户的所有收藏数据。
  • 500 INTERNAL_ERROR: 服务器异常,返回错误信息。

收藏作品

URL: POST /user-collects

请求参数:

{
     "uId": 1,
     "issId": 1,
     "cfId": 1
}
参数名类型必选描述
uIdinteger用户编号
issIdinteger作品编号
cfIdinteger收藏夹编号

返回示例:

{
     "code": 201,
     "msg": "收藏成功",
     "data": null
}

返回说明:

  • 201 CREATED: 收藏成功。
  • 500 INTERNAL_ERROR: 服务器错误。

取消收藏

URL: DELETE /user-collects/cancel/{iss-id}

请求参数:

参数名类型必选描述
iss-idinteger作品编号

返回示例:

{
     "code": 204,
     "msg": "删除成功",
     "data": null
}

返回说明:

  • 204 No Content: 取消收藏成功。
  • 500 INTERNAL_ERROR: 服务器错误。

更新收藏夹

URL: PUT /user-collects/collect-folders

请求参数:

{
     "uId": 1,
     "cover": "xxx02.jpg",
     "name": "精选收藏夹02",
     "creTime": "2020-12-03",
     "remark": ""
}
参数名类型必选描述
uIdinteger用户编号
coverstring收藏夹封面图
namestring收藏夹名称
creTimestring创建时间
remarkstring收藏夹描述

返回示例:

{
     "code": 204,
     "msg": "更新成功",
     "data": null
}

返回说明:

  • 204 No Content: 更新成功。
  • 500 INTERNAL_ERROR: 服务器错误。

删除收藏夹

URL: DELETE /user-collects/collect-folders

请求参数:

{
     "uId": 1,
     "cfId": 2
}
参数名类型必选描述
uIdinteger用户编号
cfIdinteger收藏夹编号

返回示例:

{
     "code": 204,
     "msg": "删除成功",
     "data": null
}

返回说明:

  • 204 No Content: 删除成功。
  • 500 INTERNAL_ERROR: 服务器错误。

获取收藏夹列表

URL: POST /user-collects/collect-folders/create-2

请求参数:

{
     "uId": 1
}
参数名类型比选描述
u-idinteger当前用户

返回示例 :

{
    "code": 200,
    "msg": "success",
    "data": [
        {
            "name":"收藏夹A",
            "creTime":"2023-01-04",
            "remark":"介绍你的收藏夹 ~"
        }
    ]
}

创建收藏夹

URL: POST /user-collects/collect-folders/create-1

请求参数:

{
     "cover": "xxx.jpg",
     "name": "精选收藏夹",
     "creTime": "2020-12-02",
     "remark": "在这里输入描述"
}
参数名类型必选描述
coverstring收藏夹封面图
namestring收藏夹名称
creTimestring创建时间
remarkstring收藏夹描述

返回示例:

{
     "code": 201,
     "msg": "创建成功",
     "data": null
}

返回说明:

  • 201 CREATED: 创建成功。
  • 500 INTERNAL_ERROR: 服务器错误。

创建并收藏夹(创建收藏夹后立即将作品加入)

URL: POST /user-collects/collect-folders/create-2

请求参数:

{
     "collectFolders": {
          "uId": 1,
          "cover": "xxx.jpg",
          "name": "精选收藏夹",
          "creTime": "2020-12-02",
          "remark": "在这里输入描述"
     },
     "userCollect": {
          "uId": 1,
          "issId": 1,
          "cfId": 1
     }
}
参数名类型必选描述
collectFoldersobject收藏夹信息
userCollectobject用户收藏信息

返回示例:

{
     "code": 201,
     "msg": "创建并收藏成功",
     "data": null
}

返回说明:

  • 201 CREATED: 创建并收藏成功。
  • 500 INTERNAL_ERROR: 服务器错误。

标签:code,name,data,bilibili,文档,模块,msg,type,id
From: https://blog.csdn.net/2403_89128801/article/details/144350103

相关文章