From 44c73e787f1e7fb45497b53ecc81a280a26f604e Mon Sep 17 00:00:00 2001 From: zetaloop Date: Sun, 3 May 2026 19:03:09 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90=20?= =?UTF-8?q?swagger=20=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desc/api/docs/community-api.json | 1658 ++++++++++------------- desc/api/docs/dispute-api.json | 485 +++++++ desc/api/docs/email-api.json | 185 +-- desc/api/docs/game-api.json | 414 +++--- desc/api/docs/notification-api.json | 305 +++++ desc/api/docs/objectstory-api.json | 171 ++- desc/api/docs/order-api.json | 1336 ++++++++----------- desc/api/docs/player-api.json | 1686 ++++++++++-------------- desc/api/docs/review-api.json | 401 ++++++ desc/api/docs/search-api.json | 549 ++++++++ desc/api/docs/shop-api.json | 1674 ++++++++++-------------- desc/api/docs/users-api.json | 1877 ++++++++++++--------------- desc/api/docs/wallet-api.json | 459 ++++--- 13 files changed, 5963 insertions(+), 5237 deletions(-) create mode 100644 desc/api/docs/dispute-api.json create mode 100644 desc/api/docs/notification-api.json create mode 100644 desc/api/docs/review-api.json create mode 100644 desc/api/docs/search-api.json diff --git a/desc/api/docs/community-api.json b/desc/api/docs/community-api.json index 1101cb1..8ace6fa 100644 --- a/desc/api/docs/community-api.json +++ b/desc/api/docs/community-api.json @@ -1,1067 +1,797 @@ { + "swagger": "2.0", + "info": { + "title": "", + "version": "" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "version": "1.0" - }, - "basePath": "/", "paths": { "/api/v1/comments/{id}/like": { - "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "点赞评论", - "operationId": "communityLikeComment", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - }, "delete": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "取消点赞评论", - "operationId": "communityUnlikeComment", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "UnlikeComment", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "community" + ] + }, + "post": { + "summary": "点赞评论", + "operationId": "LikeComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "community" + ] } }, "/api/v1/posts": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取帖子列表", - "operationId": "communityListPosts", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "string", - "name": "tags", - "in": "query", - "allowEmptyValue": true - }, - { - "type": "string", - "name": "sortBy", - "in": "query", - "allowEmptyValue": true - } - ], + "operationId": "ListPosts", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "title", - "content", - "images", - "tags", - "likeCount", - "commentCount", - "liked", - "author", - "createdAt" - ], - "properties": { - "author": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "commentCount": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "images": { - "type": "array", - "items": { - "type": "string" - } - }, - "likeCount": { - "type": "integer" - }, - "liked": { - "type": "boolean" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "type": "string" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/PostListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + }, + { + "name": "tags", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "sortBy", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "community" + ], + "consumes": [ + "multipart/form-data" + ] }, "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "发布帖子", - "operationId": "communityCreatePost", + "operationId": "CreatePost", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/Post" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "title", - "content", - "images", - "tags" - ], - "properties": { - "content": { - "type": "string" - }, - "images": { - "type": "array", - "items": { - "type": "string" - } - }, - "linkedOrderId": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "type": "string" - } - } + "$ref": "#/definitions/CreatePostReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "author": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "commentCount": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "images": { - "type": "array", - "items": { - "type": "string" - } - }, - "likeCount": { - "type": "integer" - }, - "liked": { - "type": "boolean" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "type": "string" - } - } - } - } - } + "tags": [ + "community" + ] } }, "/api/v1/posts/{id}": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取帖子详情", - "operationId": "communityGetPost", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetPost", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "author": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "commentCount": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "images": { - "type": "array", - "items": { - "type": "string" - } - }, - "likeCount": { - "type": "integer" - }, - "liked": { - "type": "boolean" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "type": "string" - } - } + "$ref": "#/definitions/Post" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "community" + ] } }, "/api/v1/posts/{id}/comments": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取帖子评论", - "operationId": "communityListComments", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - } - ], + "operationId": "ListComments", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "content", - "author", - "likeCount", - "liked", - "createdAt" - ], - "properties": { - "author": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "content": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "likeCount": { - "type": "integer" - }, - "liked": { - "type": "boolean" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/CommentListResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "community" + ] }, "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "发表评论", - "operationId": "communityCreateComment", + "operationId": "CreateComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/Comment" + } + } + }, "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string" - } - } + "$ref": "#/definitions/CreateCommentReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "author": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "content": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "likeCount": { - "type": "integer" - }, - "liked": { - "type": "boolean" - } - } - } - } - } + "tags": [ + "community" + ] } }, "/api/v1/posts/{id}/like": { - "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "点赞帖子", - "operationId": "communityLikePost", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - }, "delete": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "取消点赞帖子", - "operationId": "communityUnlikePost", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "UnlikePost", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "community" + ] + }, + "post": { + "summary": "点赞帖子", + "operationId": "LikePost", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "community" + ] } }, "/api/v1/posts/{id}/pin": { - "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "置顶帖子", - "operationId": "communityPinPost", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - }, "delete": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "取消置顶", - "operationId": "communityUnpinPost", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "UnpinPost", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "community" + ] + }, + "post": { + "summary": "置顶帖子", + "operationId": "PinPost", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "community" + ] } }, "/api/v1/users/{id}/posts": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取用户帖子", - "operationId": "communityListUserPosts", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - } - ], + "operationId": "ListUserPosts", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "title", - "content", - "images", - "tags", - "likeCount", - "commentCount", - "liked", - "author", - "createdAt" - ], - "properties": { - "author": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "commentCount": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "images": { - "type": "array", - "items": { - "type": "string" - } - }, - "likeCount": { - "type": "integer" - }, - "liked": { - "type": "boolean" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "type": "string" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/PostListResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "community" + ] } } }, - "x-date": "2026-04-22 22:30:25", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "Comment": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "content": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/UserProfile" + }, + "likeCount": { + "type": "integer", + "format": "int64" + }, + "liked": { + "type": "boolean", + "format": "boolean" + }, + "createdAt": { + "type": "string" + } + }, + "title": "Comment", + "required": [ + "id", + "content", + "author", + "likeCount", + "liked", + "createdAt" + ] + }, + "CommentListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Comment" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "CommentListResp", + "required": [ + "items", + "meta" + ] + }, + "CreateCommentReq": { + "type": "object", + "properties": { + "postId": { + "type": "integer", + "format": "int64" + }, + "content": { + "type": "string" + } + }, + "title": "CreateCommentReq", + "required": [ + "-", + "content" + ] + }, + "CreatePostReq": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "images": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "linkedOrderId": { + "type": "string" + } + }, + "title": "CreatePostReq", + "required": [ + "title", + "content", + "images", + "tags" + ] + }, + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "ListCommentsReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "ListCommentsReq" + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "PathId": { + "type": "object", + "title": "PathId" + }, + "Post": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "images": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "linkedOrderId": { + "type": "integer", + "format": "int64" + }, + "pinned": { + "type": "boolean", + "format": "boolean" + }, + "likeCount": { + "type": "integer", + "format": "int64" + }, + "commentCount": { + "type": "integer", + "format": "int64" + }, + "liked": { + "type": "boolean", + "format": "boolean" + }, + "author": { + "$ref": "#/definitions/UserProfile" + }, + "createdAt": { + "type": "string" + } + }, + "title": "Post", + "required": [ + "id", + "title", + "content", + "images", + "tags", + "pinned", + "likeCount", + "commentCount", + "liked", + "author", + "createdAt" + ] + }, + "PostListReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + }, + "tags": { + "type": "string" + }, + "sortBy": { + "type": "string" + } + }, + "title": "PostListReq" + }, + "PostListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Post" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "PostListResp", + "required": [ + "items", + "meta" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/dispute-api.json b/desc/api/docs/dispute-api.json new file mode 100644 index 0000000..0f9caf6 --- /dev/null +++ b/desc/api/docs/dispute-api.json @@ -0,0 +1,485 @@ +{ + "swagger": "2.0", + "info": { + "title": "", + "version": "" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/api/v1/disputes": { + "get": { + "summary": "获取争议列表", + "operationId": "ListDisputes", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/DisputeListResp" + } + } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + }, + { + "name": "status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "dispute" + ], + "consumes": [ + "multipart/form-data" + ] + } + }, + "/api/v1/disputes/{id}/appeal": { + "post": { + "summary": "申诉", + "operationId": "AppealDispute", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AppealReq" + } + } + ], + "tags": [ + "dispute" + ] + } + }, + "/api/v1/disputes/{id}/response": { + "post": { + "summary": "回应争议", + "operationId": "RespondDispute", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DisputeResponseReq" + } + } + ], + "tags": [ + "dispute" + ] + } + }, + "/api/v1/orders/{id}/dispute": { + "get": { + "summary": "获取订单争议", + "operationId": "GetOrderDispute", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/Dispute" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "dispute" + ] + }, + "post": { + "summary": "发起争议", + "operationId": "CreateDispute", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateDisputeReq" + } + } + ], + "tags": [ + "dispute" + ] + } + } + }, + "definitions": { + "AppealReq": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + }, + "title": "AppealReq", + "required": [ + "reason" + ] + }, + "CreateDisputeReq": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "evidence": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "CreateDisputeReq", + "required": [ + "reason", + "evidence" + ] + }, + "Dispute": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "orderId": { + "type": "integer", + "format": "int64" + }, + "initiatorId": { + "type": "integer", + "format": "int64" + }, + "initiatorName": { + "type": "string" + }, + "respondentId": { + "type": "integer", + "format": "int64" + }, + "reason": { + "type": "string" + }, + "evidence": { + "type": "array", + "items": { + "type": "string" + } + }, + "status": { + "type": "string" + }, + "result": { + "type": "string" + }, + "respondentReason": { + "type": "string" + }, + "respondentEvidence": { + "type": "array", + "items": { + "type": "string" + } + }, + "appealReason": { + "type": "string" + }, + "appealedAt": { + "type": "string" + }, + "resolvedBy": { + "type": "integer", + "format": "int64" + }, + "resolvedAt": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "title": "Dispute", + "required": [ + "id", + "orderId", + "initiatorId", + "initiatorName", + "respondentId", + "reason", + "evidence", + "status", + "respondentEvidence", + "createdAt", + "updatedAt" + ] + }, + "DisputeListReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + }, + "status": { + "type": "string" + } + }, + "title": "DisputeListReq" + }, + "DisputeListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Dispute" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "DisputeListResp", + "required": [ + "items", + "meta" + ] + }, + "DisputePathId": { + "type": "object", + "title": "DisputePathId" + }, + "DisputeResponseReq": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "evidence": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "DisputeResponseReq", + "required": [ + "reason", + "evidence" + ] + }, + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/email-api.json b/desc/api/docs/email-api.json index 5a66e5b..e6f8d05 100644 --- a/desc/api/docs/email-api.json +++ b/desc/api/docs/email-api.json @@ -1,121 +1,138 @@ { + "swagger": "2.0", + "info": { + "title": "", + "version": "1.0" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "version": "1.0" - }, - "basePath": "/", "paths": { "/api/v1/auth/forgot-password/send": { "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "忘记密码-发送验证码", - "operationId": "emailForgotPassword", + "operationId": "ForgotPassword", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "email" - ], - "properties": { - "email": { - "type": "string" - } - } + "$ref": "#/definitions/ForgotPasswordReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "email" + ] } }, "/api/v1/email/verification-code/send": { "post": { - "description": "向用户邮箱发送验证码,支持注册、登录、重置密码、绑定邮箱等场景", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "发送邮箱验证码", - "operationId": "emailSendVerificationCode", + "description": "向用户邮箱发送验证码,支持注册、登录、重置密码、绑定邮箱等场景", + "operationId": "SendVerificationCode", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/SendVerificationCodeResp" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "email", - "scene" - ], - "properties": { - "email": { - "type": "string" - }, - "scene": { - "type": "string" - } - } + "$ref": "#/definitions/SendVerificationCodeReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "expireInSec": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "requestId": { - "type": "string" - } - } - } - } - } + "tags": [ + "email" + ] } } }, - "x-date": "2026-04-22 22:30:26", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "ForgotPasswordReq": { + "type": "object", + "properties": { + "email": { + "type": "string" + } + }, + "title": "ForgotPasswordReq", + "required": [ + "email" + ] + }, + "SendVerificationCodeReq": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "scene": { + "type": "string" + } + }, + "title": "SendVerificationCodeReq", + "required": [ + "email", + "required", + "scene" + ] + }, + "SendVerificationCodeResp": { + "type": "object", + "properties": { + "requestId": { + "type": "string" + }, + "expireInSec": { + "type": "integer", + "format": "int64" + }, + "message": { + "type": "string" + } + }, + "title": "SendVerificationCodeResp", + "required": [ + "requestId", + "expireInSec", + "message" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/game-api.json b/desc/api/docs/game-api.json index 6c1e01d..b1f7168 100644 --- a/desc/api/docs/game-api.json +++ b/desc/api/docs/game-api.json @@ -1,213 +1,281 @@ { + "swagger": "2.0", + "info": { + "title": "", + "version": "" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "version": "1.0" - }, - "basePath": "/", "paths": { - "/api/v1/games": { + "/api/v1/games/": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取游戏列表", - "operationId": "gameListGames", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - } - ], + "operationId": "ListGames", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "icon", - "category" - ], - "properties": { - "category": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/GameListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "game" + ], + "consumes": [ + "multipart/form-data" + ] }, "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "创建游戏", - "operationId": "gameCreateGame", + "operationId": "CreateGame", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/Game" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "name", - "icon", - "category" - ], - "properties": { - "category": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } + "$ref": "#/definitions/Game" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "category": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - } - } - } + "tags": [ + "game" + ] } }, "/api/v1/games/{id}": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取游戏详情", - "operationId": "gameGetGame", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetGame", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "category": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } + "$ref": "#/definitions/Game" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "game" + ] } } }, - "x-date": "2026-04-22 22:30:23", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "Game": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "category": { + "type": "string" + } + }, + "title": "Game", + "required": [ + "name", + "icon", + "category" + ] + }, + "GameListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Game" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "GameListResp", + "required": [ + "items", + "meta" + ] + }, + "GetGameReq": { + "type": "object", + "title": "GetGameReq" + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/notification-api.json b/desc/api/docs/notification-api.json new file mode 100644 index 0000000..80b3312 --- /dev/null +++ b/desc/api/docs/notification-api.json @@ -0,0 +1,305 @@ +{ + "swagger": "2.0", + "info": { + "title": "", + "version": "" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/api/v1/notifications": { + "get": { + "summary": "获取通知列表", + "operationId": "ListNotifications", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/NotificationListResp" + } + } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "notification" + ], + "consumes": [ + "multipart/form-data" + ] + } + }, + "/api/v1/notifications/read-all": { + "put": { + "summary": "全部已读", + "operationId": "ReadAllNotifications", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "description": " 空响应", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + ], + "tags": [ + "notification" + ] + } + }, + "/api/v1/notifications/{id}/read": { + "put": { + "summary": "标记已读", + "operationId": "ReadNotification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "notification" + ] + } + } + }, + "definitions": { + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "Notification": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "read": { + "type": "boolean", + "format": "boolean" + }, + "link": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "Notification", + "required": [ + "id", + "type", + "title", + "content", + "read", + "createdAt" + ] + }, + "NotificationListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Notification" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "NotificationListResp", + "required": [ + "items", + "meta" + ] + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "PathId": { + "type": "object", + "title": "PathId" + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/objectstory-api.json b/desc/api/docs/objectstory-api.json index 0145d04..9bc6c68 100644 --- a/desc/api/docs/objectstory-api.json +++ b/desc/api/docs/objectstory-api.json @@ -1,95 +1,132 @@ { + "swagger": "2.0", + "info": { + "title": "文件服务", + "description": "处理文件上传与获取", + "version": "v1" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "title": "文件服务", - "version": "v1" - }, - "basePath": "/", "paths": { "/api/v1/files": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "文件获取接口 (如果是私有文件,通过此接口获取或重定向)", - "operationId": "fileGetFile", - "parameters": [ - { - "type": "string", - "name": "key", - "in": "query", - "required": true - } - ], + "operationId": "GetFile", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": {} } - } + }, + "parameters": [ + { + "name": "key", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": [ + "file" + ], + "consumes": [ + "multipart/form-data" + ] } }, "/api/v1/upload": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "文件上传接口", - "operationId": "fileUpload", - "parameters": [ - { - "enum": [ - "avatar", - "chat", - "post", - "verification", - "dispute" - ], - "type": "string", - "description": "文件类型限制", - "name": "type", - "in": "formData", - "required": true - } - ], + "operationId": "Upload", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "url": { - "description": "返回 CDN 地址或访问地址", - "type": "string" - } - } + "$ref": "#/definitions/UploadResp" } } - } + }, + "parameters": [ + { + "name": "body", + "description": " 上传请求参数(File文件流在Handler中通过 r.FormFile 获取)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UploadReq" + } + } + ], + "tags": [ + "file" + ], + "consumes": [ + "multipart/form-data" + ] } } }, - "x-date": "2026-04-22 22:30:27", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "GetFileReq": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "title": "GetFileReq", + "required": [ + "key" + ] + }, + "UploadReq": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "avatar", + "chat", + "post", + "verification", + "dispute" + ], + "description": " 文件类型限制" + } + }, + "title": "UploadReq", + "required": [ + "type" + ] + }, + "UploadResp": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": " 返回 CDN 地址或访问地址" + } + }, + "title": "UploadResp", + "required": [ + "url" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/order-api.json b/desc/api/docs/order-api.json index 13dbc5b..afe447f 100644 --- a/desc/api/docs/order-api.json +++ b/desc/api/docs/order-api.json @@ -1,889 +1,675 @@ { + "swagger": "2.0", + "info": { + "title": "聚玩订单服务", + "description": "处理订单业务", + "version": "1.0" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "title": "聚玩订单服务", - "version": "1.0" - }, - "basePath": "/", "paths": { - "/api/v1/orders": { + "/api/v1/orders/": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取订单列表", - "operationId": "orderListOrders", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "consumer, player, owner", - "name": "role", - "in": "query", - "required": true - }, - { - "type": "string", - "name": "status", - "in": "query", - "allowEmptyValue": true - } - ], + "operationId": "ListOrders", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "consumerId", - "playerId", - "service", - "status", - "totalPrice", - "createdAt" - ], - "properties": { - "acceptedAt": { - "type": "string" - }, - "completedAt": { - "type": "string" - }, - "consumerId": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "note": { - "type": "string" - }, - "playerId": { - "type": "string" - }, - "service": { - "type": "object", - "required": [ - "id", - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - }, - "shopId": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "totalPrice": { - "type": "number" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/OrderListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + }, + { + "name": "role", + "description": " consumer, player, owner", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "status", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "order" + ], + "consumes": [ + "multipart/form-data" + ] }, "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "创建订单", - "operationId": "orderCreateOrder", + "operationId": "CreateOrder", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/CreateOrderResp" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "playerId", - "serviceId", - "quantity" - ], - "properties": { - "note": { - "type": "string" - }, - "playerId": { - "type": "integer" - }, - "quantity": { - "type": "integer" - }, - "serviceId": { - "type": "integer" - }, - "shopId": { - "type": "integer" - } - } + "$ref": "#/definitions/CreateOrderReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "ok": { - "type": "boolean" - }, - "order": { - "type": "object", - "required": [ - "id", - "consumerId", - "playerId", - "service", - "status", - "totalPrice", - "createdAt" - ], - "properties": { - "acceptedAt": { - "type": "string" - }, - "completedAt": { - "type": "string" - }, - "consumerId": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "note": { - "type": "string" - }, - "playerId": { - "type": "string" - }, - "service": { - "type": "object", - "required": [ - "id", - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - }, - "shopId": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "totalPrice": { - "type": "number" - } - } - } - } - } - } - } + "tags": [ + "order" + ] } }, "/api/v1/orders/paid": { "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "创建并支付订单", - "operationId": "orderCreateAndPayOrder", + "operationId": "CreateAndPayOrder", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/CreateOrderResp" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "playerId", - "serviceId", - "quantity" - ], - "properties": { - "note": { - "type": "string" - }, - "playerId": { - "type": "integer" - }, - "quantity": { - "type": "integer" - }, - "serviceId": { - "type": "integer" - }, - "shopId": { - "type": "integer" - } - } + "$ref": "#/definitions/CreateOrderReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "ok": { - "type": "boolean" - }, - "order": { - "type": "object", - "required": [ - "id", - "consumerId", - "playerId", - "service", - "status", - "totalPrice", - "createdAt" - ], - "properties": { - "acceptedAt": { - "type": "string" - }, - "completedAt": { - "type": "string" - }, - "consumerId": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "note": { - "type": "string" - }, - "playerId": { - "type": "string" - }, - "service": { - "type": "object", - "required": [ - "id", - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - }, - "shopId": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "totalPrice": { - "type": "number" - } - } - } - } - } - } - } + "tags": [ + "order" + ] } }, "/api/v1/orders/{id}": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取订单详情", - "operationId": "orderGetOrder", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetOrder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "acceptedAt": { - "type": "string" - }, - "completedAt": { - "type": "string" - }, - "consumerId": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "note": { - "type": "string" - }, - "playerId": { - "type": "string" - }, - "service": { - "type": "object", - "required": [ - "id", - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - }, - "shopId": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "totalPrice": { - "type": "number" - } - } + "$ref": "#/definitions/Order" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "order" + ] } }, "/api/v1/orders/{id}/accept": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "接单", - "operationId": "orderAcceptOrder", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "AcceptOrder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "order" + ] } }, "/api/v1/orders/{id}/cancel": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "取消订单", - "operationId": "orderCancelOrder", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "CancelOrder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "order" + ] } }, "/api/v1/orders/{id}/confirm-close": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "确认结算", - "operationId": "orderConfirmCloseOrder", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "ConfirmCloseOrder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "order" + ] } }, "/api/v1/orders/{id}/pay": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "支付订单", - "operationId": "orderPayOrder", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "PayOrder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "order" + ] } }, "/api/v1/orders/{id}/reorder": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "再来一单", - "operationId": "orderReorder", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "Reorder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "ok": { - "type": "boolean" - }, - "order": { - "type": "object", - "required": [ - "id", - "consumerId", - "playerId", - "service", - "status", - "totalPrice", - "createdAt" - ], - "properties": { - "acceptedAt": { - "type": "string" - }, - "completedAt": { - "type": "string" - }, - "consumerId": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "note": { - "type": "string" - }, - "playerId": { - "type": "string" - }, - "service": { - "type": "object", - "required": [ - "id", - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - }, - "shopId": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "totalPrice": { - "type": "number" - } - } - } - } + "$ref": "#/definitions/CreateOrderResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "order" + ] } }, "/api/v1/orders/{id}/request-close": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "申请结算", - "operationId": "orderRequestCloseOrder", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "RequestCloseOrder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathId" + } + } + ], + "tags": [ + "order" + ] } } }, - "x-date": "2026-04-22 22:30:23", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "CreateOrderReq": { + "type": "object", + "properties": { + "playerId": { + "type": "integer", + "format": "int64" + }, + "shopId": { + "type": "integer", + "format": "int64" + }, + "serviceId": { + "type": "integer", + "format": "int64" + }, + "quantity": { + "type": "integer", + "format": "int32" + }, + "note": { + "type": "string" + } + }, + "title": "CreateOrderReq", + "required": [ + "playerId", + "serviceId", + "quantity" + ] + }, + "CreateOrderResp": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "format": "boolean" + }, + "order": { + "$ref": "#/definitions/Order" + } + }, + "title": "CreateOrderResp", + "required": [ + "ok", + "order" + ] + }, + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "Order": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "consumerId": { + "type": "integer", + "format": "int64" + }, + "playerId": { + "type": "string" + }, + "shopId": { + "type": "integer", + "format": "int64" + }, + "service": { + "$ref": "#/definitions/PlayerService" + }, + "status": { + "type": "string" + }, + "totalPrice": { + "type": "number", + "format": "double" + }, + "note": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "acceptedAt": { + "type": "string" + }, + "completedAt": { + "type": "string" + } + }, + "title": "Order", + "required": [ + "id", + "consumerId", + "playerId", + "service", + "status", + "totalPrice", + "createdAt" + ] + }, + "OrderListReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + }, + "role": { + "type": "string", + "description": " consumer, player, owner" + }, + "status": { + "type": "string" + } + }, + "title": "OrderListReq", + "required": [ + "role" + ] + }, + "OrderListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Order" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "OrderListResp", + "required": [ + "items", + "meta" + ] + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "PathId": { + "type": "object", + "title": "PathId" + }, + "PlayerService": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "playerId": { + "type": "integer", + "format": "int64" + }, + "gameId": { + "type": "integer", + "format": "int64" + }, + "gameName": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "unit": { + "type": "string" + }, + "rankRange": { + "type": "string" + }, + "availability": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "PlayerService", + "required": [ + "id", + "playerId", + "gameId", + "gameName", + "title", + "description", + "price", + "unit", + "availability" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/player-api.json b/desc/api/docs/player-api.json index a611e74..0818af4 100644 --- a/desc/api/docs/player-api.json +++ b/desc/api/docs/player-api.json @@ -1,1143 +1,779 @@ { + "swagger": "2.0", + "info": { + "title": "聚玩打手服务", + "description": "聚玩用户服务处理打手信息管理、服务发布及订单相关接口", + "version": "1.0" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "title": "聚玩打手服务", - "version": "1.0" - }, - "basePath": "/", "paths": { "/api/v1/players": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取打手列表", - "operationId": "playerListPlayers", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "integer", - "name": "gameId", - "in": "query", - "allowEmptyValue": true - }, - { - "type": "integer", - "name": "gender", - "in": "query", - "allowEmptyValue": true - } - ], + "operationId": "ListPlayers", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "user", - "rating", - "totalOrders", - "completionRate", - "status", - "games", - "services", - "gender", - "tags" - ], - "properties": { - "completionRate": { - "type": "number" - }, - "games": { - "type": "array", - "items": { - "type": "string" - } - }, - "gender": { - "type": "boolean" - }, - "id": { - "type": "integer" - }, - "rating": { - "type": "number" - }, - "services": { - "type": "array", - "items": { - "type": "object", - "required": [ - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - } - }, - "shopId": { - "type": "string" - }, - "shopName": { - "type": "string" - }, - "status": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "totalOrders": { - "type": "integer" - }, - "user": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/PlayerListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + }, + { + "name": "gameId", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "name": "gender", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "player" + ], + "consumes": [ + "multipart/form-data" + ] } }, "/api/v1/players/me": { - "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "初始化当前用户的打手资料", - "operationId": "playerInitPlayer", + "get": { + "summary": "获取当前用户的打手资料", + "operationId": "GetMyPlayer", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "completionRate": { - "type": "number" - }, - "games": { - "type": "array", - "items": { - "type": "string" - } - }, - "gender": { - "type": "boolean" - }, - "id": { - "type": "integer" - }, - "rating": { - "type": "number" - }, - "services": { - "type": "array", - "items": { - "type": "object", - "required": [ - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - } - }, - "shopId": { - "type": "string" - }, - "shopName": { - "type": "string" - }, - "status": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "totalOrders": { - "type": "integer" - }, - "user": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } + "$ref": "#/definitions/PlayerProfile" } } - } + }, + "tags": [ + "player" + ] + }, + "post": { + "summary": "初始化当前用户的打手资料", + "operationId": "InitPlayer", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/PlayerProfile" + } + } + }, + "parameters": [ + { + "name": "body", + "description": " 空响应", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + ], + "tags": [ + "player" + ] } }, "/api/v1/players/me/status": { "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "更新接单状态", - "operationId": "playerUpdatePlayerStatus", + "operationId": "UpdatePlayerStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "status" - ], - "properties": { - "status": { - "type": "string" - } - } + "$ref": "#/definitions/UpdatePlayerStatusReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "player" + ] } }, "/api/v1/players/{id}": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取打手详情", - "operationId": "playerGetPlayer", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetPlayer", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "completionRate": { - "type": "number" - }, - "games": { - "type": "array", - "items": { - "type": "string" - } - }, - "gender": { - "type": "boolean" - }, - "id": { - "type": "integer" - }, - "rating": { - "type": "number" - }, - "services": { - "type": "array", - "items": { - "type": "object", - "required": [ - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - } - }, - "shopId": { - "type": "string" - }, - "shopName": { - "type": "string" - }, - "status": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "totalOrders": { - "type": "integer" - }, - "user": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } + "$ref": "#/definitions/PlayerProfile" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "player" + ] } }, "/api/v1/players/{id}/services": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取指定打手的服务列表", - "operationId": "playerListPlayerServices", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "ListPlayerServices", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/PlayerServiceListResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "player" + ] } }, "/api/v1/services": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取所有服务列表", - "operationId": "playerListServices", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - } - ], + "operationId": "ListServices", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "playerId", - "gameId", - "gameName", - "title", - "description", - "price", - "unit", - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/PlayerServiceListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "player" + ], + "consumes": [ + "multipart/form-data" + ] }, "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "创建服务", - "operationId": "playerCreateService", + "operationId": "CreateService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/PlayerService" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "price", - "unit" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } + "$ref": "#/definitions/CreateServiceReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } - } - } - } + "tags": [ + "player" + ] } }, "/api/v1/services/{id}": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取服务详情", - "operationId": "playerGetService", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetService", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } + "$ref": "#/definitions/PlayerService" } } - } - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "更新服务", - "operationId": "playerUpdateService", + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true + "required": true, + "type": "string" + } + ], + "tags": [ + "player" + ] + }, + "delete": { + "summary": "删除服务", + "operationId": "DeleteService", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "availability" - ], - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } + "$ref": "#/definitions/DeleteServiceReq" } } ], + "tags": [ + "player" + ] + }, + "put": { + "summary": "更新服务", + "operationId": "UpdateService", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "availability": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "gameId": { - "type": "integer" - }, - "gameName": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "playerId": { - "type": "integer" - }, - "price": { - "type": "number" - }, - "rankRange": { - "type": "string" - }, - "title": { - "type": "string" - }, - "unit": { - "type": "string" - } - } + "$ref": "#/definitions/PlayerService" } } - } - }, - "delete": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "删除服务", - "operationId": "playerDeleteService", + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/UpdateServiceReq" } } - } + ], + "tags": [ + "player" + ] } } }, - "x-date": "2026-04-22 22:30:24", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "CreateServiceReq": { + "type": "object", + "properties": { + "gameId": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "unit": { + "type": "string" + }, + "rankRange": { + "type": "string" + }, + "availability": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "CreateServiceReq", + "required": [ + "price", + "unit" + ] + }, + "DeleteServiceReq": { + "type": "object", + "title": "DeleteServiceReq" + }, + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "GetPlayerReq": { + "type": "object", + "title": "GetPlayerReq" + }, + "GetServiceReq": { + "type": "object", + "title": "GetServiceReq" + }, + "ListPlayerServicesReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "ListPlayerServicesReq" + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "PlayerListReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + }, + "gameId": { + "type": "integer", + "format": "int64" + }, + "gender": { + "type": "integer", + "format": "int64" + } + }, + "title": "PlayerListReq" + }, + "PlayerListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PlayerProfile" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "PlayerListResp", + "required": [ + "items", + "meta" + ] + }, + "PlayerProfile": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "user": { + "$ref": "#/definitions/UserProfile" + }, + "rating": { + "type": "number", + "format": "double" + }, + "totalOrders": { + "type": "integer", + "format": "int64" + }, + "completionRate": { + "type": "number", + "format": "double" + }, + "status": { + "type": "string" + }, + "games": { + "type": "array", + "items": { + "type": "string" + } + }, + "services": { + "type": "array", + "items": { + "$ref": "#/definitions/PlayerService" + } + }, + "shopId": { + "type": "string" + }, + "shopName": { + "type": "string" + }, + "gender": { + "type": "boolean", + "format": "boolean" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "PlayerProfile", + "required": [ + "id", + "user", + "rating", + "totalOrders", + "completionRate", + "status", + "games", + "services", + "gender", + "tags" + ] + }, + "PlayerService": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "playerId": { + "type": "integer", + "format": "int64" + }, + "gameId": { + "type": "integer", + "format": "int64" + }, + "gameName": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "unit": { + "type": "string" + }, + "rankRange": { + "type": "string" + }, + "availability": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "PlayerService", + "required": [ + "playerId", + "gameId", + "gameName", + "title", + "description", + "price", + "unit", + "availability" + ] + }, + "PlayerServiceListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PlayerService" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "PlayerServiceListResp", + "required": [ + "items", + "meta" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UpdatePlayerStatusReq": { + "type": "object", + "properties": { + "status": { + "type": "string" + } + }, + "title": "UpdatePlayerStatusReq", + "required": [ + "status" + ] + }, + "UpdateServiceReq": { + "type": "object", + "properties": { + "gameId": { + "type": "integer", + "format": "int64" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "price": { + "type": "number", + "format": "double" + }, + "unit": { + "type": "string" + }, + "rankRange": { + "type": "string" + }, + "availability": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "UpdateServiceReq", + "required": [ + "availability" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/review-api.json b/desc/api/docs/review-api.json new file mode 100644 index 0000000..c22cf25 --- /dev/null +++ b/desc/api/docs/review-api.json @@ -0,0 +1,401 @@ +{ + "swagger": "2.0", + "info": { + "title": "", + "version": "" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/api/v1/orders/{id}/review": { + "post": { + "summary": "提交评价", + "operationId": "SubmitReview", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SubmitReviewReq" + } + } + ], + "tags": [ + "review" + ] + } + }, + "/api/v1/orders/{id}/reviews": { + "get": { + "summary": "获取订单评价", + "operationId": "GetOrderReviews", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ReviewListResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "review" + ] + } + }, + "/api/v1/reviews": { + "get": { + "summary": "获取公开评价列表", + "operationId": "ListReviews", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ReviewListResp" + } + } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "review" + ], + "consumes": [ + "multipart/form-data" + ] + } + }, + "/api/v1/users/{id}/reviews": { + "get": { + "summary": "获取用户收到的评价", + "operationId": "ListUserReviews", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ReviewListResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "review" + ] + } + } + }, + "definitions": { + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "GetOrderReviewsReq": { + "type": "object", + "title": "GetOrderReviewsReq" + }, + "ListUserReviewsReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "ListUserReviewsReq" + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "Review": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "orderId": { + "type": "integer", + "format": "int64" + }, + "fromUserId": { + "type": "integer", + "format": "int64" + }, + "fromUserName": { + "type": "string" + }, + "rating": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "string" + }, + "sealed": { + "type": "boolean", + "format": "boolean" + }, + "createdAt": { + "type": "string" + } + }, + "title": "Review", + "required": [ + "id", + "orderId", + "fromUserId", + "fromUserName", + "rating", + "content", + "sealed", + "createdAt" + ] + }, + "ReviewListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Review" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "ReviewListResp", + "required": [ + "items", + "meta" + ] + }, + "ReviewPathId": { + "type": "object", + "title": "ReviewPathId" + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "SubmitReviewReq": { + "type": "object", + "properties": { + "rating": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "string" + } + }, + "title": "SubmitReviewReq", + "required": [ + "rating" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/search-api.json b/desc/api/docs/search-api.json new file mode 100644 index 0000000..0c37aa7 --- /dev/null +++ b/desc/api/docs/search-api.json @@ -0,0 +1,549 @@ +{ + "swagger": "2.0", + "info": { + "title": "", + "version": "" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/api/v1/favorites": { + "get": { + "summary": "获取收藏列表", + "operationId": "ListFavorites", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/FavoriteListResp" + } + } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "favorites" + ], + "consumes": [ + "multipart/form-data" + ] + }, + "post": { + "summary": "添加收藏", + "operationId": "AddFavorite", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FavoriteReq" + } + } + ], + "tags": [ + "favorites" + ] + } + }, + "/api/v1/favorites/{id}": { + "delete": { + "summary": "取消收藏", + "operationId": "RemoveFavorite", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PathIDReq" + } + } + ], + "tags": [ + "favorites" + ] + } + }, + "/api/v1/recommendations/home": { + "get": { + "summary": "首页推荐", + "operationId": "Recommendations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/SearchResp" + } + } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "search" + ], + "consumes": [ + "multipart/form-data" + ] + } + }, + "/api/v1/search": { + "get": { + "summary": "统一搜索", + "operationId": "Search", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/SearchResp" + } + } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + }, + { + "name": "q", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "min", + "in": "query", + "required": false, + "type": "number", + "format": "double" + }, + { + "name": "max", + "in": "query", + "required": false, + "type": "number", + "format": "double" + }, + { + "name": "onlyOnline", + "in": "query", + "required": false, + "type": "boolean", + "format": "boolean" + }, + { + "name": "sort", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "search" + ], + "consumes": [ + "multipart/form-data" + ] + } + }, + "/api/v1/users/{id}/favorites/check": { + "get": { + "summary": "检查收藏状态", + "operationId": "CheckFavorite", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/FavoriteCheckResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "id", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "targetType", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "targetId", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": [ + "favorites" + ], + "consumes": [ + "multipart/form-data" + ] + } + } + }, + "definitions": { + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "Favorite": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "targetType": { + "type": "string" + }, + "targetId": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "Favorite", + "required": [ + "id", + "userId", + "targetType", + "targetId", + "createdAt" + ] + }, + "FavoriteCheckReq": { + "type": "object", + "properties": { + "targetType": { + "type": "string" + }, + "targetId": { + "type": "string" + } + }, + "title": "FavoriteCheckReq", + "required": [ + "targetType", + "targetId" + ] + }, + "FavoriteCheckResp": { + "type": "object", + "properties": { + "favorited": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "FavoriteCheckResp", + "required": [ + "favorited" + ] + }, + "FavoriteListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Favorite" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "FavoriteListResp", + "required": [ + "items", + "meta" + ] + }, + "FavoriteReq": { + "type": "object", + "properties": { + "targetType": { + "type": "string", + "description": " player, shop" + }, + "targetId": { + "type": "string" + } + }, + "title": "FavoriteReq", + "required": [ + "targetType", + "targetId" + ] + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "PathIDReq": { + "type": "object", + "title": "PathIDReq" + }, + "SearchReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + }, + "q": { + "type": "string" + }, + "min": { + "type": "number", + "format": "double" + }, + "max": { + "type": "number", + "format": "double" + }, + "onlyOnline": { + "type": "boolean", + "format": "boolean" + }, + "sort": { + "type": "string" + } + }, + "title": "SearchReq" + }, + "SearchResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "type": "object" + }, + "description": " Mixed items" + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "SearchResp", + "required": [ + "items", + "meta" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/shop-api.json b/desc/api/docs/shop-api.json index 5520ba5..8d3e078 100644 --- a/desc/api/docs/shop-api.json +++ b/desc/api/docs/shop-api.json @@ -1,1148 +1,904 @@ { + "swagger": "2.0", + "info": { + "title": "", + "version": "" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "version": "1.0" - }, - "basePath": "/", "paths": { "/api/v1/shops": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取店铺列表", - "operationId": "shopListShops", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - } - ], + "operationId": "ListShops", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "owner", - "name", - "description", - "rating", - "totalOrders", - "playerCount", - "commissionType", - "commissionValue", - "announcements", - "templateConfig" - ], - "properties": { - "announcements": { - "type": "array", - "items": { - "type": "string" - } - }, - "banner": { - "type": "string" - }, - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "playerCount": { - "type": "integer" - }, - "rating": { - "type": "string" - }, - "templateConfig": {}, - "totalOrders": { - "type": "integer" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/ShopListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "shop" + ], + "consumes": [ + "multipart/form-data" + ] }, "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "创建店铺", - "operationId": "shopCreateShop", + "operationId": "CreateShop", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ShopProfile" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "name", - "description", - "commissionType", - "commissionValue" - ], - "properties": { - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" - } - } + "$ref": "#/definitions/CreateShopReq" } } ], + "tags": [ + "shop" + ] + } + }, + "/api/v1/shops/invitations/mine": { + "get": { + "summary": "获取我收到的邀请", + "operationId": "MyInvitations", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "announcements": { - "type": "array", - "items": { - "type": "string" - } - }, - "banner": { - "type": "string" - }, - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "playerCount": { - "type": "integer" - }, - "rating": { - "type": "string" - }, - "templateConfig": {}, - "totalOrders": { - "type": "integer" - } - } + "$ref": "#/definitions/ShopInvitationListResp" } } - } + }, + "tags": [ + "shop" + ] } }, "/api/v1/shops/invitations/{id}": { "delete": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "拒绝邀请", - "operationId": "shopRejectInvitation", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "RejectInvitation", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AcceptInvitationReq" + } + } + ], + "tags": [ + "shop" + ] } }, "/api/v1/shops/invitations/{id}/accept": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "接受邀请", - "operationId": "shopAcceptInvitation", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "AcceptInvitation", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AcceptInvitationReq" + } + } + ], + "tags": [ + "shop" + ] } }, "/api/v1/shops/mine": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取当前用户的店铺", - "operationId": "shopGetMyShop", + "operationId": "GetMyShop", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "announcements": { - "type": "array", - "items": { - "type": "string" - } - }, - "banner": { - "type": "string" - }, - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "playerCount": { - "type": "integer" - }, - "rating": { - "type": "string" - }, - "templateConfig": {}, - "totalOrders": { - "type": "integer" - } - } + "$ref": "#/definitions/ShopProfile" } } - } + }, + "tags": [ + "shop" + ] } }, "/api/v1/shops/{id}": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取店铺详情", - "operationId": "shopGetShop", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetShop", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "announcements": { - "type": "array", - "items": { - "type": "string" - } - }, - "banner": { - "type": "string" - }, - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "playerCount": { - "type": "integer" - }, - "rating": { - "type": "string" - }, - "templateConfig": {}, - "totalOrders": { - "type": "integer" - } - } + "$ref": "#/definitions/ShopProfile" } } - } - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "更新店铺信息", - "operationId": "shopUpdateShop", + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true + "required": true, + "type": "string" + } + ], + "tags": [ + "shop" + ] + }, + "put": { + "summary": "更新店铺信息", + "operationId": "UpdateShop", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ShopProfile" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "allowIndependentOrders": { - "type": "boolean" - }, - "allowMultiShop": { - "type": "boolean" - }, - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "dispatchMode": { - "type": "string" - }, - "name": { - "type": "string" - } - } + "$ref": "#/definitions/UpdateShopReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "announcements": { - "type": "array", - "items": { - "type": "string" - } - }, - "banner": { - "type": "string" - }, - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "playerCount": { - "type": "integer" - }, - "rating": { - "type": "string" - }, - "templateConfig": {}, - "totalOrders": { - "type": "integer" - } - } - } - } - } + "tags": [ + "shop" + ] } }, "/api/v1/shops/{id}/announcements": { "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "新增店铺公告", - "operationId": "shopAddAnnouncement", + "operationId": "AddAnnouncement", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true + "required": true, + "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string" - } - } + "$ref": "#/definitions/AnnouncementReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "shop" + ] } }, "/api/v1/shops/{id}/announcements/{index}": { "delete": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "删除店铺公告", - "operationId": "shopDeleteAnnouncement", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "integer", - "name": "index", - "in": "path", - "required": true - } - ], + "operationId": "DeleteAnnouncement", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "index", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteAnnouncementReq" + } + } + ], + "tags": [ + "shop" + ] } }, "/api/v1/shops/{id}/income-stats": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取收入统计", - "operationId": "shopGetShopIncomeStats", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetShopIncomeStats", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "completedOrders": { - "type": "integer" - }, - "monthlyIncome": { - "type": "string" - }, - "pendingSettlement": { - "type": "string" - }, - "totalOrders": { - "type": "integer" - }, - "totalWithdrawn": { - "type": "string" - } - } + "$ref": "#/definitions/IncomeStatsResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "shop" + ] } }, "/api/v1/shops/{id}/invitations": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "邀请打手", - "operationId": "shopInvitePlayer", + "get": { + "summary": "获取店铺邀请列表", + "operationId": "ListShopInvitations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ShopInvitationListResp" + } + } + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true + "required": true, + "type": "string" + } + ], + "tags": [ + "shop" + ] + }, + "post": { + "summary": "邀请打手", + "operationId": "InvitePlayer", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "playerId" - ], - "properties": { - "playerId": { - "type": "integer" - } - } + "$ref": "#/definitions/InvitationReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "shop" + ] } }, "/api/v1/shops/{id}/players/{playerId}": { "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "移除打手", - "operationId": "shopRemovePlayer", + "operationId": "RemovePlayer", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true + "required": true, + "type": "string" + }, + { + "name": "playerId", + "in": "path", + "required": true, + "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "playerId" - ], - "properties": { - "playerId": { - "type": "integer" - } - } + "$ref": "#/definitions/RemovePlayerReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "shop" + ] } }, "/api/v1/shops/{id}/template": { "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "更新店铺模板", - "operationId": "shopUpdateShopTemplate", + "operationId": "UpdateShopTemplate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true + "required": true, + "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "sections" - ], - "properties": { - "sections": { - "type": "string" - } - } + "$ref": "#/definitions/UpdateTemplateReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "shop" + ] } }, "/api/v1/users/{id}/shop": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取店长的店铺", - "operationId": "shopGetUserShop", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "GetUserShop", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "announcements": { - "type": "array", - "items": { - "type": "string" - } - }, - "banner": { - "type": "string" - }, - "commissionType": { - "type": "string" - }, - "commissionValue": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "playerCount": { - "type": "integer" - }, - "rating": { - "type": "string" - }, - "templateConfig": {}, - "totalOrders": { - "type": "integer" - } - } + "$ref": "#/definitions/ShopProfile" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "shop" + ] } } }, - "x-date": "2026-04-22 22:30:24", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "AcceptInvitationReq": { + "type": "object", + "title": "AcceptInvitationReq" + }, + "AnnouncementReq": { + "type": "object", + "properties": { + "content": { + "type": "string" + } + }, + "title": "AnnouncementReq", + "required": [ + "content" + ] + }, + "CreateShopReq": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "commissionType": { + "type": "string" + }, + "commissionValue": { + "type": "string" + } + }, + "title": "CreateShopReq", + "required": [ + "name", + "description", + "commissionType", + "commissionValue" + ] + }, + "DeleteAnnouncementReq": { + "type": "object", + "title": "DeleteAnnouncementReq" + }, + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "IncomeStatsResp": { + "type": "object", + "properties": { + "monthlyIncome": { + "type": "string" + }, + "pendingSettlement": { + "type": "string" + }, + "totalWithdrawn": { + "type": "string" + }, + "totalOrders": { + "type": "integer", + "format": "int64" + }, + "completedOrders": { + "type": "integer", + "format": "int64" + } + }, + "title": "IncomeStatsResp", + "required": [ + "monthlyIncome", + "pendingSettlement", + "totalWithdrawn", + "totalOrders", + "completedOrders" + ] + }, + "InvitationReq": { + "type": "object", + "properties": { + "playerId": { + "type": "integer", + "format": "int64" + } + }, + "title": "InvitationReq", + "required": [ + "playerId" + ] + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "RemovePlayerReq": { + "type": "object", + "title": "RemovePlayerReq" + }, + "ShopIdReq": { + "type": "object", + "title": "ShopIdReq" + }, + "ShopInvitation": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "shopId": { + "type": "integer", + "format": "int64" + }, + "playerId": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string" + }, + "invitedBy": { + "type": "integer", + "format": "int64" + }, + "createdAt": { + "type": "integer", + "format": "int64" + }, + "respondedAt": { + "type": "integer", + "format": "int64" + } + }, + "title": "ShopInvitation", + "required": [ + "id", + "shopId", + "playerId", + "status", + "invitedBy", + "createdAt" + ] + }, + "ShopInvitationListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/ShopInvitation" + } + } + }, + "title": "ShopInvitationListResp", + "required": [ + "items" + ] + }, + "ShopListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/ShopProfile" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "ShopListResp", + "required": [ + "items", + "meta" + ] + }, + "ShopProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/UserProfile" + }, + "name": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "description": { + "type": "string" + }, + "rating": { + "type": "string" + }, + "totalOrders": { + "type": "integer", + "format": "int64" + }, + "playerCount": { + "type": "integer", + "format": "int64" + }, + "commissionType": { + "type": "string" + }, + "commissionValue": { + "type": "string" + }, + "allowMultiShop": { + "type": "boolean", + "format": "boolean" + }, + "allowIndependentOrders": { + "type": "boolean", + "format": "boolean" + }, + "dispatchMode": { + "type": "string" + }, + "announcements": { + "type": "array", + "items": { + "type": "string" + } + }, + "templateConfig": { + "type": "object" + } + }, + "title": "ShopProfile", + "required": [ + "id", + "owner", + "name", + "description", + "rating", + "totalOrders", + "playerCount", + "commissionType", + "commissionValue", + "allowMultiShop", + "allowIndependentOrders", + "dispatchMode", + "announcements", + "templateConfig" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "UpdateShopReq": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "commissionType": { + "type": "string" + }, + "commissionValue": { + "type": "string" + }, + "allowMultiShop": { + "type": "boolean", + "format": "boolean" + }, + "allowIndependentOrders": { + "type": "boolean", + "format": "boolean" + }, + "dispatchMode": { + "type": "string" + } + }, + "title": "UpdateShopReq" + }, + "UpdateTemplateReq": { + "type": "object", + "properties": { + "sections": { + "type": "string" + } + }, + "title": "UpdateTemplateReq", + "required": [ + "sections" + ] + }, + "UserIdReq": { + "type": "object", + "title": "UserIdReq" + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +} diff --git a/desc/api/docs/users-api.json b/desc/api/docs/users-api.json index cb39b0f..90a9b65 100644 --- a/desc/api/docs/users-api.json +++ b/desc/api/docs/users-api.json @@ -1,1076 +1,927 @@ { + "swagger": "2.0", + "info": { + "title": "聚玩用户服务", + "description": "处理用户注册、登录、个人信息管理及关注系统", + "version": "1.0" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "title": "聚玩用户服务", - "version": "1.0" - }, - "basePath": "/", "paths": { "/api/v1/admin/verifications": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "管理员获取认证申请列表 (分页)", - "operationId": "verificationAdminGetVerifications", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "筛选角色", - "name": "role", - "in": "query", - "allowEmptyValue": true - }, - { - "type": "string", - "description": "筛选状态,默认 pending", - "name": "status", - "in": "query", - "allowEmptyValue": true - } - ], + "operationId": "GetVerifications", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "userId", - "userNickname", - "role", - "status", - "materials", - "rejectReason", - "createdAt", - "reviewedAt" - ], - "properties": { - "createdAt": { - "description": "申请时间", - "type": "string" - }, - "id": { - "description": "认证记录ID (主键,用于管理员操作)", - "type": "integer" - }, - "materials": { - "description": "核心字段:对应 DB 的 JSONB", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "rejectReason": { - "description": "驳回原因", - "type": "string" - }, - "reviewedAt": { - "description": "审核时间", - "type": "string" - }, - "role": { - "description": "申请角色: player, owner", - "type": "string" - }, - "status": { - "description": "pending, approved, rejected", - "type": "string" - }, - "userId": { - "description": "申请人ID (外键)", - "type": "integer" - }, - "userNickname": { - "description": "冗余显示,方便前端展示", - "type": "string" - } - } - } - }, - "total": { - "type": "integer" - } - } + "$ref": "#/definitions/GetPendingListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + }, + { + "name": "role", + "description": " 筛选角色", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "status", + "description": " 筛选状态,默认 pending", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "verification_admin" + ], + "consumes": [ + "multipart/form-data" + ] } }, "/api/v1/admin/verifications/{id}/approve": { "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "管理员通过申请", - "operationId": "verificationAdminApproveVerification", - "parameters": [ - { - "type": "integer", - "description": "注意:这是 user_verifications.id", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "ApproveVerification", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/VerificationEmptyResp" } } - } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "description": " 管理员:审核操作请求 (只包含 ID 路径参数)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/VerificationIdReq" + } + } + ], + "tags": [ + "verification_admin" + ] } }, "/api/v1/admin/verifications/{id}/reject": { "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "管理员驳回申请", - "operationId": "verificationAdminRejectVerification", + "operationId": "RejectVerification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/VerificationEmptyResp" + } + } + }, "parameters": [ { - "type": "integer", "name": "id", "in": "path", - "required": true + "required": true, + "type": "string" + }, + { + "name": "body", + "description": " 管理员:驳回请求", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RejectVerificationReq" + } + } + ], + "tags": [ + "verification_admin" + ] + } + }, + "/api/v1/auth/login": { + "post": { + "summary": "用户登录", + "operationId": "Login", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/LoginResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/LoginReq" + } + } + ], + "tags": [ + "auth" + ] + } + }, + "/api/v1/auth/logout": { + "post": { + "summary": "退出登录", + "operationId": "Logout", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/LogoutReq" + } + } + ], + "tags": [ + "auth" + ] + } + }, + "/api/v1/auth/register": { + "post": { + "summary": "用户注册", + "operationId": "Register", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RegisterResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RegisterReq" + } + } + ], + "tags": [ + "auth" + ] + } + }, + "/api/v1/auth/reset-password": { + "post": { + "summary": "重置密码", + "operationId": "ResetPassword", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ResetPasswordReq" + } + } + ], + "tags": [ + "auth" + ] + } + }, + "/api/v1/users/me": { + "get": { + "summary": "获取当前登录用户信息", + "operationId": "GetMe", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/User" + } + } + }, + "tags": [ + "user" + ] + }, + "put": { + "summary": "更新个人资料", + "operationId": "UpdateMe", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/User" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateUserProfileReq" + } + } + ], + "tags": [ + "user" + ] + } + }, + "/api/v1/users/me/preferences/notifications": { + "put": { + "summary": "更新通知偏好", + "operationId": "UpdateNotificationSettings", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateNotifySettingsReq" + } + } + ], + "tags": [ + "user" + ] + } + }, + "/api/v1/users/me/preferences/theme": { + "put": { + "summary": "更新主题偏好", + "operationId": "UpdateThemeSettings", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateThemeSettingsReq" + } + } + ], + "tags": [ + "user" + ] + } + }, + "/api/v1/users/me/switch-role": { + "post": { + "summary": "切换当前激活角色", + "operationId": "SwitchRole", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SwitchRoleReq" + } + } + ], + "tags": [ + "user" + ] + } + }, + "/api/v1/users/me/verification": { + "get": { + "summary": "获取我的所有认证状态", + "operationId": "GetMyVerifications", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetMyVerificationsResp" + } + } + }, + "tags": [ + "verification_user" + ] + }, + "post": { + "summary": "提交或修改角色认证申请 (支持幂等更新)", + "operationId": "ApplyVerification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/VerificationEmptyResp" + } + } + }, + "parameters": [ + { + "name": "body", + "description": " 提交申请请求", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ApplyVerificationReq" + } + } + ], + "tags": [ + "verification_user" + ] + } + }, + "/api/v1/users/{id}": { + "get": { + "summary": "获取指定用户信息", + "operationId": "GetUserInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/User" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "user" + ] + } + }, + "/api/v1/users/{id}/follow": { + "delete": { + "summary": "取消关注用户", + "operationId": "UnfollowUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" }, { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "reason" - ], - "properties": { - "reason": { - "description": "必填:驳回原因", - "type": "string" - } - } + "$ref": "#/definitions/UnfollowUserReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - } - }, - "/api/v1/auth/login": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "用户登录", - "operationId": "authLogin", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "username", - "password" - ], - "properties": { - "password": { - "type": "string" - }, - "phone": { - "description": "手机号登录", - "type": "string" - }, - "remember": { - "type": "boolean" - }, - "username": { - "description": "或用户名登录", - "type": "string" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "user": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "phone", - "bio", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "description": "ISO 8601", - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "description": "e.g. {\"player\": \"approved\"}", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "description": "e.g. [\"consumer\", \"player\"]", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "/api/v1/auth/logout": { - "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "退出登录", - "operationId": "authLogout", - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - } - }, - "/api/v1/auth/register": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "用户注册", - "operationId": "authRegister", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "email", - "username", - "password", - "vcode" - ], - "properties": { - "email": { - "type": "string" - }, - "password": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "username": { - "type": "string" - }, - "vcode": { - "description": "验证码", - "type": "string" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "user": { - "type": "object", - "required": [ - "id", - "username", - "nickname", - "avatar", - "role", - "verifiedRoles", - "verificationStatus", - "phone", - "bio", - "createdAt" - ], - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "description": "ISO 8601", - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "description": "e.g. {\"player\": \"approved\"}", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "description": "e.g. [\"consumer\", \"player\"]", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - } - } - }, - "/api/v1/auth/reset-password": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "重置密码", - "operationId": "authResetPassword", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "email", - "vcode", - "newPassword" - ], - "properties": { - "email": { - "type": "string" - }, - "newPassword": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "vcode": { - "type": "string" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - } - }, - "/api/v1/users/me": { - "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "获取当前登录用户信息", - "operationId": "userGetMe", - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "description": "ISO 8601", - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "description": "e.g. {\"player\": \"approved\"}", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "description": "e.g. [\"consumer\", \"player\"]", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "更新个人资料", - "operationId": "userUpdateMe", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "nickname": { - "type": "string" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "description": "ISO 8601", - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "description": "e.g. {\"player\": \"approved\"}", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "description": "e.g. [\"consumer\", \"player\"]", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, - "/api/v1/users/me/preferences/notifications": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "更新通知偏好", - "operationId": "userUpdateNotificationSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "community": { - "type": "boolean" - }, - "order": { - "type": "boolean" - }, - "system": { - "type": "boolean" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - } - }, - "/api/v1/users/me/preferences/theme": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "更新主题偏好", - "operationId": "userUpdateThemeSettings", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "theme" - ], - "properties": { - "theme": { - "description": "dark, light", - "type": "string" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - } - }, - "/api/v1/users/me/switch-role": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "切换当前激活角色", - "operationId": "userSwitchRole", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "role" - ], - "properties": { - "role": { - "description": "目标角色", - "type": "string" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - } - }, - "/api/v1/users/me/verification": { - "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "获取我的所有认证状态", - "operationId": "verificationUserGetMyVerifications", - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "userId", - "userNickname", - "role", - "status", - "materials", - "rejectReason", - "createdAt", - "reviewedAt" - ], - "properties": { - "createdAt": { - "description": "申请时间", - "type": "string" - }, - "id": { - "description": "认证记录ID (主键,用于管理员操作)", - "type": "integer" - }, - "materials": { - "description": "核心字段:对应 DB 的 JSONB", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "rejectReason": { - "description": "驳回原因", - "type": "string" - }, - "reviewedAt": { - "description": "审核时间", - "type": "string" - }, - "role": { - "description": "申请角色: player, owner", - "type": "string" - }, - "status": { - "description": "pending, approved, rejected", - "type": "string" - }, - "userId": { - "description": "申请人ID (外键)", - "type": "integer" - }, - "userNickname": { - "description": "冗余显示,方便前端展示", - "type": "string" - } - } - } - } - } - } - } - } + "tags": [ + "user" + ] }, "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "提交或修改角色认证申请 (支持幂等更新)", - "operationId": "verificationUserApplyVerification", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "role", - "materials" - ], - "properties": { - "materials": { - "description": "证明材料键值对 {\"idCardFront\": \"http...\", \"license\": \"http...\"}", - "type": "object", - "required": [ - "idCardFront", - "idCardBack" - ], - "properties": { - "gameScreenshots": { - "description": "游戏截图URL列表", - "type": "array", - "items": { - "type": "string" - } - }, - "idCardBack": { - "description": "身份证反面照片URL", - "type": "string" - }, - "idCardFront": { - "description": "身份证正面照片URL", - "type": "string" - }, - "voiceDemo": { - "description": "语音认证示例URL", - "type": "string" - } - } - }, - "role": { - "description": "申请什么角色", - "type": "string" - } - } - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } - } - }, - "/api/v1/users/{id}": { - "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "获取指定用户信息", - "operationId": "userGetUserInfo", - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object", - "properties": { - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "createdAt": { - "description": "ISO 8601", - "type": "string" - }, - "id": { - "type": "string" - }, - "nickname": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "role": { - "description": "consumer, player, owner, admin", - "type": "string" - }, - "username": { - "type": "string" - }, - "verificationStatus": { - "description": "e.g. {\"player\": \"approved\"}", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "verifiedRoles": { - "description": "e.g. [\"consumer\", \"player\"]", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, - "/api/v1/users/{id}/follow": { - "post": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "关注用户", - "operationId": "userFollowUser", - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true - } - ], + "operationId": "FollowUser", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object" + "$ref": "#/definitions/EmptyResp" } } - } - }, - "delete": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "summary": "取消关注用户", - "operationId": "userUnfollowUser", + }, "parameters": [ { - "type": "string", "name": "id", "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/FollowUserReq" } } - } + ], + "tags": [ + "user" + ] } } }, - "x-date": "2026-04-22 22:30:22", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" + "definitions": { + "ApplyVerificationReq": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": " 申请什么角色" + }, + "materials": { + "$ref": "#/definitions/MaterialJson", + "description": " 证明材料键值对 {\"idCardFront\": \"http...\", \"license\": \"http...\"}" + } + }, + "title": "ApplyVerificationReq", + "required": [ + "role", + "materials" + ] + }, + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "FollowUserReq": { + "type": "object", + "title": "FollowUserReq" + }, + "GetMyVerificationsResp": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/VerificationItem" + } + } + }, + "title": "GetMyVerificationsResp", + "required": [ + "list" + ] + }, + "GetPendingListReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + }, + "role": { + "type": "string", + "description": " 筛选角色" + }, + "status": { + "type": "string", + "description": " 筛选状态,默认 pending" + } + }, + "title": "GetPendingListReq", + "required": [ + "offset", + "limit" + ] + }, + "GetPendingListResp": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/VerificationItem" + } + }, + "total": { + "type": "integer", + "format": "int64" + } + }, + "title": "GetPendingListResp", + "required": [ + "list", + "total" + ] + }, + "GetUserReq": { + "type": "object", + "title": "GetUserReq" + }, + "LoginReq": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": " 手机号登录" + }, + "username": { + "type": "string", + "description": " 或用户名登录" + }, + "password": { + "type": "string" + }, + "remember": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "LoginReq", + "required": [ + "password" + ] + }, + "LoginResp": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/User" + } + }, + "title": "LoginResp", + "required": [ + "user" + ] + }, + "LogoutReq": { + "type": "object", + "title": "LogoutReq" + }, + "MaterialJson": { + "type": "object", + "properties": { + "idCardFront": { + "type": "string", + "description": " 身份证正面照片URL" + }, + "idCardBack": { + "type": "string", + "description": " 身份证反面照片URL" + }, + "gameScreenshots": { + "type": "array", + "items": { + "$ref": "#/definitions/string" + }, + "description": " 游戏截图URL列表" + }, + "voiceDemo": { + "type": "string", + "description": " 语音认证示例URL" + } + }, + "title": "MaterialJson", + "required": [ + "idCardFront", + "idCardBack" + ] + }, + "RegisterReq": { + "type": "object", + "properties": { + "phone": { + "type": "string" + }, + "email": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "vcode": { + "type": "string", + "description": " 验证码" + } + }, + "title": "RegisterReq", + "required": [ + "username", + "password" + ] + }, + "RegisterResp": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/User" + } + }, + "title": "RegisterResp", + "required": [ + "user" + ] + }, + "RejectVerificationReq": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": " 必填:驳回原因" + } + }, + "title": "RejectVerificationReq", + "required": [ + "reason" + ] + }, + "ResetPasswordReq": { + "type": "object", + "properties": { + "phone": { + "type": "string" + }, + "email": { + "type": "string" + }, + "vcode": { + "type": "string" + }, + "newPassword": { + "type": "string" + } + }, + "title": "ResetPasswordReq", + "required": [ + "vcode", + "newPassword" + ] + }, + "SwitchRoleReq": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": " 目标角色" + } + }, + "title": "SwitchRoleReq", + "required": [ + "role" + ] + }, + "UnfollowUserReq": { + "type": "object", + "title": "UnfollowUserReq" + }, + "UpdateNotifySettingsReq": { + "type": "object", + "properties": { + "order": { + "type": "boolean", + "format": "boolean" + }, + "community": { + "type": "boolean", + "format": "boolean" + }, + "system": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "UpdateNotifySettingsReq" + }, + "UpdateThemeSettingsReq": { + "type": "object", + "properties": { + "theme": { + "type": "string", + "description": " dark, light" + } + }, + "title": "UpdateThemeSettingsReq", + "required": [ + "theme" + ] + }, + "UpdateUserProfileReq": { + "type": "object", + "properties": { + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "bio": { + "type": "string" + } + }, + "title": "UpdateUserProfileReq" + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + }, + "description": " e.g. [\"consumer\", \"player\"]" + }, + "verificationStatus": { + "type": "object", + "description": " e.g. {\"player\": \"approved\"}" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": " ISO 8601" + } + }, + "title": "User", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + }, + "VerificationEmptyResp": { + "type": "object", + "title": "VerificationEmptyResp" + }, + "VerificationIdReq": { + "type": "object", + "title": "VerificationIdReq" + }, + "VerificationItem": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": " 认证记录ID (主键,用于管理员操作)" + }, + "userId": { + "type": "integer", + "format": "int64", + "description": " 申请人ID (外键)" + }, + "userNickname": { + "type": "string", + "description": " 冗余显示,方便前端展示" + }, + "role": { + "type": "string", + "description": " 申请角色: player, owner" + }, + "status": { + "type": "string", + "description": " pending, approved, rejected" + }, + "materials": { + "type": "object", + "description": " 核心字段:对应 DB 的 JSONB" + }, + "rejectReason": { + "type": "string", + "description": " 驳回原因" + }, + "createdAt": { + "type": "string", + "description": " 申请时间" + }, + "reviewedAt": { + "type": "string", + "description": " 审核时间" + } + }, + "title": "VerificationItem", + "required": [ + "id", + "userId", + "userNickname", + "role", + "status", + "materials", + "rejectReason", + "createdAt", + "reviewedAt" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } } diff --git a/desc/api/docs/wallet-api.json b/desc/api/docs/wallet-api.json index aba34f0..9372c1f 100644 --- a/desc/api/docs/wallet-api.json +++ b/desc/api/docs/wallet-api.json @@ -1,234 +1,339 @@ { + "swagger": "2.0", + "info": { + "title": "钱包服务", + "description": "处理钱包充值相关", + "version": "1.0" + }, + "schemes": [ + "http", + "https" + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "title": "钱包服务", - "version": "1.0" - }, - "basePath": "/", "paths": { "/api/v1/wallet/balance": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取余额", - "operationId": "walletGetBalance", + "operationId": "GetBalance", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "balance": { - "type": "string" - }, - "frozenBalance": { - "type": "string" - } - } + "$ref": "#/definitions/WalletBalance" } } - } + }, + "tags": [ + "wallet" + ] } }, "/api/v1/wallet/topup": { "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "充值", - "operationId": "walletTopup", + "operationId": "Topup", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "amount", - "method" - ], - "properties": { - "amount": { - "type": "string" - }, - "method": { - "type": "string" - } - } + "$ref": "#/definitions/TopupReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "wallet" + ] } }, "/api/v1/wallet/transactions": { "get": { - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "获取流水", - "operationId": "walletListTransactions", - "parameters": [ - { - "type": "integer", - "default": 0, - "example": 0, - "name": "offset", - "in": "query", - "required": true - }, - { - "type": "integer", - "default": 20, - "example": 20, - "name": "limit", - "in": "query", - "required": true - } - ], + "operationId": "ListTransactions", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "type", - "amount", - "description", - "createdAt" - ], - "properties": { - "amount": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "description": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "orderId": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "meta": { - "type": "object", - "required": [ - "total", - "offset", - "limit" - ], - "properties": { - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - } - } + "$ref": "#/definitions/TransactionListResp" } } - } + }, + "parameters": [ + { + "name": "offset", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "0" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "wallet" + ], + "consumes": [ + "multipart/form-data" + ] } }, "/api/v1/wallet/withdraw": { "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], "summary": "提现", - "operationId": "walletWithdraw", + "operationId": "Withdraw", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/EmptyResp" + } + } + }, "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "type": "object", - "required": [ - "amount", - "method" - ], - "properties": { - "amount": { - "type": "string" - }, - "method": { - "type": "string" - } - } + "$ref": "#/definitions/TopupReq" } } ], - "responses": { - "200": { - "description": "", - "schema": { - "type": "object" - } - } - } + "tags": [ + "wallet" + ] } } }, - "x-date": "2026-04-22 22:30:25", - "x-description": "This is a goctl generated swagger file.", - "x-github": "https://github.com/zeromicro/go-zero", - "x-go-zero-doc": "https://go-zero.dev/", - "x-goctl-version": "1.10.1" -} \ No newline at end of file + "definitions": { + "EmptyResp": { + "type": "object", + "title": "EmptyResp" + }, + "PageMeta": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "offset": { + "type": "integer", + "format": "int64" + }, + "limit": { + "type": "integer", + "format": "int64" + } + }, + "title": "PageMeta", + "required": [ + "total", + "offset", + "limit" + ] + }, + "PageReq": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64", + "default": "0" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "PageReq", + "required": [ + "offset", + "limit" + ] + }, + "SimpleUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + } + }, + "title": "SimpleUser", + "required": [ + "id", + "nickname", + "avatar" + ] + }, + "TopupReq": { + "type": "object", + "properties": { + "amount": { + "type": "string" + }, + "method": { + "type": "string" + } + }, + "title": "TopupReq", + "required": [ + "amount", + "method" + ] + }, + "Transaction": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "description": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "Transaction", + "required": [ + "id", + "type", + "amount", + "description", + "createdAt" + ] + }, + "TransactionListResp": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Transaction" + } + }, + "meta": { + "$ref": "#/definitions/PageMeta" + } + }, + "title": "TransactionListResp", + "required": [ + "items", + "meta" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "nickname": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "role": { + "type": "string", + "description": " consumer, player, owner, admin" + }, + "verifiedRoles": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationStatus": { + "type": "object" + }, + "phone": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "title": "UserProfile", + "required": [ + "id", + "username", + "nickname", + "avatar", + "role", + "verifiedRoles", + "verificationStatus", + "createdAt" + ] + }, + "WalletBalance": { + "type": "object", + "properties": { + "balance": { + "type": "string" + }, + "frozenBalance": { + "type": "string" + } + }, + "title": "WalletBalance", + "required": [ + "balance", + "frozenBalance" + ] + } + }, + "securityDefinitions": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + } +}