Files
backend-go/docs/swagger.yaml
T
2026-06-05 18:00:14 +08:00

1850 lines
45 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.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.CreateProjectOrderDTO:
properties:
companyAddress:
type: string
companyName:
type: string
contactName:
type: string
contactPhone:
type: string
projectType:
enum:
- survey
- implementation
- maintenance
- other
type: string
siteDescription:
type: string
technicianId:
type: integer
required:
- companyAddress
- companyName
- contactName
- contactPhone
- projectType
- siteDescription
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
responsibleSignature:
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.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.ProjectEngineerCompleteDTO:
properties:
completionNote:
type: string
engineerSignature:
type: string
required:
- engineerSignature
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.ReassignProjectOrderDTO:
properties:
technicianId:
type: integer
required:
- technicianId
type: object
models.SubmitForConfirmationDTO:
properties:
resolutionNote:
type: string
required:
- resolutionNote
type: object
models.SubmitProjectCompletionDTO:
properties:
completionNote:
type: string
required:
- completionNote
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.UpdateProjectOrderDTO:
properties:
companyAddress:
type: string
completionNote:
type: string
contactName:
type: string
contactPhone:
type: string
projectType:
enum:
- survey
- implementation
- maintenance
- other
type: string
siteDescription:
type: string
technicianId:
type: integer
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}/site-images:
post:
consumes:
- multipart/form-data
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
- description: 现场图片
in: formData
name: files
required: true
type: file
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'
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:
- 认证
/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:
- 员工管理
/project-orders:
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.CreateProjectOrderDTO'
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:
- 项目工单
/project-orders/{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.UpdateProjectOrderDTO'
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:
- 项目工单
/project-orders/{serialNumber}/complete:
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.ProjectEngineerCompleteDTO'
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:
- 项目工单查询
/project-orders/{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:
- 项目工单
/project-orders/{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:
- 项目工单
/project-orders/{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:
- 项目工单查询
/project-orders/{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.ReassignProjectOrderDTO'
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:
- 项目工单
/project-orders/{serialNumber}/site-images:
post:
consumes:
- multipart/form-data
parameters:
- description: 工单号
in: path
name: serialNumber
required: true
type: string
- description: 现场图片
in: formData
name: files
required: true
type: file
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'
summary: 上传项目现场图片
tags:
- 项目工单查询
/project-orders/{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.SubmitProjectCompletionDTO'
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:
- 项目工单
/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"