186 lines
4.7 KiB
JavaScript
186 lines
4.7 KiB
JavaScript
/**
|
|
* @swagger
|
|
* tags:
|
|
* name: 用户管理
|
|
* description: 用户管理相关接口
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /users:
|
|
* get:
|
|
* summary: 获取代理下级用户列表
|
|
* tags: [用户管理]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* parameters:
|
|
* - in: query
|
|
* name: page
|
|
* schema:
|
|
* type: integer
|
|
* default: 1
|
|
* description: 页码
|
|
* - in: query
|
|
* name: limit
|
|
* schema:
|
|
* type: integer
|
|
* default: 10
|
|
* description: 每页数量
|
|
* - in: query
|
|
* name: search
|
|
* schema:
|
|
* type: string
|
|
* description: 搜索关键词(用户名、手机号、邮箱)
|
|
* - in: query
|
|
* name: role
|
|
* schema:
|
|
* type: string
|
|
* description: 用户角色筛选
|
|
* - in: query
|
|
* name: city
|
|
* schema:
|
|
* type: string
|
|
* description: 城市筛选
|
|
* - in: query
|
|
* name: area
|
|
* schema:
|
|
* type: string
|
|
* description: 区域筛选
|
|
* - in: query
|
|
* name: sort_by
|
|
* schema:
|
|
* type: string
|
|
* default: created_at
|
|
* description: 排序字段
|
|
* - in: query
|
|
* name: sort_order
|
|
* schema:
|
|
* type: string
|
|
* enum: [asc, desc]
|
|
* default: desc
|
|
* description: 排序方向
|
|
* responses:
|
|
* 200:
|
|
* description: 获取成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: true
|
|
* data:
|
|
* type: object
|
|
* properties:
|
|
* users:
|
|
* type: array
|
|
* items:
|
|
* $ref: '#/components/schemas/User'
|
|
* total:
|
|
* type: integer
|
|
* description: 总记录数
|
|
* page:
|
|
* type: integer
|
|
* description: 当前页码
|
|
* limit:
|
|
* type: integer
|
|
* description: 每页数量
|
|
* totalPages:
|
|
* type: integer
|
|
* description: 总页数
|
|
* 401:
|
|
* description: 未授权
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /users/{id}:
|
|
* get:
|
|
* summary: 获取用户详情
|
|
* tags: [用户管理]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* parameters:
|
|
* - in: path
|
|
* name: id
|
|
* required: true
|
|
* schema:
|
|
* type: integer
|
|
* description: 用户ID
|
|
* responses:
|
|
* 200:
|
|
* description: 获取成功
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* success:
|
|
* type: boolean
|
|
* example: true
|
|
* data:
|
|
* $ref: '#/components/schemas/User'
|
|
* 401:
|
|
* description: 未授权
|
|
* 404:
|
|
* description: 用户不存在
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/
|
|
|
|
/**
|
|
* @swagger
|
|
* /users/export/data:
|
|
* get:
|
|
* summary: 导出用户数据
|
|
* tags: [用户管理]
|
|
* security:
|
|
* - bearerAuth: []
|
|
* parameters:
|
|
* - in: query
|
|
* name: format
|
|
* schema:
|
|
* type: string
|
|
* enum: [excel, csv]
|
|
* default: excel
|
|
* description: 导出格式
|
|
* - in: query
|
|
* name: search
|
|
* schema:
|
|
* type: string
|
|
* description: 搜索关键词(用户名、手机号、邮箱)
|
|
* - in: query
|
|
* name: role
|
|
* schema:
|
|
* type: string
|
|
* description: 用户角色筛选
|
|
* - in: query
|
|
* name: city
|
|
* schema:
|
|
* type: string
|
|
* description: 城市筛选
|
|
* - in: query
|
|
* name: area
|
|
* schema:
|
|
* type: string
|
|
* description: 区域筛选
|
|
* responses:
|
|
* 200:
|
|
* description: 导出成功
|
|
* content:
|
|
* application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
|
|
* schema:
|
|
* type: string
|
|
* format: binary
|
|
* text/csv:
|
|
* schema:
|
|
* type: string
|
|
* format: binary
|
|
* 401:
|
|
* description: 未授权
|
|
* 500:
|
|
* description: 服务器错误
|
|
*/ |