fix: some api bug
This commit is contained in:
@@ -0,0 +1,214 @@
|
||||
{
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "game-api",
|
||||
"version": "1.0"
|
||||
},
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/api/v1/games": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取游戏列表",
|
||||
"operationId": "gameListGames",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 20,
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "创建游戏",
|
||||
"operationId": "gameCreateGame",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"icon",
|
||||
"category"
|
||||
],
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/games/{id}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取游戏详情",
|
||||
"operationId": "gameGetGame",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-date": "2026-03-23 01:44:01",
|
||||
"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.9.2"
|
||||
}
|
||||
@@ -0,0 +1,940 @@
|
||||
{
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "聚玩订单服务",
|
||||
"version": "1.0"
|
||||
},
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/api/v1/orders": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取订单列表",
|
||||
"operationId": "orderListOrders",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"consumerId",
|
||||
"consumerName",
|
||||
"playerId",
|
||||
"playerName",
|
||||
"service",
|
||||
"status",
|
||||
"totalPrice",
|
||||
"createdAt"
|
||||
],
|
||||
"properties": {
|
||||
"acceptedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"completedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"consumerId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"consumerName": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"note": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerName": {
|
||||
"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"
|
||||
},
|
||||
"shopName": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalPrice": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"total",
|
||||
"offset",
|
||||
"limit"
|
||||
],
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "创建订单",
|
||||
"operationId": "orderCreateOrder",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ok": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"order": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"consumerId",
|
||||
"consumerName",
|
||||
"playerId",
|
||||
"playerName",
|
||||
"service",
|
||||
"status",
|
||||
"totalPrice",
|
||||
"createdAt"
|
||||
],
|
||||
"properties": {
|
||||
"acceptedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"completedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"consumerId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"consumerName": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"note": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerName": {
|
||||
"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"
|
||||
},
|
||||
"shopName": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalPrice": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/orders/paid": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "创建并支付订单",
|
||||
"operationId": "orderCreateAndPayOrder",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ok": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"order": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"consumerId",
|
||||
"consumerName",
|
||||
"playerId",
|
||||
"playerName",
|
||||
"service",
|
||||
"status",
|
||||
"totalPrice",
|
||||
"createdAt"
|
||||
],
|
||||
"properties": {
|
||||
"acceptedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"completedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"consumerId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"consumerName": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"note": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerName": {
|
||||
"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"
|
||||
},
|
||||
"shopName": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalPrice": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/orders/{id}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取订单详情",
|
||||
"operationId": "orderGetOrder",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"acceptedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"completedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"consumerId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"consumerName": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"note": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerName": {
|
||||
"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"
|
||||
},
|
||||
"shopName": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalPrice": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ok": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"order": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"consumerId",
|
||||
"consumerName",
|
||||
"playerId",
|
||||
"playerName",
|
||||
"service",
|
||||
"status",
|
||||
"totalPrice",
|
||||
"createdAt"
|
||||
],
|
||||
"properties": {
|
||||
"acceptedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"completedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"consumerId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"consumerName": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"note": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerId": {
|
||||
"type": "string"
|
||||
},
|
||||
"playerName": {
|
||||
"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"
|
||||
},
|
||||
"shopName": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalPrice": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-date": "2026-03-27 17:39:38",
|
||||
"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.9.2"
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "文件服务",
|
||||
"version": "v1"
|
||||
},
|
||||
"basePath": "/",
|
||||
"paths": {
|
||||
"/api/v1/files/{fileId}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "文件获取接口 (如果是私有文件,通过此接口获取或重定向)",
|
||||
"operationId": "fileGetFile",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"name": "fileId",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"description": "返回 CDN 地址或访问地址",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-date": "2026-03-26 17:05:36",
|
||||
"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.9.2"
|
||||
}
|
||||
@@ -0,0 +1,978 @@
|
||||
{
|
||||
"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,
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 20,
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "gameId",
|
||||
"in": "query",
|
||||
"allowEmptyValue": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "gender",
|
||||
"in": "query",
|
||||
"allowEmptyValue": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"user",
|
||||
"rating",
|
||||
"totalOrders",
|
||||
"completionRate",
|
||||
"status",
|
||||
"games",
|
||||
"services",
|
||||
"tags"
|
||||
],
|
||||
"properties": {
|
||||
"completionRate": {
|
||||
"type": "number"
|
||||
},
|
||||
"games": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"rating": {
|
||||
"type": "number"
|
||||
},
|
||||
"services": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"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": "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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/players/me/status": {
|
||||
"put": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "更新接单状态",
|
||||
"operationId": "playerUpdatePlayerStatus",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"status"
|
||||
],
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/players/{id}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取打手详情",
|
||||
"operationId": "playerGetPlayer",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"completionRate": {
|
||||
"type": "number"
|
||||
},
|
||||
"games": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"rating": {
|
||||
"type": "number"
|
||||
},
|
||||
"services": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"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": "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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/players/{id}/services": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取指定打手的服务列表",
|
||||
"operationId": "playerListPlayerServices",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 20,
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"total",
|
||||
"offset",
|
||||
"limit"
|
||||
],
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/services": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取所有服务列表",
|
||||
"operationId": "playerListServices",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 20,
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"total",
|
||||
"offset",
|
||||
"limit"
|
||||
],
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "创建服务",
|
||||
"operationId": "playerCreateService",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"gameId",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/services/{id}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取服务详情",
|
||||
"operationId": "playerGetService",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "更新服务",
|
||||
"operationId": "playerUpdateService",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"gameId",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-date": "2026-03-29 23:48:43",
|
||||
"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.9.2"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"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",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"balance": {
|
||||
"type": "string"
|
||||
},
|
||||
"frozenBalance": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/wallet/topup": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "充值",
|
||||
"operationId": "walletTopup",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"amount",
|
||||
"method"
|
||||
],
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "string"
|
||||
},
|
||||
"method": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/wallet/transactions": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "获取流水",
|
||||
"operationId": "walletListTransactions",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"default": 20,
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/wallet/withdraw": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"schemes": [
|
||||
"https"
|
||||
],
|
||||
"summary": "提现",
|
||||
"operationId": "walletWithdraw",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"amount",
|
||||
"method"
|
||||
],
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "string"
|
||||
},
|
||||
"method": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "",
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-date": "2026-03-26 17:02:28",
|
||||
"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.9.2"
|
||||
}
|
||||
@@ -30,5 +30,9 @@ service game-api {
|
||||
@doc "获取游戏详情"
|
||||
@handler GetGame
|
||||
get /:id (GetGameReq) returns (Game)
|
||||
|
||||
@doc "创建游戏"
|
||||
@handler CreateGame
|
||||
post / (Game) returns (Game)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ type (
|
||||
}
|
||||
// 获取文件请求(用于私有文件或代理访问)
|
||||
GetFileReq {
|
||||
FileId string `path:"fileId"`
|
||||
FileId string `form:"key"`
|
||||
}
|
||||
)
|
||||
|
||||
@@ -34,6 +34,6 @@ service file-api {
|
||||
|
||||
@doc "文件获取接口 (如果是私有文件,通过此接口获取或重定向)"
|
||||
@handler GetFile
|
||||
get /files/:fileId (GetFileReq)
|
||||
get /files (GetFileReq)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,29 @@
|
||||
syntax = "v1"
|
||||
import "common.api"
|
||||
|
||||
info (
|
||||
title: "聚玩订单服务"
|
||||
desc: "处理订单业务"
|
||||
author: "Asadz"
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
type (
|
||||
PathId {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
PlayerService {
|
||||
Id int64 `json:"id"`
|
||||
PlayerId int64 `json:"playerId"`
|
||||
GameId int64 `json:"gameId"`
|
||||
GameName string `json:"gameName"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price"`
|
||||
Unit string `json:"unit"`
|
||||
RankRange string `json:"rankRange,optional"`
|
||||
Availability []string `json:"availability"`
|
||||
}
|
||||
Order {
|
||||
Id int64 `json:"id"`
|
||||
ConsumerId int64 `json:"consumerId"`
|
||||
|
||||
+9
-1
@@ -1,5 +1,12 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "聚玩打手服务"
|
||||
desc: "聚玩用户服务处理打手信息管理、服务发布及订单相关接口"
|
||||
author: "Asadz"
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
@@ -50,12 +57,13 @@ type (
|
||||
Services []PlayerService `json:"services"`
|
||||
ShopId string `json:"shopId,optional"`
|
||||
ShopName string `json:"shopName,optional"`
|
||||
Gender bool `json:"gender"`
|
||||
Tags []string `json:"tags"`
|
||||
}
|
||||
PlayerListReq {
|
||||
PageReq
|
||||
GameId int64 `form:"gameId,optional"`
|
||||
Gender int `form:"gender,optional"`
|
||||
Gender int64 `form:"gender,optional"`
|
||||
}
|
||||
PlayerListResp {
|
||||
Items []PlayerProfile `json:"items"`
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ service shop-api {
|
||||
|
||||
@doc "更新店铺信息"
|
||||
@handler UpdateShop
|
||||
put /shops/:id (ShopIdReq) returns (ShopProfile)
|
||||
put /shops/:id (UpdateShopReq) returns (ShopProfile)
|
||||
|
||||
@doc "更新店铺模板"
|
||||
@handler UpdateShopTemplate
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "聚玩认证审核服务"
|
||||
desc: "处理用户角色认证申请(打手/店长)及管理员审核流程"
|
||||
author: "Asadz"
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
// =================================================================================
|
||||
// 数据结构定义 (Data Structures)
|
||||
// =================================================================================
|
||||
|
||||
// =================================================================================
|
||||
// 用户端接口 (User Side)
|
||||
// 路径前缀: /api/v1/users
|
||||
// =================================================================================
|
||||
@server (
|
||||
group: verification_user
|
||||
prefix: /api/v1/users
|
||||
)
|
||||
service verification-api {
|
||||
@doc "提交或修改角色认证申请 (支持幂等更新)"
|
||||
@handler ApplyVerification
|
||||
post /me/verification (ApplyVerificationReq) returns (VerificationEmptyResp)
|
||||
|
||||
@doc "获取我的所有认证状态"
|
||||
@handler GetMyVerifications
|
||||
get /me/verification returns (GetMyVerificationsResp)
|
||||
}
|
||||
|
||||
// =================================================================================
|
||||
// 管理端接口 (Admin Side)
|
||||
// 路径前缀: /api/v1/admin
|
||||
// =================================================================================
|
||||
@server (
|
||||
group: verification_admin
|
||||
prefix: /api/v1/admin
|
||||
)
|
||||
service verification-api {
|
||||
@doc "管理员获取认证申请列表 (分页)"
|
||||
@handler GetVerifications
|
||||
get /verifications (GetPendingListReq) returns (GetPendingListResp)
|
||||
|
||||
@doc "管理员通过申请"
|
||||
@handler ApproveVerification
|
||||
post /verifications/:id/approve (VerificationIdReq) returns (VerificationEmptyResp)
|
||||
|
||||
@doc "管理员驳回申请"
|
||||
@handler RejectVerification
|
||||
post /verifications/:id/reject (RejectVerificationReq) returns (VerificationEmptyResp)
|
||||
}
|
||||
|
||||
//syntax = "v1"
|
||||
//
|
||||
//info (
|
||||
// title: "聚玩认证审核服务"
|
||||
// desc: "处理用户角色认证申请(打手/店长)及管理员审核流程"
|
||||
// author: "Asadz"
|
||||
// version: "1.0"
|
||||
//)
|
||||
//
|
||||
//// =================================================================================
|
||||
//// 数据结构定义 (Data Structures)
|
||||
//// =================================================================================
|
||||
//
|
||||
//// =================================================================================
|
||||
//// 用户端接口 (User Side)
|
||||
//// 路径前缀: /api/v1/users
|
||||
//// =================================================================================
|
||||
//@server (
|
||||
// group: verification_user
|
||||
// prefix: /api/v1/users
|
||||
//)
|
||||
//service verification-api {
|
||||
// @doc "提交或修改角色认证申请 (支持幂等更新)"
|
||||
// @handler ApplyVerification
|
||||
// post /me/verification (ApplyVerificationReq) returns (VerificationEmptyResp)
|
||||
//
|
||||
// @doc "获取我的所有认证状态"
|
||||
// @handler GetMyVerifications
|
||||
// get /me/verification returns (GetMyVerificationsResp)
|
||||
//}
|
||||
//
|
||||
//// =================================================================================
|
||||
//// 管理端接口 (Admin Side)
|
||||
//// 路径前缀: /api/v1/admin
|
||||
//// =================================================================================
|
||||
//@server (
|
||||
// group: verification_admin
|
||||
// prefix: /api/v1/admin
|
||||
//)
|
||||
//service verification-api {
|
||||
// @doc "管理员获取认证申请列表 (分页)"
|
||||
// @handler GetVerifications
|
||||
// get /verifications (GetPendingListReq) returns (GetPendingListResp)
|
||||
//
|
||||
// @doc "管理员通过申请"
|
||||
// @handler ApproveVerification
|
||||
// post /verifications/:id/approve (VerificationIdReq) returns (VerificationEmptyResp)
|
||||
//
|
||||
// @doc "管理员驳回申请"
|
||||
// @handler RejectVerification
|
||||
// post /verifications/:id/reject (RejectVerificationReq) returns (VerificationEmptyResp)
|
||||
//}
|
||||
//
|
||||
|
||||
+11
-5
@@ -8,6 +8,13 @@ info (
|
||||
)
|
||||
|
||||
type (
|
||||
// 认证材料结构体(示例,实际根据需求定义)
|
||||
MaterialJson {
|
||||
IdCardFront string `json:"idCardFront"` // 身份证正面照片URL
|
||||
IdCardBack string `json:"idCardBack"` // 身份证反面照片URL
|
||||
GameScreenshots []*string `json:"gameScreenshots,optional"` // 游戏截图URL列表
|
||||
VoiceDemo *string `json:"voiceDemo,optional"` // 语音认证示例URL
|
||||
}
|
||||
// 认证记录展示对象
|
||||
// 对应数据库 user_verifications 表
|
||||
VerificationItem {
|
||||
@@ -23,8 +30,8 @@ type (
|
||||
}
|
||||
// 提交申请请求
|
||||
ApplyVerificationReq {
|
||||
Role string `json:"role"` // 申请什么角色
|
||||
Materials map[string]string `json:"materials"` // 证明材料键值对 {"idCardFront": "http...", "license": "http..."}
|
||||
Role string `json:"role"` // 申请什么角色
|
||||
Materials MaterialJson `json:"materials"` // 证明材料键值对 {"idCardFront": "http...", "license": "http..."}
|
||||
}
|
||||
// 获取我的申请记录响应
|
||||
GetMyVerificationsResp {
|
||||
@@ -235,9 +242,8 @@ service user-api {
|
||||
}
|
||||
|
||||
@server (
|
||||
group: verification_user
|
||||
prefix: /api/v1/users
|
||||
middleware: Logger // 必须登录
|
||||
group: verification_user
|
||||
prefix: /api/v1/users
|
||||
)
|
||||
service user-api {
|
||||
@doc "提交或修改角色认证申请 (支持幂等更新)"
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "钱包服务"
|
||||
desc: "处理钱包充值相关"
|
||||
author: "Asadz"
|
||||
version: "1.0"
|
||||
)
|
||||
|
||||
import "common.api"
|
||||
|
||||
type (
|
||||
|
||||
+13
-13
@@ -112,7 +112,7 @@ message Players {
|
||||
repeated int64 games = 9; //games
|
||||
int64 createdAt = 10; //createdAt
|
||||
int64 updatedAt = 11; //updatedAt
|
||||
int64 gender = 12; //gender
|
||||
bool gender = 12; //gender
|
||||
}
|
||||
|
||||
message AddPlayersReq {
|
||||
@@ -166,20 +166,20 @@ message GetPlayersByIdResp {
|
||||
}
|
||||
|
||||
message SearchPlayersReq {
|
||||
int64 page = 1; //page
|
||||
int64 limit = 2; //limit
|
||||
int64 id = 3; //id
|
||||
int64 userId = 4; //userId
|
||||
string status = 5; //status
|
||||
double rating = 6; //rating
|
||||
int64 totalOrders = 7; //totalOrders
|
||||
int64 completedOrders = 8; //completedOrders
|
||||
int64 shopId = 9; //shopId
|
||||
optional int64 page = 1; //page
|
||||
optional int64 limit = 2; //limit
|
||||
optional int64 id = 3; //id
|
||||
optional int64 userId = 4; //userId
|
||||
optional string status = 5; //status
|
||||
optional double rating = 6; //rating
|
||||
optional int64 totalOrders = 7; //totalOrders
|
||||
optional int64 completedOrders = 8; //completedOrders
|
||||
optional int64 shopId = 9; //shopId
|
||||
repeated string tags = 10; //tags
|
||||
repeated int64 games = 11; //games
|
||||
int64 createdAt = 12; //createdAt
|
||||
int64 updatedAt = 13; //updatedAt
|
||||
int64 gender = 14; //gender
|
||||
optional int64 createdAt = 12; //createdAt
|
||||
optional int64 updatedAt = 13; //updatedAt
|
||||
optional int64 gender = 14; //gender
|
||||
}
|
||||
|
||||
message SearchPlayersResp {
|
||||
|
||||
@@ -87,6 +87,23 @@ message SearchUserVerificationsResp {
|
||||
repeated UserVerifications userVerifications = 1; //userVerifications
|
||||
}
|
||||
|
||||
message AddOrUpdateUserVerificationsReq {
|
||||
int64 userId = 1; // userId
|
||||
string role = 2;
|
||||
string material = 3; // material
|
||||
}
|
||||
|
||||
message AddOrUpdateUserVerificationsResp {
|
||||
bool success = 1; // success
|
||||
}
|
||||
|
||||
message ListUserVerificationsByUserIdReq {
|
||||
int64 userId = 1; // userId
|
||||
}
|
||||
|
||||
message ListUserVerificationsByUserIdResp {
|
||||
repeated UserVerifications userVerifications = 1; // userVerifications
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------
|
||||
@@ -100,6 +117,8 @@ service user_verifications{
|
||||
rpc UpdateUserVerifications(UpdateUserVerificationsReq) returns (UpdateUserVerificationsResp);
|
||||
rpc DelUserVerifications(DelUserVerificationsReq) returns (DelUserVerificationsResp);
|
||||
rpc GetUserVerificationsById(GetUserVerificationsByIdReq) returns (GetUserVerificationsByIdResp);
|
||||
rpc SearchUserVerifications(SearchUserVerificationsReq) returns (SearchUserVerificationsResp);
|
||||
rpc SearchUserVerifications(SearchUserVerificationsReq) returns (SearchUserVerificationsResp);
|
||||
|
||||
rpc AddOrUpdateUserVerifications(AddOrUpdateUserVerificationsReq) returns (AddOrUpdateUserVerificationsResp);
|
||||
rpc ListUserVerificationsByUserId(ListUserVerificationsByUserIdReq) returns (ListUserVerificationsByUserIdResp);
|
||||
}
|
||||
|
||||
+166
-16
@@ -4,9 +4,9 @@ option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
// ------------------------------------
|
||||
// ------------------------------------
|
||||
// Messages
|
||||
// ------------------------------------
|
||||
// ------------------------------------
|
||||
|
||||
//--------------------------------users--------------------------------
|
||||
//--------------------------------users--------------------------------
|
||||
@@ -125,30 +125,30 @@ message LoginResp {
|
||||
string token = 1;
|
||||
string username = 2;
|
||||
string email = 3;
|
||||
int64 id = 4;
|
||||
int64 id = 4;
|
||||
}
|
||||
|
||||
message ValidateTokenReq {
|
||||
string token = 1; // JWT token
|
||||
int64 userId = 2; // 用户ID
|
||||
string token = 1; // JWT token
|
||||
int64 userId = 2; // 用户ID
|
||||
}
|
||||
|
||||
message ValidateTokenResp {
|
||||
bool valid = 1; // token 是否有效(不在黑名单中)
|
||||
string message = 2; // 验证失败原因
|
||||
int64 userId = 3; // 用户ID
|
||||
string roleType = 4; // 用户角色
|
||||
bool valid = 1; // token 是否有效(不在黑名单中)
|
||||
string message = 2; // 验证失败原因
|
||||
int64 userId = 3; // 用户ID
|
||||
string roleType = 4; // 用户角色
|
||||
}
|
||||
|
||||
message CheckPermissionReq {
|
||||
int64 userId = 1; // 用户ID
|
||||
string resource = 2; // 资源 ID
|
||||
string action = 3; // 操作类型: read/write/delete
|
||||
int64 userId = 1; // 用户ID
|
||||
string resource = 2; // 资源 ID
|
||||
string action = 3; // 操作类型: read/write/delete
|
||||
}
|
||||
|
||||
message CheckPermissionResp {
|
||||
bool allowed = 1; // 是否有权限
|
||||
string message = 2; // 拒绝原因
|
||||
bool allowed = 1; // 是否有权限
|
||||
string message = 2; // 拒绝原因
|
||||
}
|
||||
|
||||
message RegisterReq {
|
||||
@@ -182,9 +182,143 @@ message ResetPasswordReq {
|
||||
message ResetPasswordResp {
|
||||
|
||||
}
|
||||
|
||||
message SwitchRoleReq {
|
||||
int64 userId = 1;
|
||||
string newRole = 2;
|
||||
}
|
||||
|
||||
message SwitchRoleResp {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
//--------------------------------userFollows--------------------------------
|
||||
message UserFollows {
|
||||
int64 id = 1; //id
|
||||
int64 followerId = 2; //followerId
|
||||
int64 followeeId = 3; //followeeId
|
||||
int64 createdAt = 4; //createdAt
|
||||
}
|
||||
|
||||
message AddUserFollowsReq {
|
||||
int64 followerId = 1; //followerId
|
||||
int64 followeeId = 2; //followeeId
|
||||
int64 createdAt = 3; //createdAt
|
||||
}
|
||||
|
||||
message AddUserFollowsResp {
|
||||
}
|
||||
|
||||
message UpdateUserFollowsReq {
|
||||
int64 id = 1; //id
|
||||
int64 followerId = 2; //followerId
|
||||
int64 followeeId = 3; //followeeId
|
||||
int64 createdAt = 4; //createdAt
|
||||
}
|
||||
|
||||
message UpdateUserFollowsResp {
|
||||
}
|
||||
|
||||
message DelUserFollowsReq {
|
||||
int64 id = 1; //id
|
||||
int64 userId = 2; // userId
|
||||
}
|
||||
|
||||
message DelUserFollowsResp {
|
||||
}
|
||||
|
||||
message GetUserFollowsByIdReq {
|
||||
int64 id = 1; //id
|
||||
}
|
||||
|
||||
message GetUserFollowsByIdResp {
|
||||
UserFollows userFollows = 1; //userFollows
|
||||
}
|
||||
|
||||
message SearchUserFollowsReq {
|
||||
int64 page = 1; //page
|
||||
int64 limit = 2; //limit
|
||||
int64 id = 3; //id
|
||||
int64 followerId = 4; //followerId
|
||||
int64 followeeId = 5; //followeeId
|
||||
int64 createdAt = 6; //createdAt
|
||||
}
|
||||
|
||||
message SearchUserFollowsResp {
|
||||
repeated UserFollows userFollows = 1; //userFollows
|
||||
}
|
||||
|
||||
//--------------------------------userPreferences--------------------------------
|
||||
message UserPreferences {
|
||||
int64 userId = 1; //userId
|
||||
bool notificationOrder = 2; //notificationOrder
|
||||
bool notificationCommunity = 3; //notificationCommunity
|
||||
bool notificationSystem = 4; //notificationSystem
|
||||
string theme = 5; //theme
|
||||
string language = 6; //language
|
||||
int64 updatedAt = 7; //updatedAt
|
||||
}
|
||||
|
||||
message AddUserPreferencesReq {
|
||||
int64 userId = 1; //userId
|
||||
bool notificationOrder = 2; //notificationOrder
|
||||
bool notificationCommunity = 3; //notificationCommunity
|
||||
bool notificationSystem = 4; //notificationSystem
|
||||
string theme = 5; //theme
|
||||
string language = 6; //language
|
||||
int64 updatedAt = 7; //updatedAt
|
||||
}
|
||||
|
||||
message AddUserPreferencesResp {
|
||||
}
|
||||
|
||||
message UpdateUserPreferencesReq {
|
||||
int64 userId = 1; //userId
|
||||
bool notificationOrder = 2; //notificationOrder
|
||||
bool notificationCommunity = 3; //notificationCommunity
|
||||
bool notificationSystem = 4; //notificationSystem
|
||||
string theme = 5; //theme
|
||||
string language = 6; //language
|
||||
int64 updatedAt = 7; //updatedAt
|
||||
}
|
||||
|
||||
message UpdateUserPreferencesResp {
|
||||
}
|
||||
|
||||
message DelUserPreferencesReq {
|
||||
int64 id = 1; //id
|
||||
}
|
||||
|
||||
message DelUserPreferencesResp {
|
||||
}
|
||||
|
||||
message GetUserPreferencesByIdReq {
|
||||
int64 id = 1; //id
|
||||
}
|
||||
|
||||
message GetUserPreferencesByIdResp {
|
||||
UserPreferences userPreferences = 1; //userPreferences
|
||||
}
|
||||
|
||||
message SearchUserPreferencesReq {
|
||||
int64 page = 1; //page
|
||||
int64 limit = 2; //limit
|
||||
int64 userId = 3; //userId
|
||||
bool notificationOrder = 4; //notificationOrder
|
||||
bool notificationCommunity = 5; //notificationCommunity
|
||||
bool notificationSystem = 6; //notificationSystem
|
||||
string theme = 7; //theme
|
||||
string language = 8; //language
|
||||
int64 updatedAt = 9; //updatedAt
|
||||
}
|
||||
|
||||
message SearchUserPreferencesResp {
|
||||
repeated UserPreferences userPreferences = 1; //userPreferences
|
||||
}
|
||||
|
||||
// ------------------------------------
|
||||
// Rpc Func
|
||||
// ------------------------------------
|
||||
// ------------------------------------
|
||||
|
||||
service usercenter {
|
||||
|
||||
@@ -193,12 +327,28 @@ service usercenter {
|
||||
rpc UpdateUsers(UpdateUsersReq) returns (UpdateUsersResp);
|
||||
rpc DelUsers(DelUsersReq) returns (DelUsersResp);
|
||||
rpc GetUsersById(GetUsersByIdReq) returns (GetUsersByIdResp);
|
||||
rpc GetUserByUsername(GetUserByUsernameReq) returns (GetUserByUsernameResp);
|
||||
rpc SearchUsers(SearchUsersReq) returns (SearchUsersResp);
|
||||
|
||||
rpc GetUserByUsername(GetUserByUsernameReq) returns (GetUserByUsernameResp);
|
||||
rpc Login(LoginReq) returns (LoginResp);
|
||||
rpc Register(RegisterReq) returns (RegisterResp);
|
||||
rpc ValidateToken(ValidateTokenReq) returns (ValidateTokenResp);
|
||||
rpc CheckPermission(CheckPermissionReq) returns (CheckPermissionResp);
|
||||
rpc Logout(LogoutReq) returns (LogoutResp);
|
||||
rpc ResetPassword(ResetPasswordReq) returns (ResetPasswordResp);
|
||||
rpc SwitchRole(SwitchRoleReq) returns (SwitchRoleResp);
|
||||
|
||||
|
||||
//-----------------------userFollows-----------------------
|
||||
rpc AddUserFollows(AddUserFollowsReq) returns (AddUserFollowsResp);
|
||||
rpc UpdateUserFollows(UpdateUserFollowsReq) returns (UpdateUserFollowsResp);
|
||||
rpc DelUserFollows(DelUserFollowsReq) returns (DelUserFollowsResp);
|
||||
rpc GetUserFollowsById(GetUserFollowsByIdReq) returns (GetUserFollowsByIdResp);
|
||||
rpc SearchUserFollows(SearchUserFollowsReq) returns (SearchUserFollowsResp);
|
||||
//-----------------------userPreferences-----------------------
|
||||
rpc AddUserPreferences(AddUserPreferencesReq) returns (AddUserPreferencesResp);
|
||||
rpc UpdateUserPreferences(UpdateUserPreferencesReq) returns (UpdateUserPreferencesResp);
|
||||
rpc DelUserPreferences(DelUserPreferencesReq) returns (DelUserPreferencesResp);
|
||||
rpc GetUserPreferencesById(GetUserPreferencesByIdReq) returns (GetUserPreferencesByIdResp);
|
||||
rpc SearchUserPreferences(SearchUserPreferencesReq) returns (SearchUserPreferencesResp);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ CREATE TABLE players
|
||||
|
||||
-- [注意] 此字段为冗余缓存,通过消息队列与 shop_players 表保持一致
|
||||
shop_id BIGINT,
|
||||
gender bool default 1 not null ,
|
||||
gender bool default true not null ,
|
||||
tags TEXT[] DEFAULT ARRAY[]::TEXT[],
|
||||
games BIGINT[] DEFAULT ARRAY[]::BIGINT[],
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
|
||||
@@ -15,6 +15,6 @@ CREATE TABLE shop_players
|
||||
CREATE INDEX idx_shop_players_player ON shop_players (player_id) WHERE left_at IS NULL;
|
||||
CREATE INDEX idx_shop_players_shop_active ON shop_players (shop_id, joined_at DESC) WHERE left_at IS NULL;
|
||||
|
||||
-- [新增] 唯一索引:确保一个打手同一时间只能有一个主店铺
|
||||
-- 唯一索引:确保一个打手同一时间只能有一个主店铺
|
||||
CREATE UNIQUE INDEX idx_shop_players_one_primary
|
||||
ON shop_players (player_id) WHERE is_primary = TRUE AND left_at IS NULL;
|
||||
|
||||
@@ -38,6 +38,7 @@ CREATE TRIGGER trigger_sync_verifications
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION sync_user_verification_status();
|
||||
|
||||
|
||||
-- | 字段名 | 类型 | 技术含义 | 业务目的与设计思考 |
|
||||
-- | :--- | :--- | :--- | :--- |
|
||||
-- | **`id`** | BIGINT | **主键 (Primary Key)** | **这张认证申请单的唯一编号**。<br>后端代码在处理“审核通过”这个动作时,操作的是这个 ID(例如:`Approve(verificationId)`)。 |
|
||||
|
||||
@@ -21,9 +21,8 @@ CREATE TABLE users
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
deleted_at TIMESTAMPTZ,
|
||||
|
||||
CONSTRAINT chk_current_role CHECK (current_role IN ('consumer', 'player', 'owner', 'admin'))
|
||||
CONSTRAINT chk_current_role CHECK ("current_role" IN ('consumer', 'player', 'owner', 'admin'))
|
||||
);
|
||||
|
||||
-- 索引
|
||||
CREATE INDEX idx_users_phone ON users (phone) WHERE deleted_at IS NULL;
|
||||
CREATE INDEX idx_users_username_trgm ON users USING gin (username gin_trgm_ops) WHERE deleted_at IS NULL;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
CREATE TABLE wallets
|
||||
(
|
||||
user_id BIGINT PRIMARY KEY,
|
||||
balance DECIMAL(12, 2) NOT NULL DEFAULT 0.00,
|
||||
frozen_balance DECIMAL(12, 2) NOT NULL DEFAULT 0.00,
|
||||
balance DECIMAL(12, 2) NOT NULL DEFAULT 0.00, -- 可用余额
|
||||
frozen_balance DECIMAL(12, 2) NOT NULL DEFAULT 0.00, -- 冻结余额
|
||||
version INT NOT NULL DEFAULT 1, -- 必须使用乐观锁
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
|
||||
Reference in New Issue
Block a user