potato/docs/swagger.json

332 lines
11 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "This is a potato use golang",
"title": "Potato Api",
"contact": {},
"version": "1.0"
},
"basePath": "/api",
"paths": {
"/auth": {
"post": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"summary": "鉴权验证",
"parameters": [
{
"type": "string",
"description": "app key",
"name": "app_key",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "app secret",
"name": "app_secret",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "请求成功",
"schema": {
"$ref": "#/definitions/errcode.Error"
}
}
}
}
},
"/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"
}
}
}
}
},
"/v1/vendors": {
"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": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页数量",
"name": "page_size",
"in": "query"
},
{
"maxLength": 100,
"type": "string",
"description": "系统厂商名称",
"name": "name",
"in": "query"
},
{
"type": "integer",
"description": "系统厂商云id",
"name": "uuid",
"in": "query"
}
],
"responses": {
"200": {
"description": "请求成功",
"schema": {
"$ref": "#/definitions/basic.Vendor"
}
}
}
},
"post": {
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"vendors"
],
"summary": "新增系统厂商",
"parameters": [
{
"type": "string",
"description": "auth by /auth",
"name": "token",
"in": "header",
"required": true
},
{
"maxLength": 100,
"minLength": 1,
"type": "string",
"description": "系统厂商名称",
"name": "name",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "系统厂商云id",
"name": "uuid",
"in": "formData"
}
],
"responses": {
"200": {
"description": "请求成功",
"schema": {
"$ref": "#/definitions/basic.Vendor"
}
}
}
}
},
"/v1/vendors/{id}": {
"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"
}
}
}
},
"delete": {
"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"
}
}
}
},
"patch": {
"consumes": [
"multipart/form-data"
],
"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
},
{
"maxLength": 100,
"minLength": 1,
"type": "string",
"description": "系统厂商名称",
"name": "name",
"in": "formData"
},
{
"type": "integer",
"description": "系统厂商云id",
"name": "uuid",
"in": "formData"
}
],
"responses": {
"200": {
"description": "请求成功",
"schema": {
"$ref": "#/definitions/basic.Vendor"
}
}
}
}
}
},
"definitions": {
"basic.Vendor": {
"type": "object"
},
"errcode.Error": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {
"type": "object"
},
"msg": {
"type": "string"
}
}
}
}
}