| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455 |
- {
- "openapi": "3.0.0",
- "info": {
- "title": "辅助下载API",
- "description": "辅助下载相关接口文档",
- "version": "1.0.0",
- "contact": {
- "name": "API Support",
- "email": "support@example.com"
- }
- },
- "servers": [
- {
- "url": "https://api.danjiwanjia.com",
- "description": "生产环境"
- },
- {
- "url": "http://localhost:8000",
- "description": "开发环境"
- }
- ],
- "paths": {
- "/fuzhu/search": {
- "post": {
- "tags": ["辅助下载"],
- "summary": "搜索辅助",
- "description": "根据关键字搜索辅助信息,无需登录",
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "keywords": {
- "type": "string",
- "description": "搜索关键字",
- "example": "游戏辅助"
- }
- },
- "required": ["keywords"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "搜索成功",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "example": 200
- },
- "msg": {
- "type": "string",
- "example": "success"
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Fuzhu"
- }
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "关键字不能为空",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- }
- }
- }
- },
- "/fuzhu/getFuzhu": {
- "post": {
- "tags": ["辅助下载"],
- "summary": "获取辅助列表",
- "description": "获取所有辅助信息,按优先级排序,无需登录",
- "requestBody": {
- "required": false,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {}
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "获取成功",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "example": 200
- },
- "msg": {
- "type": "string",
- "example": "success"
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Fuzhu"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/fuzhu/detail": {
- "post": {
- "tags": ["辅助下载"],
- "summary": "获取辅助详细信息",
- "description": "获取指定辅助的详细信息,包括投票数据,需要登录",
- "security": [
- {
- "bearerAuth": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "fuzhuId": {
- "type": "integer",
- "description": "辅助ID",
- "example": 1
- }
- },
- "required": ["fuzhuId"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "获取成功",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "example": 200
- },
- "msg": {
- "type": "string",
- "example": "success"
- },
- "data": {
- "$ref": "#/components/schemas/FuzhuDetail"
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "fuzhuId参数校验错误",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- },
- "501": {
- "description": "找不到fuzhuId对应的辅助信息",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- }
- }
- }
- },
- "/fuzhu/recommendedFuzhu": {
- "post": {
- "tags": ["辅助下载"],
- "summary": "获取推荐辅助",
- "description": "获取推荐的猜你喜欢辅助,按排序优先级推荐最多5个,需要登录",
- "security": [
- {
- "bearerAuth": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "fuzhuId": {
- "type": "integer",
- "description": "辅助ID",
- "example": 1
- }
- },
- "required": ["fuzhuId"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "获取成功",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "example": 200
- },
- "msg": {
- "type": "string",
- "example": "success"
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Fuzhu"
- }
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "fuzhuId参数校验错误",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- }
- }
- }
- },
- "/fuzhu/vote": {
- "post": {
- "tags": ["辅助下载"],
- "summary": "赞踩投票",
- "description": "对指定辅助进行赞踩投票,需要登录",
- "security": [
- {
- "bearerAuth": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "fuzhuId": {
- "type": "integer",
- "description": "辅助ID",
- "example": 1
- },
- "value": {
- "type": "integer",
- "description": "投票值:1表示赞,0表示踩",
- "enum": [0, 1],
- "example": 1
- }
- },
- "required": ["fuzhuId", "value"]
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "投票成功",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "example": 200
- },
- "msg": {
- "type": "string",
- "example": "success"
- },
- "data": {
- "type": "null"
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "参数校验错误",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- },
- "501": {
- "description": "辅助ID不存在",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- },
- "502": {
- "description": "您已经投过票",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- }
- }
- }
- }
- },
- "components": {
- "securitySchemes": {
- "bearerAuth": {
- "type": "http",
- "scheme": "bearer",
- "bearerFormat": "JWT",
- "description": "JWT认证令牌"
- }
- },
- "schemas": {
- "Fuzhu": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "辅助ID",
- "example": 1
- },
- "title": {
- "type": "string",
- "description": "辅助标题",
- "example": "游戏辅助工具"
- },
- "priority": {
- "type": "integer",
- "description": "排序优先级",
- "example": 1
- }
- }
- },
- "FuzhuDetail": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "辅助ID",
- "example": 1
- },
- "title": {
- "type": "string",
- "description": "辅助标题",
- "example": "游戏辅助工具"
- },
- "priority": {
- "type": "integer",
- "description": "排序优先级",
- "example": 1
- },
- "vote": {
- "type": "object",
- "properties": {
- "upPercent": {
- "type": "string",
- "description": "赞投票百分比",
- "example": "0.75"
- },
- "downPercent": {
- "type": "string",
- "description": "踩投票百分比",
- "example": "0.25"
- }
- }
- }
- }
- },
- "ErrorResponse": {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "description": "错误代码",
- "example": 500
- },
- "msg": {
- "type": "string",
- "description": "错误信息",
- "example": "参数校验错误"
- }
- }
- }
- }
- },
- "tags": [
- {
- "name": "辅助下载",
- "description": "辅助下载相关接口"
- }
- ]
- }
|