Example #1
0
from app.libs.swagger_filed import IntegerQueryFiled, StringQueryFiled, StringPathFiled, BodyField

uid = StringPathFiled(name='uid',
                      description="用户ID",
                      enum=[
                          '5e68447445b69c7b7790b2c5',
                          '5e68448a45b69c7b7790b2c6',
                          '5e68448a45b69c7b7791b2c6',
                          'xxxxxxxxxxxxxxxxxxxxxxxx'
                      ],
                      default='5e68447445b69c7b7790b2c5',
                      required=True)

auth = IntegerQueryFiled(name='auth',
                         description="权限级别 ",
                         enum=[1, 2, 10, 11, 12, 13, 14],
                         default=14,
                         required=True)

realname_in_body = BodyField('realname', 'string', '用户真名', ['董冬伟'])
username_in_body = BodyField('username', 'string', '用户名', ['Allen7D'])
password_in_body = BodyField('password', 'string', '密码(不输则默认: 123456)',
                             ['123456'])
mobile_in_body = BodyField('mobile', 'string', '手机号', ['13758787058'])
email_in_body = BodyField('email', 'string', '邮箱', ['*****@*****.**'])
auth_in_body = BodyField('auth', 'integer', '权限(数字: 1,2,10,11,12,13,14,19)',
                         [1, 2, 10, 11, 12, 13, 14, 19])

company_id_in_query = StringQueryFiled(
    name='company_id',
    description="公司ID",
Example #2
0
# -*- coding: utf-8 -*-
from app.libs.swagger_filed import IntegerQueryFiled

state_in_query = IntegerQueryFiled(name='state',
                                   description="激活码状态(0: 失效; 1:激活)",
                                   enum=[0, 1],
                                   default=0)
Example #3
0
# _*_ coding: utf-8 _*_
"""
  Created by Allen7D on 2018/12/4.
"""
from app.libs.swagger_filed import IntegerQueryFiled

__author__ = 'Allen7D'

count = IntegerQueryFiled(name='count',
                          description='商品数',
                          enum=[1, 2, 3, 4, 5, 10, 15],
                          default=1)
Example #4
0
# _*_ coding: utf-8 _*_
"""
  Created by Allen7D on 2020/02/27.
"""
from app.libs.swagger_filed import IntegerQueryFiled

__author__ = 'Allen7D'

get_category_list = {
	"parameters": [
		IntegerQueryFiled(name='index', description="第几页", enum=[1, 2, 3, 4, 5], default=1).data,
		IntegerQueryFiled(name='size', description="每页大小", enum=[10, 20, 30, 40, 50, 100], default=10).data,
	],
	"security": [
		{
			"basicAuth": []
		}
	],
	"responses": {
		"200": {
			"description": "产品分类(分页)",
			"examples": {}
		}
	}
}

update_category = {
	"parameters": [],
	"security": [
		{
			"basicAuth": []
Example #5
0
# _*_ coding: utf-8 _*_
"""
  Created by Allen7D on 2020/3/13.
"""
from app.libs.swagger_filed import IntegerQueryFiled, IntegerPathFiled

__author__ = 'Allen7D'

uid_in_path = IntegerPathFiled(
    name='uid', description="用户ID", enum=[1, 2, 3, 4, 5, 10, 100], default=1, required=True)
uid_in_query = IntegerQueryFiled(
    name='uid', description="用户ID", enum=[1, 2, 3, 4, 5, 10, 100], default=1, required=True)

product_id_in_path = IntegerPathFiled(
    name='id', description="商品 ID", enum=[1, 2, 3, 4, 5, 10, 15, 20], required=True)
product_id_in_query = IntegerQueryFiled(
    name='id', description="商品 ID", enum=[1, 2, 3, 4, 5, 10, 15, 20], required=True)

category_id_in_path = IntegerPathFiled(
    name='id', description="类别 ID", enum=[1, 2, 3, 4, 5, 10, 15, 20], required=True)
category_id_in_query = IntegerQueryFiled(
    name='id', description="类别 ID", enum=[1, 2, 3, 4, 5, 10, 15, 20], required=True)

theme_id_in_path = IntegerPathFiled(
    name='id', description="主题ID", enum=[1, 2, 3, 4, 5, 10, 15, 20], required=True)
theme_id_in_query = IntegerQueryFiled(
    name='id', description="主题ID", enum=[1, 2, 3, 4, 5, 10, 15, 20], required=True)

banner_id_in_path = IntegerPathFiled(
	name='id', description="轮播图ID", enum=[1, 2, 3, 4, 5, 10, 15, 20], required=True)
banner_id_in_query = IntegerQueryFiled(
Example #6
0
# _*_ coding: utf-8 _*_
"""

"""
from app.libs.swagger_filed import IntegerQueryFiled, IntegerPathFiled, StringPathFiled, StringQueryFiled, BodyField

__author__ = 'Allen7D'

page_in_query = IntegerQueryFiled(name='page', description="第几页", enum=[1, 2, 3, 4, 5], default=1)
size_in_query = IntegerQueryFiled(name='size', description="每页大小", enum=[10, 20, 30, 40, 50, 100], default=10)

# User
uid_in_path = StringPathFiled(name='uid',
                              description="用户ID",
                              enum=['5e68447445b69c7b7790b2c5',
                                    '5e68448a45b69c7b7790b2c6',
                                    '5e68448a45b69c7b7791b2c6',
                                    '5e705d50e3a1dff793a99b6d',
                                    'xxxxxxxxxxxxxxxxxxxxxxxx'
                                    ],
                              default='5e68447445b69c7b7790b2c5',
                              required=True)
realname_in_body = BodyField('realname', 'string', '用户真名', ['董冬伟'])
username_in_body = BodyField('username', 'string', '用户名', ['Allen7D'])
password_in_body = BodyField('password', 'string', '密码(不输则默认: 123456)', ['123456'])
mobile_in_body = BodyField('mobile', 'string', '手机号', ['13758787058'])
email_in_body = BodyField('email', 'string', '邮箱', ['*****@*****.**'])
auth_in_body = BodyField('auth', 'integer', '权限等级(数字: 1,2,10,11,12,13,14,20,999)', [1, 2, 10, 11, 12, 13, 14, 20, 999])

#  CDKey
cdkey_in_path = StringPathFiled(name='cdkey',
Example #7
0
                              '0017be56959511e8b3470016',
                              '001aa40c61c111e8a8a60016',
                              '001ea0984fa111e8a3d40016'
                          ],
                          default='5e68447445b69c7b7790b2c5',
                          required=True).data

user_id_in_path = user_id

user_id_in_body = BodyField(
    'uid', 'string', '用户ID',
    ['5e68447445b69c7b7790b2c5', '5e68448a45b69c7b7790b2c6'])

auth = IntegerQueryFiled(name='auth',
                         description="权限级别 ",
                         enum=[1, 2, 10, 11, 12, 13, 14],
                         default=14,
                         required=True).data

auth_in_query = auth

page = IntegerQueryFiled(name='page',
                         description="第几页",
                         enum=[1, 2, 3, 4, 5],
                         default=1).data
size = IntegerQueryFiled(name='size',
                         description="每页条数",
                         enum=[10, 20, 30, 40, 50, 100],
                         default=10).data
page_in_query = page
size_in_query = size