{ "openapi": "3.0.3", "info": { "title": "DanjiWanjia Admin API", "version": "1.0.0", "description": "Admin backend API. All endpoints use POST." }, "servers": [ { "url": "/" } ], "paths": { "/admin/getAdminCaptchaImage": { "post": { "summary": "Get admin captcha image", "requestBody": { "required": false }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/login": { "post": { "summary": "Admin login", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "username": { "type": "string" }, "password": { "type": "string", "format": "password" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessWithToken" } } } }, "/admin/logout": { "post": { "summary": "Admin logout", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/changePwd": { "post": { "summary": "Change password (user context)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "oldPassword": { "type": "string" }, "newPassword": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getConsoleData": { "post": { "summary": "Get console stats", "responses": { "200": { "$ref": "#/components/responses/SuccessWithData" } } } }, "/admin/getUserList": { "post": { "summary": "Get user list (paginated)", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "pageSize": { "type": "integer", "default": 10 }, "pageNum": { "type": "integer", "default": 1 }, "keyword": { "type": "string" }, "startDate": { "type": "string", "format": "date" }, "endDate": { "type": "string", "format": "date" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedUsers" } } } }, "/admin/banUser": { "post": { "summary": "Ban or unban user", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "integer" }, "state": { "type": "integer", "description": "1=ban, 0=unban" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/addGameCategory": { "post": { "summary": "Add game category", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "imageUrl": { "type": "string" }, "description": { "type": "string" }, "priority": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getGameCategory": { "post": { "summary": "List game categories", "responses": { "200": { "$ref": "#/components/responses/SuccessWithList" } } } }, "/admin/editGameCategory": { "post": { "summary": "Edit game category", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "categoryId": { "type": "integer" }, "name": { "type": "string" }, "imageUrl": { "type": "string" }, "description": { "type": "string" }, "priority": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/removeGameCategory": { "post": { "summary": "Remove game category", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "categoryId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getGameList": { "post": { "summary": "Get games by category (paginated)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "categoryId": { "type": "integer" }, "pageNum": { "type": "integer" }, "pageSize": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/addGame": { "post": { "summary": "Add game", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "categoryId": { "type": "integer" }, "title": { "type": "string" }, "imageUrl": { "type": "string" }, "price": { "type": "number" }, "description": { "type": "string" }, "priority": { "type": "integer" }, "browse": { "type": "integer" }, "buyCount": { "type": "integer" }, "downloadUrl": { "type": "string" }, "extractedCode": { "type": "string" }, "gameVersion": { "type": "string" }, "language": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/editGame": { "post": { "summary": "Edit game", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "gameId": { "type": "integer" }, "categoryId": { "type": "integer" }, "title": { "type": "string" }, "imageUrl": { "type": "string" }, "price": { "type": "number" }, "description": { "type": "string" }, "priority": { "type": "integer" }, "browse": { "type": "integer" }, "buyCount": { "type": "integer" }, "downloadUrl": { "type": "string" }, "extractedCode": { "type": "string" }, "language": { "type": "string" }, "gameVersion": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/removeGame": { "post": { "summary": "Remove game", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "gameId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getGame": { "post": { "summary": "Get single game", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "gameId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessWithData" } } } }, "/admin/getCdKeyList": { "post": { "summary": "List CDKEY (paginated)", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "pageNum": { "type": "integer", "default": 10 }, "user_id": { "type": "integer" }, "createTimeRange": { "type": "array", "items": { "type": "integer", "format": "unix-time" } } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/addCdKeyBatch": { "post": { "summary": "Batch create CDKEY", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "num": { "type": "integer" }, "days": { "type": "integer" }, "gameId": { "type": "integer" }, "channel": { "type": "integer", "description": "1=Taobao,2=Pinduoduo" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessWithList" } } } }, "/admin/removeCdKey": { "post": { "summary": "Delete CDKEY", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "cdKey": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getOrderList": { "post": { "summary": "Get recharge order list (paginated)", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "pageSize": { "type": "integer", "default": 10 }, "pageNum": { "type": "integer", "default": 1 }, "keyword": { "type": "string" }, "startDate": { "type": "string" }, "endDate": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/uploadImage": { "post": { "summary": "Upload image (multipart)", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/UploadResponse" } } } }, "/admin/uploadFile": { "post": { "summary": "Upload file (multipart)", "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/UploadResponseWithSize" } } } }, "/admin/addUserBalance": { "post": { "summary": "Adjust user balance (admin manual)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "integer" }, "amount": { "type": "number" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getUserGames": { "post": { "summary": "Get user's purchased games", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessWithList" } } } }, "/admin/getUserBalanceRecord": { "post": { "summary": "Get user balance change records (paginated)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "integer" }, "pageNum": { "type": "integer", "default": 1 }, "pageSize": { "type": "integer", "default": 10 } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedListWithDataTotal" } } } }, "/admin/getVipUserList": { "post": { "summary": "Get VIP user list (paginated)", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "integer", "default": 1 }, "pageSize": { "type": "integer", "default": 10 }, "user_id": { "type": "integer" }, "type": { "type": "integer" }, "created_at_start": { "type": "string" }, "created_at_end": { "type": "string" }, "expired_at_start": { "type": "string" }, "expired_at_end": { "type": "string" }, "search": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedListWithPage" } } } }, "/admin/getCustomerList": { "post": { "summary": "List customer service entries", "responses": { "200": { "$ref": "#/components/responses/SuccessWithList" } } } }, "/admin/addCustomerList": { "post": { "summary": "Add customer service", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "jumpUrl": { "type": "string" }, "type": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/editCustomerList": { "post": { "summary": "Edit customer service", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "jumpUrl": { "type": "string" }, "type": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/deleteCustomerList": { "post": { "summary": "Delete customer service", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getVisitRecord": { "post": { "summary": "Get website visit records (paginated)", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "pageSize": { "type": "integer", "default": 10 }, "pageNum": { "type": "integer", "default": 1 }, "startDate": { "type": "string" }, "endDate": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedListWithDataTotal" } } } }, "/admin/visitData": { "post": { "summary": "Get PV/IP statistics", "responses": { "200": { "$ref": "#/components/responses/SuccessWithData" } } } }, "/admin/getUserGroup": { "post": { "summary": "Get user groups", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "level": { "type": "integer" }, "start_date": { "type": "string" }, "end_date": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessWithList" } } } }, "/admin/addUserGroup": { "post": { "summary": "Add user group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "level": { "type": "integer" }, "exp": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/editUserGroup": { "post": { "summary": "Edit user group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "level": { "type": "integer" }, "exp": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/removeUserGroup": { "post": { "summary": "Remove user group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getUserMessage": { "post": { "summary": "Get user messages (paginated)", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "integer", "default": 1 }, "limit": { "type": "integer", "default": 10 }, "start_date": { "type": "string" }, "end_date": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/getForumCategoryList": { "post": { "summary": "List forum sections (paginated)", "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "categoryId": { "type": "integer" }, "page": { "type": "integer", "default": 1 }, "limit": { "type": "integer", "default": 10 } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/getForumThreadCategory": { "post": { "summary": "List forum thread categories by forumId", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "forumId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessWithList" } } } }, "/admin/saveThreadCategories": { "post": { "summary": "Save forum thread categories (upsert/delete)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "forumId": { "type": "integer" }, "categories": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "title": { "type": "string" } } } } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessMessage" } } } }, "/admin/addForumCategory": { "post": { "summary": "Add forum section", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "imageUrl": { "type": "string" }, "adminId": { "type": "integer" }, "priority": { "type": "integer" }, "categoryId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/editForumCategory": { "post": { "summary": "Edit forum section", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "description": { "type": "string" }, "imageUrl": { "type": "string" }, "adminId": { "type": "integer" }, "priority": { "type": "integer" }, "categoryId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/removeForumCategory": { "post": { "summary": "Remove forum section", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/getForumCategory": { "post": { "summary": "Get forum section by categoryId", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "categoryId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/SuccessWithData" } } } }, "/admin/getFuzhuList": { "post": { "summary": "Get assistant list (paginated)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "integer" }, "list": { "type": "integer" }, "key": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/addFuzhu": { "post": { "summary": "Add assistant entry", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" }, "image_url": { "type": "string" }, "version": { "type": "string" }, "file_size": { "type": "integer" }, "language": { "type": "string" }, "game": { "type": "string" }, "type": { "type": "integer" }, "priority": { "type": "integer" }, "rate": { "type": "integer", "maximum": 5 }, "description": { "type": "string" }, "download_url": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/updateFuzhu": { "post": { "summary": "Update assistant entry", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "title": { "type": "string" }, "image_url": { "type": "string" }, "version": { "type": "string" }, "file_size": { "type": "integer" }, "language": { "type": "string" }, "game": { "type": "string" }, "type": { "type": "integer" }, "priority": { "type": "integer" }, "rate": { "type": "integer" }, "description": { "type": "string" }, "download_url": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/deleteFuzhu": { "post": { "summary": "Delete assistant entry", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/DeleteSuccess" } } } }, "/admin/getFuzhuDownload": { "post": { "summary": "Get assistant downloads (paginated)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "integer" }, "list": { "type": "integer" }, "fuzhuId": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/getGlobalConfig": { "post": { "summary": "Get global config (paginated)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "page": { "type": "integer" }, "list": { "type": "integer" }, "key": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/PaginatedList" } } } }, "/admin/addGlobalConfig": { "post": { "summary": "Add global config", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/updateGlobalConfig": { "post": { "summary": "Update global config", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "key": { "type": "string" }, "value": { "type": "string" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } }, "/admin/deleteGlobalConfig": { "post": { "summary": "Delete global config", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/Success" } } } } }, "components": { "responses": { "Success": { "description": "Request succeeded", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "nullable": true } } } } } }, "SuccessWithToken": { "description": "Login token returned", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object", "properties": { "token": { "type": "string" } } } } } } } }, "SuccessWithData": { "description": "Success with data", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object" } } } } } }, "SuccessWithList": { "description": "Success with list", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "array", "items": {} } } } } } }, "PaginatedList": { "description": "Paginated list response", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object" } } } } } }, "PaginatedUsers": { "description": "Paginated users response", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } }, "total": { "type": "integer" }, "current_page": { "type": "integer" }, "per_page": { "type": "integer" }, "last_page": { "type": "integer" } } } } } } } }, "PaginatedListWithDataTotal": { "description": "Paginated with data and total fields", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object", "properties": { "data": {}, "total": { "type": "integer" } } } } } } } }, "PaginatedListWithPage": { "description": "Paginated list including page info", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object", "properties": { "data": {}, "total": { "type": "integer" }, "page": { "type": "integer" }, "pageSize": { "type": "integer" } } } } } } } }, "UploadResponse": { "description": "Upload image success", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object", "properties": { "filePath": { "type": "string" } } } } } } } }, "UploadResponseWithSize": { "description": "Upload file success with size", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "success" }, "data": { "type": "object", "properties": { "filePath": { "type": "string" }, "fileSize": { "type": "integer" } } } } } } } }, "DeleteSuccess": { "description": "Delete success", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer", "example": 200 }, "msg": { "type": "string", "example": "删除成功" }, "data": { "nullable": true } } } } } }, "SuccessMessage": { "description": "Generic success message", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "integer" }, "msg": { "type": "string" } } } } } } } } }