Files
backend-go/docs/swagger.yaml
T
2026-05-28 10:05:59 +08:00

1951 lines
48 KiB
YAML

basePath: /api
definitions:
models.AdminResetPasswordDTO:
properties:
newPassword:
minLength: 6
type: string
required:
- newPassword
type: object
models.BaseResponse:
properties:
message:
type: string
type: object
models.ChangePasswordDTO:
properties:
currentPassword:
type: string
newPassword:
minLength: 6
type: string
required:
- currentPassword
- newPassword
type: object
models.Company:
properties:
companyName:
type: string
createdAt:
type: string
id:
type: integer
isActive:
type: boolean
updatedAt:
type: string
type: object
models.CompanyDataRequest:
properties:
companyName:
type: string
required:
- companyName
type: object
models.CompanyResponse:
properties:
company:
$ref: '#/definitions/models.Company'
message:
type: string
type: object
models.CompanyUpdateRequest:
properties:
companyName:
type: string
isActive:
type: boolean
type: object
models.CreateAftersalesOrderDTO:
properties:
companyAddress:
type: string
companyName:
type: string
contactName:
type: string
contactPhone:
type: string
issueDescription:
type: string
serviceType:
enum:
- software
- hardware
- maintenance
type: string
technicianId:
type: integer
required:
- companyAddress
- companyName
- contactName
- contactPhone
- issueDescription
- serviceType
type: object
models.CreateUserDTO:
properties:
email:
type: string
employeeNo:
type: string
name:
type: string
password:
type: string
phone:
type: string
position:
type: string
role:
enum:
- admin
- technician
- employee
type: string
username:
type: string
required:
- employeeNo
- name
- phone
- position
- role
type: object
models.CustomerConfirmDTO:
properties:
action:
enum:
- authorize
- reject
type: string
rejectReason:
type: string
signature:
type: string
required:
- action
type: object
models.DataResponse:
properties:
data: {}
message:
type: string
type: object
models.EmployeeSerial:
properties:
company:
$ref: '#/definitions/models.Company'
companyName:
type: string
createdAt:
type: string
createdBy:
type: integer
employee:
$ref: '#/definitions/models.User'
employeeId:
type: integer
employeeName:
type: string
id:
type: integer
isActive:
type: boolean
position:
type: string
serialNumber:
type: string
updatedAt:
type: string
user:
$ref: '#/definitions/models.User'
type: object
models.ErrorResponse:
properties:
error:
type: string
message:
type: string
type: object
models.GenerateEmployeeSerialDTO:
properties:
companyName:
type: string
employeeName:
type: string
position:
type: string
quantity:
maximum: 1000
minimum: 1
type: integer
serialPrefix:
type: string
required:
- companyName
- employeeName
- position
type: object
models.GenerateSerialDTO:
properties:
companyName:
type: string
quantity:
maximum: 1000
minimum: 1
type: integer
validDays:
maximum: 3650
minimum: 1
type: integer
required:
- companyName
type: object
models.GenerateWithPrefixDTO:
properties:
companyName:
type: string
quantity:
maximum: 1000
minimum: 1
type: integer
serialPrefix:
type: string
validDays:
maximum: 3650
minimum: 1
type: integer
required:
- companyName
type: object
models.LoginDTO:
properties:
password:
minLength: 6
type: string
username:
type: string
required:
- password
- username
type: object
models.LoginResponse:
properties:
accessToken:
type: string
message:
type: string
user:
$ref: '#/definitions/models.UserDTO'
type: object
models.Pagination:
properties:
limit:
type: integer
page:
type: integer
total:
type: integer
totalPages:
type: integer
type: object
models.PaginationResponse:
properties:
data: {}
message:
type: string
pagination:
$ref: '#/definitions/models.Pagination'
type: object
models.QRCodeDTO:
properties:
baseUrl:
type: string
type: object
models.QRCodeResponse:
properties:
message:
type: string
qrCodeData:
type: string
queryUrl:
type: string
type: object
models.ReassignAftersalesDTO:
properties:
technicianId:
type: integer
required:
- technicianId
type: object
models.SubmitForConfirmationDTO:
properties:
resolutionNote:
type: string
required:
- resolutionNote
type: object
models.UpdateAftersalesOrderDTO:
properties:
companyAddress:
type: string
contactName:
type: string
contactPhone:
type: string
issueDescription:
type: string
resolutionNote:
type: string
serviceType:
enum:
- software
- hardware
- maintenance
type: string
technicianId:
type: integer
type: object
models.UpdateEmployeeSerialDTO:
properties:
companyName:
type: string
employeeName:
type: string
isActive:
type: boolean
position:
type: string
type: object
models.UpdateProfileDTO:
properties:
email:
type: string
name:
type: string
required:
- email
- name
type: object
models.UpdateSerialDTO:
properties:
companyName:
type: string
isActive:
type: boolean
validUntil:
type: string
type: object
models.UpdateUserDTO:
properties:
email:
type: string
employeeNo:
type: string
name:
type: string
phone:
type: string
position:
type: string
role:
enum:
- admin
- technician
- employee
type: string
type: object
models.User:
properties:
createdAt:
type: string
email:
type: string
employeeNo:
type: string
employeeSerials:
items:
$ref: '#/definitions/models.EmployeeSerial'
type: array
id:
type: integer
name:
type: string
phone:
type: string
position:
type: string
role:
type: string
updatedAt:
type: string
username:
type: string
type: object
models.UserDTO:
properties:
createdAt:
type: string
email:
type: string
employeeNo:
type: string
employeeSerials:
items:
$ref: '#/definitions/models.EmployeeSerial'
type: array
id:
type: integer
name:
type: string
phone:
type: string
position:
type: string
role:
type: string
username:
type: string
type: object
host: localhost:8080
info:
contact:
email: support@swagger.io
name: API Support
url: http://www.swagger.io/support
description: 防伪溯源系统 API 文档
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: Trace System API
version: "1.0"
paths:
/aftersales:
get:
description: 支持分页、搜索、按状态/服务类型/技术员筛选
parameters:
- description: 页码
in: query
name: page
type: integer
- description: 每页数量
in: query
name: limit
type: integer
- description: 搜索关键词
in: query
name: search
type: string
- description: 工单状态
in: query
name: workOrderStatus
type: string
- description: 服务类型
in: query
name: serviceType
type: string
- description: 技术员 ID
in: query
name: technicianId
type: integer
- description: 仅查看自己负责的工单
in: query
name: mine
type: boolean
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.PaginationResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取售后工单列表
tags:
- 售后工单
post:
consumes:
- application/json
description: 创建一个新的售后工单并分配编号
parameters:
- description: 工单数据
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.CreateAftersalesOrderDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 创建售后工单
tags:
- 售后工单
/aftersales/{serialNumber}:
delete:
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 删除售后工单
tags:
- 售后工单
get:
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取售后工单详情
tags:
- 售后工单
patch:
consumes:
- application/json
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
- description: 更新数据
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.UpdateAftersalesOrderDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 更新售后工单
tags:
- 售后工单
/aftersales/{serialNumber}/confirm:
post:
consumes:
- application/json
description: 客户输入手机号后四位后选择已授权或未授权
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
- description: 确认数据
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.CustomerConfirmDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"429":
description: Too Many Requests
schema:
$ref: '#/definitions/models.ErrorResponse'
summary: 客户授权确认
tags:
- 售后工单查询
/aftersales/{serialNumber}/force-close:
post:
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 强制关闭工单
tags:
- 售后工单
/aftersales/{serialNumber}/qrcode:
post:
consumes:
- application/json
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
- description: 二维码参数
in: body
name: data
schema:
$ref: '#/definitions/models.QRCodeDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.QRCodeResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 生成售后工单二维码
tags:
- 售后工单
/aftersales/{serialNumber}/query:
get:
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
summary: 公开查询售后工单
tags:
- 售后工单查询
/aftersales/{serialNumber}/reassign:
post:
consumes:
- application/json
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
- description: 新技术员 ID
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.ReassignAftersalesDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 重新分配技术员
tags:
- 售后工单
/aftersales/{serialNumber}/submit:
post:
consumes:
- application/json
description: 技术员填写处理结果后提交,工单进入"待客户确认"状态
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
- description: 处理结果
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.SubmitForConfirmationDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 提交客户确认
tags:
- 售后工单
/auth/change-password:
post:
consumes:
- application/json
description: 修改当前登录用户的密码
parameters:
- description: 密码修改数据
in: body
name: passwordData
required: true
schema:
$ref: '#/definitions/models.ChangePasswordDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 修改密码
tags:
- 认证
/auth/login:
post:
consumes:
- application/json
description: 验证用户身份并返回 JWT 令牌
parameters:
- description: 登录数据
in: body
name: loginData
required: true
schema:
$ref: '#/definitions/models.LoginDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.LoginResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
summary: 用户登录
tags:
- 认证
/auth/logout:
post:
description: 用户登出(JWT 无状态,前端清理令牌即可)
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 用户登出
tags:
- 认证
/auth/profile:
get:
description: 获取当前登录用户的个人信息
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取用户信息
tags:
- 认证
put:
consumes:
- application/json
description: 更新当前登录用户的个人信息
parameters:
- description: 用户信息更新数据
in: body
name: profileData
required: true
schema:
$ref: '#/definitions/models.UpdateProfileDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 更新用户信息
tags:
- 认证
/companies:
get:
description: 获取企业列表,支持分页和搜索
parameters:
- description: 页码
in: query
name: page
type: integer
- description: 每页数量
in: query
name: limit
type: integer
- description: 搜索关键词
in: query
name: search
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.PaginationResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取企业列表
tags:
- 企业管理
post:
consumes:
- application/json
description: 创建新的企业
parameters:
- description: 企业数据
in: body
name: companyData
required: true
schema:
$ref: '#/definitions/models.CompanyDataRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/models.CompanyResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"409":
description: Conflict
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 创建企业
tags:
- 企业管理
/companies/{companyName}:
delete:
description: 删除企业及其关联序列号
parameters:
- description: 企业名称
in: path
name: companyName
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 删除企业
tags:
- 企业管理
get:
description: 获取指定企业详情(含序列号分页)
parameters:
- description: 企业名称
in: path
name: companyName
required: true
type: string
- description: 页码
in: query
name: page
type: integer
- description: 每页数量
in: query
name: limit
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取企业详情
tags:
- 企业管理
put:
consumes:
- application/json
description: 更新企业信息
parameters:
- description: 企业名称
in: path
name: companyName
required: true
type: string
- description: 企业数据
in: body
name: companyData
required: true
schema:
$ref: '#/definitions/models.CompanyUpdateRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.CompanyResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"409":
description: Conflict
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 更新企业信息
tags:
- 企业管理
/companies/{companyName}/revoke:
post:
description: 吊销企业及其关联序列号
parameters:
- description: 企业名称
in: path
name: companyName
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 吊销企业
tags:
- 企业管理
/companies/{companyName}/serials/{serialNumber}:
delete:
description: 删除指定企业下的序列号
parameters:
- description: 企业名称
in: path
name: companyName
required: true
type: string
- description: 序列号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 删除企业序列号
tags:
- 企业管理
/companies/stats/overview:
get:
description: 获取企业、序列号统计数据
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取企业统计概览
tags:
- 企业管理
/employee-serials:
get:
description: 获取员工序列号列表,支持分页和搜索
parameters:
- description: 页码
in: query
name: page
type: integer
- description: 每页数量
in: query
name: limit
type: integer
- description: 搜索关键词
in: query
name: search
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.PaginationResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取员工序列号列表
tags:
- 员工赋码管理
/employee-serials/{serialNumber}:
delete:
description: 删除指定员工序列号(物理删除)
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 删除员工序列号
tags:
- 员工赋码管理
put:
consumes:
- application/json
description: 更新指定员工序列号的信息
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
- description: 更新数据
in: body
name: updateData
required: true
schema:
$ref: '#/definitions/models.UpdateEmployeeSerialDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 更新员工序列号信息
tags:
- 员工赋码管理
/employee-serials/{serialNumber}/qrcode:
post:
consumes:
- application/json
description: 为指定员工序列号生成查询二维码
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
- description: 二维码数据
in: body
name: qrCodeData
schema:
$ref: '#/definitions/models.QRCodeDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.QRCodeResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 生成员工二维码
tags:
- 员工赋码管理
/employee-serials/{serialNumber}/query:
get:
description: 查询指定员工序列号的详细信息
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
summary: 查询员工序列号信息
tags:
- 员工赋码查询
/employee-serials/{serialNumber}/revoke:
post:
description: 吊销指定员工序列号
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 吊销员工序列号
tags:
- 员工赋码管理
/employee-serials/generate:
post:
consumes:
- application/json
description: 生成指定数量的员工序列号(无有效期)
parameters:
- description: 生成数据
in: body
name: generateData
required: true
schema:
$ref: '#/definitions/models.GenerateEmployeeSerialDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 生成员工序列号
tags:
- 员工赋码管理
/employees:
get:
parameters:
- description: 页码
in: query
name: page
type: integer
- description: 每页数量
in: query
name: limit
type: integer
- description: 角色筛选
in: query
name: role
type: string
- description: 搜索
in: query
name: search
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.PaginationResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 员工列表
tags:
- 员工管理
post:
consumes:
- application/json
parameters:
- description: 员工数据
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.CreateUserDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 创建员工
tags:
- 员工管理
/employees/{id}:
delete:
parameters:
- description: 用户 ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 删除员工
tags:
- 员工管理
patch:
consumes:
- application/json
parameters:
- description: 用户 ID
in: path
name: id
required: true
type: integer
- description: 更新数据
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.UpdateUserDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 更新员工
tags:
- 员工管理
/employees/{id}/reset-password:
post:
consumes:
- application/json
parameters:
- description: 用户 ID
in: path
name: id
required: true
type: integer
- description: 新密码
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.AdminResetPasswordDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 重置密码
tags:
- 员工管理
/serials:
get:
description: 获取序列号列表,支持分页和搜索
parameters:
- description: 页码
in: query
name: page
type: integer
- description: ' '
in: query
name: limit
type: integer
- description: 搜索关键词
in: query
name: search
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.PaginationResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取序列号列表
tags:
- 序列号管理
/serials/{serialNumber}:
put:
consumes:
- application/json
description: 更新指定序列号的信息
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
- description: 更新数据
in: body
name: updateData
required: true
schema:
$ref: '#/definitions/models.UpdateSerialDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 更新序列号信息
tags:
- 序列号管理
/serials/{serialNumber}/qrcode:
post:
consumes:
- application/json
description: 为指定序列号生成查询二维码
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
- description: 二维码数据
in: body
name: qrCodeData
schema:
$ref: '#/definitions/models.QRCodeDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.QRCodeResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 生成二维码
tags:
- 序列号管理
/serials/{serialNumber}/query:
get:
description: 查询指定序列号的详细信息
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
summary: 查询序列号信息
tags:
- 序列号查询
/serials/{serialNumber}/revoke:
post:
description: 吊销指定序列号
parameters:
- description: 序列号
in: path
name: serialNumber
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.BaseResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 吊销序列号
tags:
- 序列号管理
/serials/generate:
post:
consumes:
- application/json
description: 生成指定数量的序列号
parameters:
- description: 生成数据
in: body
name: generateData
required: true
schema:
$ref: '#/definitions/models.GenerateSerialDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 生成序列号
tags:
- 序列号管理
/serials/generate-with-prefix:
post:
consumes:
- application/json
description: 生成带有指定前缀的序列号
parameters:
- description: 生成数据
in: body
name: generateData
required: true
schema:
$ref: '#/definitions/models.GenerateWithPrefixDTO'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/models.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 带前缀生成序列号
tags:
- 序列号管理
/users/assignable:
get:
description: 用于售后工单分配选择技术员/管理员,无需分页
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.DataResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/models.ErrorResponse'
security:
- BearerAuth: []
summary: 获取可分配用户列表
tags:
- 用户管理
securityDefinitions:
BearerAuth:
description: Bearer token 认证
in: header
name: Authorization
type: apiKey
swagger: "2.0"