Files
server/docs/swagger.json
T
2026-01-16 15:49:34 +08:00

2113 lines
75 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"swagger": "2.0",
"info": {
"description": "这是一个基于 Goravel 框架的后台管理系统 API 文档",
"title": "Goravel Admin API",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"url": "http://www.swagger.io/support",
"email": "support@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0"
},
"host": "localhost:3000",
"basePath": "/api/admin",
"paths": {
"/api/admin/admins": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "分页获取管理员列表,支持按用户名、状态、角色、部门等条件筛选",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"管理员管理"
],
"summary": "获取管理员列表",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "每页数量",
"name": "page_size",
"in": "query"
},
{
"type": "string",
"description": "用户名(模糊搜索)",
"name": "username",
"in": "query"
},
{
"type": "string",
"description": "状态:1-启用,0-禁用",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "角色ID",
"name": "role_id",
"in": "query"
},
{
"type": "string",
"description": "部门ID",
"name": "department_id",
"in": "query"
},
{
"type": "string",
"description": "开始时间(格式:YYYY-MM-DD HH:mm:ss",
"name": "start_time",
"in": "query"
},
{
"type": "string",
"description": "结束时间(格式:YYYY-MM-DD HH:mm:ss",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"description": "排序(格式:字段:asc/desc,如:created_at:desc",
"name": "order_by",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.PaginatedAdminResponse"
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "创建新的管理员账号,支持设置部门、角色等信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"管理员管理"
],
"summary": "创建管理员",
"parameters": [
{
"example": "admin",
"description": "用户名(必填)",
"name": "username",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"example": "123456",
"description": "密码(必填)",
"name": "password",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"example": "管理员",
"description": "昵称",
"name": "nickname",
"in": "body",
"schema": {
"type": "string"
}
},
{
"example": "admin@example.com",
"description": "邮箱",
"name": "email",
"in": "body",
"schema": {
"type": "string"
}
},
{
"example": "13800138000",
"description": "手机号",
"name": "phone",
"in": "body",
"schema": {
"type": "string"
}
},
{
"example": 1,
"description": "部门ID",
"name": "department_id",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"example": 1,
"description": "状态:1-启用,0-禁用",
"name": "status",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "角色ID列表",
"name": "role_ids",
"in": "body",
"schema": {
"type": "array",
"items": {
"type": "integer"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.AdminDetailResponse"
}
},
"400": {
"description": "参数错误或用户名已存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/admins/export": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据筛选条件导出管理员列表为CSV文件,支持与列表查询相同的筛选条件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"管理员管理"
],
"summary": "导出管理员列表",
"parameters": [
{
"description": "导出筛选条件(可选)",
"name": "request",
"in": "body",
"schema": {
"$ref": "#/definitions/admin.AdminExportRequest"
}
}
],
"responses": {
"200": {
"description": "导出成功,返回文件下载信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/admins/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID获取管理员详细信息,包括部门、角色等关联信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"管理员管理"
],
"summary": "获取管理员详情",
"parameters": [
{
"type": "integer",
"description": "管理员ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.AdminDetailResponse"
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "管理员不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "更新管理员的基本信息,包括昵称、邮箱、手机号、部门、状态、角色等。受保护的管理员不能禁用。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"管理员管理"
],
"summary": "更新管理员信息",
"parameters": [
{
"type": "integer",
"example": 1,
"description": "管理员ID",
"name": "id",
"in": "path",
"required": true
},
{
"example": "管理员",
"description": "昵称",
"name": "nickname",
"in": "body",
"schema": {
"type": "string"
}
},
{
"example": "admin@example.com",
"description": "邮箱",
"name": "email",
"in": "body",
"schema": {
"type": "string"
}
},
{
"example": "13800138000",
"description": "手机号",
"name": "phone",
"in": "body",
"schema": {
"type": "string"
}
},
{
"example": 1,
"description": "部门ID",
"name": "department_id",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"example": "1",
"description": "状态:1-启用,0-禁用",
"name": "status",
"in": "body",
"schema": {
"type": "string"
}
},
{
"example": "123456",
"description": "密码(可选,不传则不更新)",
"name": "password",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "角色ID列表",
"name": "role_ids",
"in": "body",
"schema": {
"type": "array",
"items": {
"type": "integer"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/admin.AdminDetailResponse"
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限或受保护管理员不能禁用",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "管理员不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "删除指定的管理员账号。受保护的管理员和当前登录的管理员不能删除。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"管理员管理"
],
"summary": "删除管理员",
"parameters": [
{
"type": "integer",
"description": "管理员ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "删除成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限、受保护管理员不能删除或不能删除自己",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "管理员不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/admins/{id}/unbind-google-auth": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "管理员可以解绑其他管理员的谷歌验证码,需要当前管理员已绑定谷歌验证码并输入验证码确认",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"管理员管理"
],
"summary": "解绑管理员的谷歌验证码",
"parameters": [
{
"type": "integer",
"description": "要解绑的管理员ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "当前管理员的谷歌验证码",
"name": "code",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "解绑成功",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误或验证码错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限或当前管理员未绑定谷歌验证码",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "管理员不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/orders": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "分页获取订单列表,支持多条件筛选,查询时间范围不能超过3个月",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "获取订单列表",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "每页数量",
"name": "page_size",
"in": "query"
},
{
"type": "integer",
"description": "用户ID",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "订单号(模糊搜索)",
"name": "order_no",
"in": "query"
},
{
"type": "string",
"description": "订单状态(pending/paid/cancelled",
"name": "status",
"in": "query"
},
{
"type": "number",
"description": "最小金额",
"name": "min_amount",
"in": "query"
},
{
"type": "number",
"description": "最大金额",
"name": "max_amount",
"in": "query"
},
{
"type": "string",
"description": "开始时间(格式:2006-01-02 15:04:05",
"name": "start_time",
"in": "query"
},
{
"type": "string",
"description": "结束时间(格式:2006-01-02 15:04:05",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"description": "排序(格式:字段:asc/desc,如:created_at:desc",
"name": "order_by",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "创建新订单,自动防止重复提交",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "创建订单",
"parameters": [
{
"description": "用户ID",
"name": "user_id",
"in": "body",
"required": true,
"schema": {
"type": "integer"
}
},
{
"description": "订单金额",
"name": "amount",
"in": "body",
"required": true,
"schema": {
"type": "number"
}
},
{
"description": "商品列表",
"name": "products",
"in": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/admin.OrderProductItem"
}
}
},
{
"description": "请求ID(用于防重复提交,不传则自动生成)",
"name": "request_id",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误或重复提交",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/orders/export": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据筛选条件导出订单列表为CSV文件,支持与列表查询相同的筛选条件,查询时间范围不能超过3个月",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "导出订单列表",
"parameters": [
{
"type": "integer",
"description": "用户ID",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "订单号(模糊搜索)",
"name": "order_no",
"in": "query"
},
{
"type": "string",
"description": "订单状态(pending/paid/cancelled",
"name": "status",
"in": "query"
},
{
"type": "number",
"description": "最小金额",
"name": "min_amount",
"in": "query"
},
{
"type": "number",
"description": "最大金额",
"name": "max_amount",
"in": "query"
},
{
"type": "string",
"description": "开始时间(格式:2006-01-02 15:04:05",
"name": "start_time",
"in": "query"
},
{
"type": "string",
"description": "结束时间(格式:2006-01-02 15:04:05",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"description": "排序(格式:字段:asc/desc,如:created_at:desc",
"name": "order_by",
"in": "query"
}
],
"responses": {
"200": {
"description": "导出成功,返回文件下载信息",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/orders/export/status/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据导出记录ID查询导出任务的状态",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "查询导出状态",
"parameters": [
{
"type": "integer",
"description": "导出记录ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/orders/import": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "从CSV文件导入订单数据,支持批量导入",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "导入订单",
"parameters": [
{
"type": "file",
"description": "CSV文件",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "导入成功,返回导入结果",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "未登录",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "无权限",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/orders/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID或订单号获取订单详细信息,返回订单主表数据和订单详情表数据(支持分表查询)。优先使用订单号查询(更高效),如果没有订单号则使用订单ID查询",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "获取订单详情",
"parameters": [
{
"type": "integer",
"description": "订单ID(如果提供了订单号,此参数可选)",
"name": "id",
"in": "path"
},
{
"type": "string",
"description": "订单号(优先使用,可直接定位分表)",
"name": "order_no",
"in": "query"
}
],
"responses": {
"200": {
"description": "返回数据包含 order(订单主表)和 details(订单详情表数组)",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "订单不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "更新订单信息(主要是状态)。优先使用订单号查询(更高效),如果没有订单号则使用订单ID查询",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "更新订单",
"parameters": [
{
"type": "integer",
"description": "订单ID(如果提供了订单号,此参数可选)",
"name": "id",
"in": "path"
},
{
"type": "string",
"description": "订单号(优先使用,可直接定位分表)",
"name": "order_no",
"in": "query"
},
{
"description": "订单状态",
"name": "status",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "删除订单及其详情。优先使用订单号查询(更高效),如果没有订单号则使用订单ID查询",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"订单管理"
],
"summary": "删除订单",
"parameters": [
{
"type": "integer",
"description": "订单ID(如果提供了订单号,此参数可选)",
"name": "id",
"in": "path"
},
{
"type": "string",
"description": "订单号(优先使用,可直接定位分表)",
"name": "order_no",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/payment-methods": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "分页获取支付方式列表,支持多条件筛选",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"支付管理"
],
"summary": "获取支付方式列表",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "每页数量",
"name": "page_size",
"in": "query"
},
{
"type": "string",
"description": "支付方式名称(模糊搜索)",
"name": "name",
"in": "query"
},
{
"type": "string",
"description": "支付方式代码",
"name": "code",
"in": "query"
},
{
"type": "string",
"description": "支付类型",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "是否启用:1-启用,0-禁用",
"name": "is_active",
"in": "query"
},
{
"type": "string",
"description": "排序(格式:字段:asc/desc,如:created_at:desc",
"name": "order_by",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "创建新的支付方式",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"支付管理"
],
"summary": "创建支付方式",
"parameters": [
{
"description": "支付方式名称",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "支付方式代码",
"name": "code",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "支付类型",
"name": "type",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "支付配置(JSON对象)",
"name": "config",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{
"description": "是否启用",
"name": "is_active",
"in": "body",
"schema": {
"type": "boolean"
}
},
{
"description": "排序",
"name": "sort",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "描述",
"name": "description",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/payment-methods/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID获取支付方式详细信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"支付管理"
],
"summary": "获取支付方式详情",
"parameters": [
{
"type": "integer",
"description": "支付方式ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "支付方式不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "更新支付方式信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"支付管理"
],
"summary": "更新支付方式",
"parameters": [
{
"type": "integer",
"description": "支付方式ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "支付方式名称",
"name": "name",
"in": "body",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "支付配置(JSON对象)",
"name": "config",
"in": "body",
"schema": {
"type": "object"
}
},
{
"description": "是否启用",
"name": "is_active",
"in": "body",
"schema": {
"type": "boolean"
}
},
{
"description": "排序",
"name": "sort",
"in": "body",
"schema": {
"type": "integer"
}
},
{
"description": "描述",
"name": "description",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "删除支付方式",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"支付管理"
],
"summary": "删除支付方式",
"parameters": [
{
"type": "integer",
"description": "支付方式ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/payments": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "分页获取支付记录列表,支持多条件筛选",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"支付管理"
],
"summary": "获取支付记录列表",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "每页数量",
"name": "page_size",
"in": "query"
},
{
"type": "string",
"description": "支付单号(模糊搜索)",
"name": "payment_no",
"in": "query"
},
{
"type": "string",
"description": "订单号(模糊搜索)",
"name": "order_no",
"in": "query"
},
{
"type": "integer",
"description": "支付方式ID",
"name": "payment_method_id",
"in": "query"
},
{
"type": "integer",
"description": "用户ID",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "支付状态(pending/paid/failed/cancelled",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "开始时间(格式:2006-01-02 15:04:05",
"name": "start_time",
"in": "query"
},
{
"type": "string",
"description": "结束时间(格式:2006-01-02 15:04:05",
"name": "end_time",
"in": "query"
},
{
"type": "string",
"description": "排序(格式:字段:asc/desc,如:created_at:desc",
"name": "order_by",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/admin/payments/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "根据ID获取支付记录详细信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"支付管理"
],
"summary": "获取支付记录详情",
"parameters": [
{
"type": "integer",
"description": "支付记录ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "参数错误",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "支付记录不存在",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "服务器错误",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/swagger": {
"get": {
"description": "Description",
"consumes": [
"application/json"
],
"tags": [
"example"
],
"summary": "Summary",
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
}
}
}
}
},
"definitions": {
"admin.AdminDetailResponse": {
"type": "object",
"properties": {
"code": {
"description": "状态码",
"type": "integer",
"example": 200
},
"data": {
"description": "管理员数据",
"allOf": [
{
"$ref": "#/definitions/admin.AdminResponse"
}
]
},
"message": {
"description": "消息",
"type": "string",
"example": "获取成功"
},
"trace_id": {
"description": "追踪ID",
"type": "string",
"example": "abc123"
}
}
},
"admin.AdminExportRequest": {
"type": "object",
"properties": {
"department_id": {
"description": "部门ID",
"type": "string",
"example": "1"
},
"end_time": {
"description": "结束时间",
"type": "string",
"example": "2024-12-31 23:59:59"
},
"is_2fa_bound": {
"description": "是否绑定2FA1-已绑定,0-未绑定",
"type": "string",
"example": "1"
},
"order_by": {
"description": "排序",
"type": "string",
"example": "created_at:desc"
},
"role_id": {
"description": "角色ID",
"type": "string",
"example": "1"
},
"start_time": {
"description": "开始时间",
"type": "string",
"example": "2024-01-01 00:00:00"
},
"status": {
"description": "状态:1-启用,0-禁用",
"type": "string",
"example": "1"
},
"username": {
"description": "用户名(模糊搜索)",
"type": "string",
"example": "admin"
}
}
},
"admin.AdminResponse": {
"type": "object",
"properties": {
"avatar": {
"description": "头像",
"type": "string",
"example": ""
},
"created_at": {
"description": "创建时间",
"type": "string",
"example": "2024-01-01 00:00:00"
},
"department": {
"description": "部门信息",
"type": "object",
"additionalProperties": {}
},
"department_id": {
"description": "部门ID",
"type": "integer",
"example": 1
},
"email": {
"description": "邮箱",
"type": "string",
"example": "admin@example.com"
},
"id": {
"description": "管理员ID",
"type": "integer",
"example": 1
},
"is_2fa_bound": {
"description": "是否绑定2FA",
"type": "boolean",
"example": true
},
"nickname": {
"description": "昵称",
"type": "string",
"example": "管理员"
},
"phone": {
"description": "手机号",
"type": "string",
"example": "13800138000"
},
"roles": {
"description": "角色列表",
"type": "array",
"items": {
"type": "object",
"additionalProperties": {}
}
},
"status": {
"description": "状态:1-启用,0-禁用",
"type": "integer",
"example": 1
},
"updated_at": {
"description": "更新时间",
"type": "string",
"example": "2024-01-01 00:00:00"
},
"username": {
"description": "用户名",
"type": "string",
"example": "admin"
}
}
},
"admin.OrderProductItem": {
"type": "object",
"required": [
"price",
"product_id",
"product_name",
"quantity"
],
"properties": {
"price": {
"description": "单价",
"type": "number",
"example": 99.99
},
"product_id": {
"description": "商品ID",
"type": "integer",
"example": 1
},
"product_name": {
"description": "商品名称",
"type": "string",
"example": "商品名称"
},
"quantity": {
"description": "数量",
"type": "integer",
"example": 2
}
}
},
"admin.PaginatedAdminResponse": {
"type": "object",
"properties": {
"code": {
"description": "状态码",
"type": "integer",
"example": 200
},
"data": {
"description": "数据列表",
"type": "array",
"items": {
"$ref": "#/definitions/admin.AdminResponse"
}
},
"message": {
"description": "消息",
"type": "string",
"example": "获取成功"
},
"page": {
"description": "当前页码",
"type": "integer",
"example": 1
},
"page_size": {
"description": "每页数量",
"type": "integer",
"example": 10
},
"total": {
"description": "总数",
"type": "integer",
"example": 100
},
"trace_id": {
"description": "追踪ID",
"type": "string",
"example": "abc123"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"description": "JWT 认证,格式:Bearer {token}",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}