swagger.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. {
  2. "openapi": "3.0.0",
  3. "info": {
  4. "title": "辅助下载API",
  5. "description": "辅助下载相关接口文档",
  6. "version": "1.0.0",
  7. "contact": {
  8. "name": "API Support",
  9. "email": "support@example.com"
  10. }
  11. },
  12. "servers": [
  13. {
  14. "url": "https://api.danjiwanjia.com",
  15. "description": "生产环境"
  16. },
  17. {
  18. "url": "http://localhost:8000",
  19. "description": "开发环境"
  20. }
  21. ],
  22. "paths": {
  23. "/fuzhu/search": {
  24. "post": {
  25. "tags": ["辅助下载"],
  26. "summary": "搜索辅助",
  27. "description": "根据关键字搜索辅助信息,无需登录",
  28. "requestBody": {
  29. "required": true,
  30. "content": {
  31. "application/json": {
  32. "schema": {
  33. "type": "object",
  34. "properties": {
  35. "keywords": {
  36. "type": "string",
  37. "description": "搜索关键字",
  38. "example": "游戏辅助"
  39. }
  40. },
  41. "required": ["keywords"]
  42. }
  43. }
  44. }
  45. },
  46. "responses": {
  47. "200": {
  48. "description": "搜索成功",
  49. "content": {
  50. "application/json": {
  51. "schema": {
  52. "type": "object",
  53. "properties": {
  54. "code": {
  55. "type": "integer",
  56. "example": 200
  57. },
  58. "msg": {
  59. "type": "string",
  60. "example": "success"
  61. },
  62. "data": {
  63. "type": "array",
  64. "items": {
  65. "$ref": "#/components/schemas/Fuzhu"
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
  72. },
  73. "500": {
  74. "description": "关键字不能为空",
  75. "content": {
  76. "application/json": {
  77. "schema": {
  78. "$ref": "#/components/schemas/ErrorResponse"
  79. }
  80. }
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "/fuzhu/getFuzhu": {
  87. "post": {
  88. "tags": ["辅助下载"],
  89. "summary": "获取辅助列表",
  90. "description": "获取所有辅助信息,按优先级排序,无需登录",
  91. "requestBody": {
  92. "required": false,
  93. "content": {
  94. "application/json": {
  95. "schema": {
  96. "type": "object",
  97. "properties": {}
  98. }
  99. }
  100. }
  101. },
  102. "responses": {
  103. "200": {
  104. "description": "获取成功",
  105. "content": {
  106. "application/json": {
  107. "schema": {
  108. "type": "object",
  109. "properties": {
  110. "code": {
  111. "type": "integer",
  112. "example": 200
  113. },
  114. "msg": {
  115. "type": "string",
  116. "example": "success"
  117. },
  118. "data": {
  119. "type": "array",
  120. "items": {
  121. "$ref": "#/components/schemas/Fuzhu"
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. },
  132. "/fuzhu/detail": {
  133. "post": {
  134. "tags": ["辅助下载"],
  135. "summary": "获取辅助详细信息",
  136. "description": "获取指定辅助的详细信息,包括投票数据,需要登录",
  137. "security": [
  138. {
  139. "bearerAuth": []
  140. }
  141. ],
  142. "requestBody": {
  143. "required": true,
  144. "content": {
  145. "application/json": {
  146. "schema": {
  147. "type": "object",
  148. "properties": {
  149. "fuzhuId": {
  150. "type": "integer",
  151. "description": "辅助ID",
  152. "example": 1
  153. }
  154. },
  155. "required": ["fuzhuId"]
  156. }
  157. }
  158. }
  159. },
  160. "responses": {
  161. "200": {
  162. "description": "获取成功",
  163. "content": {
  164. "application/json": {
  165. "schema": {
  166. "type": "object",
  167. "properties": {
  168. "code": {
  169. "type": "integer",
  170. "example": 200
  171. },
  172. "msg": {
  173. "type": "string",
  174. "example": "success"
  175. },
  176. "data": {
  177. "$ref": "#/components/schemas/FuzhuDetail"
  178. }
  179. }
  180. }
  181. }
  182. }
  183. },
  184. "500": {
  185. "description": "fuzhuId参数校验错误",
  186. "content": {
  187. "application/json": {
  188. "schema": {
  189. "$ref": "#/components/schemas/ErrorResponse"
  190. }
  191. }
  192. }
  193. },
  194. "501": {
  195. "description": "找不到fuzhuId对应的辅助信息",
  196. "content": {
  197. "application/json": {
  198. "schema": {
  199. "$ref": "#/components/schemas/ErrorResponse"
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. },
  207. "/fuzhu/recommendedFuzhu": {
  208. "post": {
  209. "tags": ["辅助下载"],
  210. "summary": "获取推荐辅助",
  211. "description": "获取推荐的猜你喜欢辅助,按排序优先级推荐最多5个,需要登录",
  212. "security": [
  213. {
  214. "bearerAuth": []
  215. }
  216. ],
  217. "requestBody": {
  218. "required": true,
  219. "content": {
  220. "application/json": {
  221. "schema": {
  222. "type": "object",
  223. "properties": {
  224. "fuzhuId": {
  225. "type": "integer",
  226. "description": "辅助ID",
  227. "example": 1
  228. }
  229. },
  230. "required": ["fuzhuId"]
  231. }
  232. }
  233. }
  234. },
  235. "responses": {
  236. "200": {
  237. "description": "获取成功",
  238. "content": {
  239. "application/json": {
  240. "schema": {
  241. "type": "object",
  242. "properties": {
  243. "code": {
  244. "type": "integer",
  245. "example": 200
  246. },
  247. "msg": {
  248. "type": "string",
  249. "example": "success"
  250. },
  251. "data": {
  252. "type": "array",
  253. "items": {
  254. "$ref": "#/components/schemas/Fuzhu"
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. },
  262. "500": {
  263. "description": "fuzhuId参数校验错误",
  264. "content": {
  265. "application/json": {
  266. "schema": {
  267. "$ref": "#/components/schemas/ErrorResponse"
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. },
  275. "/fuzhu/vote": {
  276. "post": {
  277. "tags": ["辅助下载"],
  278. "summary": "赞踩投票",
  279. "description": "对指定辅助进行赞踩投票,需要登录",
  280. "security": [
  281. {
  282. "bearerAuth": []
  283. }
  284. ],
  285. "requestBody": {
  286. "required": true,
  287. "content": {
  288. "application/json": {
  289. "schema": {
  290. "type": "object",
  291. "properties": {
  292. "fuzhuId": {
  293. "type": "integer",
  294. "description": "辅助ID",
  295. "example": 1
  296. },
  297. "value": {
  298. "type": "integer",
  299. "description": "投票值:1表示赞,0表示踩",
  300. "enum": [0, 1],
  301. "example": 1
  302. }
  303. },
  304. "required": ["fuzhuId", "value"]
  305. }
  306. }
  307. }
  308. },
  309. "responses": {
  310. "200": {
  311. "description": "投票成功",
  312. "content": {
  313. "application/json": {
  314. "schema": {
  315. "type": "object",
  316. "properties": {
  317. "code": {
  318. "type": "integer",
  319. "example": 200
  320. },
  321. "msg": {
  322. "type": "string",
  323. "example": "success"
  324. },
  325. "data": {
  326. "type": "null"
  327. }
  328. }
  329. }
  330. }
  331. }
  332. },
  333. "500": {
  334. "description": "参数校验错误",
  335. "content": {
  336. "application/json": {
  337. "schema": {
  338. "$ref": "#/components/schemas/ErrorResponse"
  339. }
  340. }
  341. }
  342. },
  343. "501": {
  344. "description": "辅助ID不存在",
  345. "content": {
  346. "application/json": {
  347. "schema": {
  348. "$ref": "#/components/schemas/ErrorResponse"
  349. }
  350. }
  351. }
  352. },
  353. "502": {
  354. "description": "您已经投过票",
  355. "content": {
  356. "application/json": {
  357. "schema": {
  358. "$ref": "#/components/schemas/ErrorResponse"
  359. }
  360. }
  361. }
  362. }
  363. }
  364. }
  365. }
  366. },
  367. "components": {
  368. "securitySchemes": {
  369. "bearerAuth": {
  370. "type": "http",
  371. "scheme": "bearer",
  372. "bearerFormat": "JWT",
  373. "description": "JWT认证令牌"
  374. }
  375. },
  376. "schemas": {
  377. "Fuzhu": {
  378. "type": "object",
  379. "properties": {
  380. "id": {
  381. "type": "integer",
  382. "description": "辅助ID",
  383. "example": 1
  384. },
  385. "title": {
  386. "type": "string",
  387. "description": "辅助标题",
  388. "example": "游戏辅助工具"
  389. },
  390. "priority": {
  391. "type": "integer",
  392. "description": "排序优先级",
  393. "example": 1
  394. }
  395. }
  396. },
  397. "FuzhuDetail": {
  398. "type": "object",
  399. "properties": {
  400. "id": {
  401. "type": "integer",
  402. "description": "辅助ID",
  403. "example": 1
  404. },
  405. "title": {
  406. "type": "string",
  407. "description": "辅助标题",
  408. "example": "游戏辅助工具"
  409. },
  410. "priority": {
  411. "type": "integer",
  412. "description": "排序优先级",
  413. "example": 1
  414. },
  415. "vote": {
  416. "type": "object",
  417. "properties": {
  418. "upPercent": {
  419. "type": "string",
  420. "description": "赞投票百分比",
  421. "example": "0.75"
  422. },
  423. "downPercent": {
  424. "type": "string",
  425. "description": "踩投票百分比",
  426. "example": "0.25"
  427. }
  428. }
  429. }
  430. }
  431. },
  432. "ErrorResponse": {
  433. "type": "object",
  434. "properties": {
  435. "code": {
  436. "type": "integer",
  437. "description": "错误代码",
  438. "example": 500
  439. },
  440. "msg": {
  441. "type": "string",
  442. "description": "错误信息",
  443. "example": "参数校验错误"
  444. }
  445. }
  446. }
  447. }
  448. },
  449. "tags": [
  450. {
  451. "name": "辅助下载",
  452. "description": "辅助下载相关接口"
  453. }
  454. ]
  455. }