potato/docs/swagger.yaml

212 lines
4.7 KiB
YAML
Raw Normal View History

2019-08-11 15:41:32 +08:00
basePath: /api
2021-03-24 11:29:15 +08:00
definitions:
2021-06-10 19:03:15 +08:00
errcode.Error:
2021-03-24 11:29:15 +08:00
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:
2021-03-24 11:29:15 +08:00
type: string
type: object
v1.AuthRequest:
properties:
password:
type: string
username:
type: string
required:
2021-04-06 18:19:45 +08:00
- password
2021-03-24 11:29:15 +08:00
- username
type: object
v1.RegisterRequest:
properties:
nickname:
type: string
password:
type: string
username:
type: string
required:
2021-04-06 18:19:45 +08:00
- password
2021-03-24 11:29:15 +08:00
- username
type: object
2019-08-07 20:56:20 +08:00
info:
contact: {}
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
version: "1.0"
2019-08-11 15:41:32 +08:00
paths:
2019-08-12 21:05:20 +08:00
/v1/auth:
2021-03-24 11:29:15 +08:00
post:
2019-08-12 21:05:20 +08:00
consumes:
- application/json
parameters:
2021-03-24 11:29:15 +08:00
- description: 用户名,密码
in: body
name: data
2019-08-12 21:05:20 +08:00
required: true
2021-03-24 11:29:15 +08:00
schema:
$ref: '#/definitions/v1.AuthRequest'
2019-08-12 21:05:20 +08:00
produces:
- application/json
responses:
"200":
description: '{"code" : 200, "data" : {"token" : ""}, "msg" : "ok"}'
schema:
type: string
summary: 用户验证
2021-03-24 11:29:15 +08:00
/v1/register:
2019-08-11 15:41:32 +08:00
post:
consumes:
- application/json
parameters:
2021-03-24 11:29:15 +08:00
- description: 用户名
in: body
name: data
2021-03-23 00:55:26 +08:00
required: true
2021-03-24 11:29:15 +08:00
schema:
$ref: '#/definitions/v1.RegisterRequest'
2019-08-11 15:41:32 +08:00
produces:
- application/json
responses:
"200":
2021-03-24 11:29:15 +08:00
description: '{"success":true,"data":{},"msg":"创建成功"}'
2019-08-11 15:41:32 +08:00
schema:
type: string
2021-03-24 11:29:15 +08:00
summary: 注册用户
/v1/vendors:
2019-08-11 15:41:32 +08:00
get:
consumes:
- application/json
2021-03-23 00:55:26 +08:00
parameters:
- description: auth by /auth
in: header
name: Authorization
required: true
type: string
2021-06-10 19:03:15 +08:00
- description: 名称
2021-03-24 11:29:15 +08:00
in: query
2021-06-10 19:03:15 +08:00
maxLength: 100
2019-08-12 01:39:17 +08:00
name: name
type: string
2021-03-24 11:29:15 +08:00
- description: 页码
in: query
name: page
2019-08-12 01:39:17 +08:00
type: integer
2021-03-24 11:29:15 +08:00
- description: 每页数量
in: query
name: page_size
2019-08-11 15:41:32 +08:00
type: integer
produces:
- application/json
responses:
"200":
2021-06-10 19:03:15 +08:00
description: 请求成功
2019-08-11 15:41:32 +08:00
schema:
2021-06-10 19:03:15 +08:00
$ref: '#/definitions/errcode.Error'
"400":
description: 请求错误
schema:
$ref: '#/definitions/errcode.Error'
"500":
description: 内部错误
schema:
$ref: '#/definitions/errcode.Error'
2019-08-11 15:41:32 +08:00
summary: 系统厂商列表
tags:
- vendors
post:
consumes:
- multipart/form-data
parameters:
2021-03-23 00:55:26 +08:00
- description: auth by /auth
in: header
name: Authorization
required: true
type: string
2019-08-11 15:41:32 +08:00
produces:
- application/json
responses:
"200":
2021-06-10 19:03:15 +08:00
description: 请求成功
2019-08-11 15:41:32 +08:00
schema:
2021-06-10 19:03:15 +08:00
$ref: '#/definitions/errcode.Error'
"400":
description: 请求错误
schema:
$ref: '#/definitions/errcode.Error'
"500":
description: 内部错误
schema:
$ref: '#/definitions/errcode.Error'
2019-08-11 15:41:32 +08:00
summary: 新增系统厂商
tags:
- vendors
/v1/vendors/{id}:
delete:
consumes:
- application/json
parameters:
2021-03-23 00:55:26 +08:00
- description: auth by /auth
in: header
name: Authorization
required: true
type: string
2019-08-11 15:41:32 +08:00
- description: 系统厂商 ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
2021-06-10 19:03:15 +08:00
description: 请求成功
2019-08-11 15:41:32 +08:00
schema:
2021-06-10 19:03:15 +08:00
$ref: '#/definitions/errcode.Error'
"400":
description: 请求错误
schema:
$ref: '#/definitions/errcode.Error'
"500":
description: 内部错误
schema:
$ref: '#/definitions/errcode.Error'
2019-08-11 15:41:32 +08:00
summary: 删除系统厂商
tags:
- vendors
patch:
consumes:
- multipart/form-data
parameters:
2021-03-23 00:55:26 +08:00
- description: auth by /auth
in: header
name: Authorization
required: true
type: string
2019-08-11 15:41:32 +08:00
- description: 系统厂商 ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
2021-06-10 19:03:15 +08:00
description: 请求成功
2019-08-11 15:41:32 +08:00
schema:
2021-06-10 19:03:15 +08:00
$ref: '#/definitions/errcode.Error'
"400":
description: 请求错误
schema:
$ref: '#/definitions/errcode.Error'
"500":
description: 内部错误
schema:
$ref: '#/definitions/errcode.Error'
2019-08-11 15:41:32 +08:00
summary: 修改系统厂商
tags:
- vendors
2019-08-07 20:56:20 +08:00
swagger: "2.0"