123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- {
- "swagger": "2.0",
- "info": {
- "contact": {},
- "license": {}
- },
- "paths": {
- "/api/v1/demos/": {
- "post": {
- "tags": [
- "API-Demo"
- ],
- "summary": "创建数据",
- "parameters": [
- {
- "description": "提交的数据",
- "name": "body",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/schema.Demo"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "schema": {
- "$ref": "#/definitions/schema.Demo"
- }
- },
- "400": {
- "description": "{error:{code:0,message:无效的请求参数}}",
- "schema": {
- "$ref": "#/definitions/schema.HTTPError"
- }
- },
- "401": {
- "description": "{error:{code:0,message:未授权}}",
- "schema": {
- "$ref": "#/definitions/schema.HTTPError"
- }
- },
- "500": {
- "description": "{error:{code:0,message:服务器错误}}",
- "schema": {
- "$ref": "#/definitions/schema.HTTPError"
- }
- }
- }
- }
- }
- },
- "definitions": {
- "schema.Demo": {
- "type": "object",
- "properties": {
- "code": {
- "description": "编号",
- "type": "string"
- },
- "created_at": {
- "description": "创建时间",
- "type": "string"
- },
- "creator": {
- "description": "创建者",
- "type": "string"
- },
- "memo": {
- "description": "备注",
- "type": "string"
- },
- "name": {
- "description": "名称",
- "type": "string"
- },
- "record_id": {
- "description": "记录ID",
- "type": "string"
- },
- "status": {
- "description": "状态(1:启用 2:停用)",
- "type": "integer"
- }
- }
- },
- "schema.HTTPError": {
- "type": "object",
- "properties": {
- "error": {
- "description": "错误项",
- "type": "object",
- "$ref": "#/definitions/schema.HTTPErrorItem"
- }
- }
- },
- "schema.HTTPErrorItem": {
- "type": "object",
- "properties": {
- "code": {
- "description": "错误码",
- "type": "integer"
- },
- "message": {
- "description": "错误信息",
- "type": "string"
- },
- "trace_id": {
- "description": "追踪Id,用于快速定位错误",
- "type": "string"
- }
- }
- }
- }
- }
|