{ "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" }