Files
juwan-backend/desc/api/docs/game-api.json
T

213 lines
5.0 KiB
JSON

{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"version": "1.0"
},
"basePath": "/",
"paths": {
"/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
}
],
"responses": {
"200": {
"description": "",
"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"
}
}
}
}
}
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"summary": "创建游戏",
"operationId": "gameCreateGame",
"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"
}
}
}
}
],
"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-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"
}