potato/docs/swagger.json

332 lines
11 KiB
JSON
Raw Normal View History

2019-08-07 20:56:20 +08:00
{
"swagger": "2.0",
"info": {
2021-06-10 19:03:15 +08:00
"description": "This is a potato use golang",
2019-08-07 20:56:20 +08:00
"title": "Potato Api",
"contact": {},
"version": "1.0"
},
2019-08-11 15:41:32 +08:00
"basePath": "/api",
"paths": {
2021-06-14 21:15:55 +08:00
"/auth": {
2021-03-24 11:29:15 +08:00
"post": {
2019-08-12 21:05:20 +08:00
"consumes": [
2021-06-10 22:41:58 +08:00
"multipart/form-data"
2019-08-12 21:05:20 +08:00
],
"produces": [
"application/json"
],
2021-06-11 01:24:00 +08:00
"summary": "鉴权验证",
2019-08-12 21:05:20 +08:00
"parameters": [
{
2021-06-11 01:24:00 +08:00
"type": "string",
"description": "app key",
"name": "app_key",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "app secret",
"name": "app_secret",
"in": "formData",
"required": true
2019-08-11 15:41:32 +08:00
}
],
"responses": {
"200": {
2021-06-10 22:41:58 +08:00
"description": "请求成功",
2019-08-11 15:41:32 +08:00
"schema": {
2021-06-10 22:41:58 +08:00
"$ref": "#/definitions/errcode.Error"
2021-06-11 18:04:58 +08:00
}
}
}
}
},
"/v1/upload": {
"post": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"summary": "上传文件",
"parameters": [
{
"type": "string",
"description": "auth by /auth",
"name": "token",
"in": "header",
"required": true
},
{
"type": "file",
"description": "文件",
"name": "file",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "文件类型",
"name": "type",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "请求成功",
"schema": {
"$ref": "#/definitions/errcode.Error"
2019-08-11 15:41:32 +08:00
}
}
}
}
},
2021-03-24 11:29:15 +08:00
"/v1/vendors": {
2019-08-11 15:41:32 +08:00
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
2021-03-24 11:29:15 +08:00
"vendors"
2019-08-12 01:39:17 +08:00
],
2021-03-24 11:29:15 +08:00
"summary": "系统厂商列表",
2019-08-12 01:39:17 +08:00
"parameters": [
2021-03-23 00:55:26 +08:00
{
"type": "string",
"description": "auth by /auth",
2021-06-10 22:41:58 +08:00
"name": "token",
2021-03-23 00:55:26 +08:00
"in": "header",
"required": true
},
2019-08-12 01:39:17 +08:00
{
"type": "integer",
2021-03-24 11:29:15 +08:00
"description": "页码",
"name": "page",
"in": "query"
2021-03-23 00:55:26 +08:00
},
2019-08-11 15:41:32 +08:00
{
"type": "integer",
2021-03-24 11:29:15 +08:00
"description": "每页数量",
"name": "page_size",
"in": "query"
2021-06-11 01:24:00 +08:00
},
{
"maxLength": 100,
"type": "string",
"description": "系统厂商名称",
"name": "name",
"in": "query"
},
{
"type": "integer",
"description": "系统厂商云id",
"name": "uuid",
"in": "query"
2019-08-11 15:41:32 +08:00
}
],
"responses": {
"200": {
2021-06-10 19:03:15 +08:00
"description": "请求成功",
2019-08-11 15:41:32 +08:00
"schema": {
2021-06-10 22:41:58 +08:00
"$ref": "#/definitions/basic.Vendor"
2019-08-11 15:41:32 +08:00
}
}
}
},
"post": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"vendors"
],
"summary": "新增系统厂商",
"parameters": [
2021-03-23 00:55:26 +08:00
{
"type": "string",
"description": "auth by /auth",
2021-06-10 22:41:58 +08:00
"name": "token",
2021-03-23 00:55:26 +08:00
"in": "header",
"required": true
2021-06-10 22:41:58 +08:00
},
{
2021-06-11 01:24:00 +08:00
"maxLength": 100,
"minLength": 1,
"type": "string",
"description": "系统厂商名称",
"name": "name",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "系统厂商云id",
"name": "uuid",
"in": "formData"
2019-08-11 15:41:32 +08:00
}
],
"responses": {
"200": {
2021-06-10 19:03:15 +08:00
"description": "请求成功",
2019-08-11 15:41:32 +08:00
"schema": {
2021-06-10 22:41:58 +08:00
"$ref": "#/definitions/basic.Vendor"
2019-08-11 15:41:32 +08:00
}
}
}
}
},
"/v1/vendors/{id}": {
2021-06-11 01:24:00 +08:00
"get": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"vendors"
],
"summary": "系统厂商",
"parameters": [
{
"type": "string",
"description": "auth by /auth",
"name": "token",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "系统厂商 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "请求成功",
"schema": {
"$ref": "#/definitions/basic.Vendor"
}
}
}
},
2019-08-11 15:41:32 +08:00
"delete": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"vendors"
],
"summary": "删除系统厂商",
"parameters": [
2021-03-23 00:55:26 +08:00
{
"type": "string",
"description": "auth by /auth",
2021-06-10 22:41:58 +08:00
"name": "token",
2021-03-23 00:55:26 +08:00
"in": "header",
"required": true
},
2019-08-11 15:41:32 +08:00
{
"type": "integer",
"description": "系统厂商 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
2021-06-10 19:03:15 +08:00
"description": "请求成功",
2019-08-11 15:41:32 +08:00
"schema": {
2021-06-10 22:41:58 +08:00
"$ref": "#/definitions/basic.Vendor"
2019-08-11 15:41:32 +08:00
}
}
}
},
"patch": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"vendors"
],
"summary": "修改系统厂商",
"parameters": [
2021-03-23 00:55:26 +08:00
{
"type": "string",
"description": "auth by /auth",
2021-06-10 22:41:58 +08:00
"name": "token",
2021-03-23 00:55:26 +08:00
"in": "header",
"required": true
},
2019-08-11 15:41:32 +08:00
{
"type": "integer",
"description": "系统厂商 ID",
"name": "id",
"in": "path",
"required": true
2021-06-10 22:41:58 +08:00
},
{
2021-06-11 01:24:00 +08:00
"maxLength": 100,
"minLength": 1,
"type": "string",
"description": "系统厂商名称",
"name": "name",
"in": "formData"
},
{
"type": "integer",
"description": "系统厂商云id",
"name": "uuid",
"in": "formData"
2019-08-11 15:41:32 +08:00
}
],
"responses": {
"200": {
2021-06-10 19:03:15 +08:00
"description": "请求成功",
2019-08-11 15:41:32 +08:00
"schema": {
2021-06-10 22:41:58 +08:00
"$ref": "#/definitions/basic.Vendor"
2019-08-11 15:41:32 +08:00
}
}
}
}
}
2021-03-24 11:29:15 +08:00
},
"definitions": {
2021-06-10 22:41:58 +08:00
"basic.Vendor": {
"type": "object"
},
2021-06-10 19:03:15 +08:00
"errcode.Error": {
2021-03-24 11:29:15 +08:00
"type": "object",
"properties": {
2021-06-10 19:03:15 +08:00
"code": {
2021-03-24 11:29:15 +08:00
"type": "integer"
},
2021-06-10 19:03:15 +08:00
"data": {
"type": "object"
},
"msg": {
"type": "string"
2021-03-24 11:29:15 +08:00
}
}
}
2019-08-11 15:41:32 +08:00
}
2019-08-07 20:56:20 +08:00
}