potato/docs/swagger.yaml

183 lines
3.8 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 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
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
2021-06-10 22:41:58 +08:00
service.AuthRequest:
2021-03-24 11:29:15 +08:00
properties:
2021-06-10 22:41:58 +08:00
app_key:
2021-03-24 11:29:15 +08:00
type: string
2021-06-10 22:41:58 +08:00
app_secret:
2021-03-24 11:29:15 +08:00
type: string
required:
2021-06-10 22:41:58 +08:00
- app_key
- app_secret
2021-03-24 11:29:15 +08:00
type: object
2021-06-10 22:41:58 +08:00
service.CreateVendorRequest:
2021-03-24 11:29:15 +08:00
properties:
2021-06-10 22:41:58 +08:00
name:
2021-03-24 11:29:15 +08:00
type: string
2021-06-10 22:41:58 +08:00
uuid:
type: integer
required:
- name
type: object
service.UpdateVendorRequest:
properties:
id:
type: integer
name:
2021-03-24 11:29:15 +08:00
type: string
2021-06-10 22:41:58 +08:00
uuid:
type: integer
2021-03-24 11:29:15 +08:00
required:
2021-06-10 22:41:58 +08:00
- id
2021-03-24 11:29:15 +08:00
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:
2021-06-10 22:41:58 +08:00
- multipart/form-data
2019-08-12 21:05:20 +08:00
parameters:
2021-06-10 22:41:58 +08:00
- description: Vendor模型
2021-03-24 11:29:15 +08:00
in: body
name: data
2019-08-12 21:05:20 +08:00
required: true
2021-03-24 11:29:15 +08:00
schema:
2021-06-10 22:41:58 +08:00
$ref: '#/definitions/service.AuthRequest'
2019-08-12 21:05:20 +08:00
produces:
- application/json
responses:
"200":
2021-06-10 22:41:58 +08:00
description: 请求成功
2019-08-12 21:05:20 +08:00
schema:
2021-06-10 22:41:58 +08:00
$ref: '#/definitions/errcode.Error'
2019-08-12 21:05:20 +08:00
summary: 用户验证
2021-03-24 11:29:15 +08:00
/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
2021-06-10 22:41:58 +08:00
name: token
2021-03-23 00:55:26 +08:00
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 22:41:58 +08:00
$ref: '#/definitions/basic.Vendor'
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
2021-06-10 22:41:58 +08:00
name: token
2021-03-23 00:55:26 +08:00
required: true
type: string
2021-06-10 22:41:58 +08:00
- description: Vendor模型
in: body
name: data
required: true
schema:
$ref: '#/definitions/service.CreateVendorRequest'
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 22:41:58 +08:00
$ref: '#/definitions/basic.Vendor'
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
2021-06-10 22:41:58 +08:00
name: token
2021-03-23 00:55:26 +08:00
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 22:41:58 +08:00
$ref: '#/definitions/basic.Vendor'
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
2021-06-10 22:41:58 +08:00
name: token
2021-03-23 00:55:26 +08:00
required: true
type: string
2019-08-11 15:41:32 +08:00
- description: 系统厂商 ID
in: path
name: id
required: true
type: integer
2021-06-10 22:41:58 +08:00
- description: Vendor模型
in: body
name: data
required: true
schema:
$ref: '#/definitions/service.UpdateVendorRequest'
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 22:41:58 +08:00
$ref: '#/definitions/basic.Vendor'
2019-08-11 15:41:32 +08:00
summary: 修改系统厂商
tags:
- vendors
2019-08-07 20:56:20 +08:00
swagger: "2.0"