docs(api): 更新API文档和接口测试指南

- 为管理员登录接口添加完整的Swagger文档注释
- 修复支付和订单相关接口的参数类型定义
- 更新订单查询接口使用订单号作为路径参数
- 添加支付记录导出功能的API文档
- 创建详细的Apifox接口测试指南文档
- 修正金额参数的数据格式为float64
- 更新接口描述以反映分表后的查询逻辑
This commit is contained in:
Joe
2026-01-16 17:17:06 +08:00
parent 550d3e1f42
commit 4985c2f2b6
5 changed files with 1296 additions and 87 deletions
@@ -54,6 +54,22 @@ func (r *AuthController) getLoginRequestData(ctx http.Context) string {
}
// Login 管理员登录
// @Summary 管理员登录
// @Description 管理员登录接口,支持用户名密码登录。如果管理员绑定了谷歌验证码,需要提供 google_code;如果未绑定但启用了图形验证码,需要提供 captcha_id 和 captcha_answer。登录成功后返回 JWT Token,Token 会同时出现在响应体的 data.token 和响应头 Authorization 中。
// @Tags 认证管理
// @Accept json
// @Produce json
// @Param username body string true "用户名"
// @Param password body string true "密码(最少6位)"
// @Param captcha_id body string false "图形验证码ID(如果启用了图形验证码且未绑定谷歌验证码)"
// @Param captcha_answer body string false "图形验证码答案(如果启用了图形验证码且未绑定谷歌验证码)"
// @Param google_code body string false "谷歌验证码(如果绑定了谷歌验证码)"
// @Success 200 {object} map[string]any "登录成功,返回 Token 和管理员信息"
// @Failure 400 {object} map[string]any "参数错误、验证码错误或谷歌验证码错误"
// @Failure 401 {object} map[string]any "用户名或密码错误"
// @Failure 403 {object} map[string]any "账号已禁用"
// @Failure 500 {object} map[string]any "服务器错误"
// @Router /api/admin/login [post]
func (r *AuthController) Login(ctx http.Context) http.Response {
var loginRequest admin.Login
errors, err := ctx.Request().ValidateRequest(&loginRequest)