diff --git a/server/MiAssessment/src/MiAssessment.Api/Program.cs b/server/MiAssessment/src/MiAssessment.Api/Program.cs index 884e1ff..6d0e35d 100644 --- a/server/MiAssessment/src/MiAssessment.Api/Program.cs +++ b/server/MiAssessment/src/MiAssessment.Api/Program.cs @@ -115,9 +115,9 @@ try // 添加文档信息 options.AddDocumentTransformer((document, context, ct) => { - document.Info.Title = "MiAssessment API"; + document.Info.Title = "学业邑规划 API"; document.Info.Version = "v1"; - document.Info.Description = "友达赏抽奖系统API文档 - 提供用户认证、商品管理、订单处理、抽奖系统等功能\n\n" + + document.Info.Description = "学业邑规划小程序API - 提供用户认证、测评管理、订单处理、分销系统等功能\n\n" + "## 认证说明\n" + "大部分接口需要JWT认证,请在请求头中添加:\n" + "`Authorization: Bearer `\n\n" + @@ -153,7 +153,7 @@ try app.MapOpenApi(); app.MapScalarApiReference(options => { - options.WithTitle("MiAssessment API"); + options.WithTitle("学业邑规划 API"); options.WithDefaultHttpClient(ScalarTarget.CSharp, ScalarClient.HttpClient); }); diff --git a/server/MiAssessment/src/MiAssessment.Api/user-management.http b/server/MiAssessment/src/MiAssessment.Api/user-management.http deleted file mode 100644 index abf2b35..0000000 --- a/server/MiAssessment/src/MiAssessment.Api/user-management.http +++ /dev/null @@ -1,491 +0,0 @@ -# MiAssessment API 用户管理系统接口测试文件 -# 用于验证所有用户管理相关的控制器接口 -# Checkpoint 19: 控制器测试验证 - -@baseUrl = http://localhost:5238/api -@contentType = application/json - -# 测试用Token(需要通过登录接口获取真实Token后替换) -# 下面是一个有效的测试Token(用户ID: 21583),有效期至2026年 -@authToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoi5b6u5L-h55So5oi3MTMxMCIsImV4cCI6MTc2NzQzMTM1OCwidWlkIjoiMzMyMjY2IiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiIyMTU4MyIsImF1ZCI6IkhvbmV5Qm94VXNlcnMiLCJpc3MiOiJIb25leUJveCJ9.700XWIUmzEumNk5tNYRshh7M42A8MG1X4yTHuz9PZbc - -### ============================================ -### 1. 健康检查接口 -### ============================================ - -### 1.1 健康检查 - 验证服务是否正常运行 -# GET /api/health -GET {{baseUrl}}/health -Accept: {{contentType}} - -### ============================================ -### 2. 资产明细接口 (UserController - Asset Endpoints) -### Requirements: 1.1-1.6 -### ============================================ - -### 2.1 获取余额明细 - 全部记录 -# POST /api/profitMoney -# Requirements: 1.1 -POST {{baseUrl}}/profitMoney -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 0, - "page": 1, - "limit": 15 -} - -### 2.2 获取余额明细 - 按类型过滤 -# POST /api/profitMoney -# Requirements: 1.1 -POST {{baseUrl}}/profitMoney -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 1, - "page": 1, - "limit": 10 -} - -### 2.3 获取吧唧币明细 - 全部记录 -# POST /api/profitIntegral -# Requirements: 1.2 -POST {{baseUrl}}/profitIntegral -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 0, - "page": 1, - "limit": 15 -} - -### 2.4 获取吧唧币明细 - 按类型过滤 -# POST /api/profitIntegral -# Requirements: 1.2 -POST {{baseUrl}}/profitIntegral -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 2, - "page": 1, - "limit": 10 -} - -### 2.5 获取积分明细 - 全部记录 -# POST /api/profitScore -# Requirements: 1.3 -POST {{baseUrl}}/profitScore -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 0, - "page": 1, - "limit": 15 -} - -### 2.6 获取积分明细 - 按类型过滤 -# POST /api/profitScore -# Requirements: 1.3 -POST {{baseUrl}}/profitScore -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 1, - "page": 1, - "limit": 10 -} - -### 2.7 获取支付记录 -# POST /api/profitPay -# Requirements: 1.4 -POST {{baseUrl}}/profitPay -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "page": 1, - "limit": 15 -} - - -### ============================================ -### 3. VIP接口 (UserController - VIP Endpoints) -### Requirements: 2.1-2.5 -### ============================================ - -### 3.1 获取VIP信息 -# POST /api/vip_list -# Requirements: 2.1-2.5 -POST {{baseUrl}}/vip_list -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -### ============================================ -### 4. 优惠券接口 (CouponController) -### Requirements: 3.1-7.5 -### ============================================ - -### 4.1 获取优惠券列表 - 未使用 -# POST /api/coupon_list -# Requirements: 3.1-3.4 -POST {{baseUrl}}/coupon_list -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "status": 1, - "page": 1, - "limit": 15 -} - -### 4.2 获取优惠券列表 - 已分享 -# POST /api/coupon_list -# Requirements: 3.1-3.4 -POST {{baseUrl}}/coupon_list -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "status": 2, - "page": 1, - "limit": 15 -} - -### 4.3 获取优惠券详情 -# POST /api/coupon_detail -# Requirements: 4.1-4.4 -# 注意:需要替换为有效的优惠券ID -POST {{baseUrl}}/coupon_detail -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "id": 1 -} - -### 4.4 分享优惠券 -# POST /api/coupon_share -# Requirements: 5.1-5.3 -# 注意:需要替换为有效的优惠券ID -POST {{baseUrl}}/coupon_share -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "id": 1 -} - -### 4.5 领取优惠券 -# POST /api/coupon_ling -# Requirements: 6.1-6.7 -# 注意:需要替换为有效的已分享优惠券ID -POST {{baseUrl}}/coupon_ling -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "id": 1 -} - -### 4.6 计算优惠券合成 -# POST /api/coupon_ji_suan -# Requirements: 7.1-7.4 -# 注意:需要替换为有效的优惠券ID列表(逗号分隔) -POST {{baseUrl}}/coupon_ji_suan -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "couponIds": "1,2,3" -} - -### 4.7 执行优惠券合成 -# POST /api/coupon_synthesis -# Requirements: 7.5 -# 注意:需要替换为有效的优惠券ID列表(逗号分隔) -POST {{baseUrl}}/coupon_synthesis -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "couponIds": "1,2,3" -} - -### ============================================ -### 5. 任务接口 (TaskController) -### Requirements: 8.1-8.7 -### ============================================ - -### 5.1 获取每日任务列表 -# POST /api/task_list -# Requirements: 8.1-8.5 -POST {{baseUrl}}/task_list -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 1 -} - -### 5.2 获取每周任务列表 -# POST /api/task_list -# Requirements: 8.1-8.5 -POST {{baseUrl}}/task_list -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "type": 2 -} - -### 5.3 领取任务奖励 -# POST /api/ling_task -# Requirements: 8.6-8.7 -# 注意:需要替换为有效的任务ID -POST {{baseUrl}}/ling_task -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "taskListId": 1 -} - - -### ============================================ -### 6. 推荐/邀请接口 (InvitationController) -### Requirements: 9.1-9.5 -### ============================================ - -### 6.1 获取推荐信息 -# POST /api/invitation -# Requirements: 9.1-9.2 -POST {{baseUrl}}/invitation -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "page": 1 -} - -### 6.2 获取推荐信息 - 第二页 -# POST /api/invitation -# Requirements: 9.1-9.2 -POST {{baseUrl}}/invitation -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "page": 2 -} - -### 6.3 绑定邀请码 -# POST /api/bind_invite_code -# Requirements: 9.3-9.5 -# 注意:需要替换为有效的邀请码 -POST {{baseUrl}}/bind_invite_code -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "inviteCode": "ABC123" -} - -### ============================================ -### 7. 排行榜接口 (RankController) -### Requirements: 10.1-10.5 -### ============================================ - -### 7.1 获取周榜 -# GET /api/rank_week -# Requirements: 10.1, 10.3-10.5 -GET {{baseUrl}}/rank_week -Authorization: Bearer {{authToken}} - -### 7.2 获取月榜 -# GET /api/rank_month -# Requirements: 10.2-10.5 -GET {{baseUrl}}/rank_month -Authorization: Bearer {{authToken}} - -### ============================================ -### 8. 兑换码接口 (RedeemController) -### Requirements: 11.1-11.4 -### ============================================ - -### 8.1 使用兑换码 -# POST /api/used -# Requirements: 11.1-11.4 -# 注意:需要替换为有效的兑换码 -POST {{baseUrl}}/used -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "code": "TESTCODE123" -} - -### ============================================ -### 9. 福利屋接口 (WelfareController) -### Requirements: 12.1-14.4 -### ============================================ - -### 9.1 获取福利屋列表 - 进行中 -# POST /api/welfare_house_list -# Requirements: 12.1-12.5 -POST {{baseUrl}}/welfare_house_list -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{authToken}} - -type=1&page=1&limit=15 - -### 9.2 获取福利屋列表 - 已结束 -# POST /api/welfare_house_list -# Requirements: 12.1-12.5 -POST {{baseUrl}}/welfare_house_list -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{authToken}} - -type=3&page=1&limit=15 - -### 9.3 获取福利屋详情 -# POST /api/fuliwu_detail -# Requirements: 13.1-13.4 -# 注意:需要替换为有效的商品ID -POST {{baseUrl}}/fuliwu_detail -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{authToken}} - -goodsId=1 - -### 9.4 获取福利屋参与者列表 -# POST /api/fuliwu_participants -# Requirements: 14.1 -# 注意:需要替换为有效的商品ID -POST {{baseUrl}}/fuliwu_participants -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{authToken}} - -goodsId=1&page=1&limit=15 - -### 9.5 获取福利屋开奖记录 -# POST /api/fuliwu_records -# Requirements: 14.2 -# 注意:需要替换为有效的商品ID -POST {{baseUrl}}/fuliwu_records -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{authToken}} - -goodsId=1&page=1&limit=15 - -### 9.6 获取用户参与记录 -# GET /api/fuliwu_user_records -# Requirements: 14.3 -GET {{baseUrl}}/fuliwu_user_records?page=1&limit=15 -Authorization: Bearer {{authToken}} - -### 9.7 获取用户中奖记录 -# GET /api/fuliwu_user_winning_records -# Requirements: 14.4 -GET {{baseUrl}}/fuliwu_user_winning_records?page=1&limit=15 -Authorization: Bearer {{authToken}} - - -### ============================================ -### 10. 错误场景测试 -### ============================================ - -### 10.1 未授权访问 - 获取余额明细(无Token) -POST {{baseUrl}}/profitMoney -Content-Type: {{contentType}} - -{ - "type": 0, - "page": 1, - "limit": 15 -} - -### 10.2 未授权访问 - 获取VIP信息(无Token) -POST {{baseUrl}}/vip_list -Content-Type: {{contentType}} - -### 10.3 未授权访问 - 获取优惠券列表(无Token) -POST {{baseUrl}}/coupon_list -Content-Type: {{contentType}} - -{ - "status": 1, - "page": 1, - "limit": 15 -} - -### 10.4 未授权访问 - 获取任务列表(无Token) -POST {{baseUrl}}/task_list -Content-Type: {{contentType}} - -{ - "type": 1 -} - -### 10.5 未授权访问 - 获取推荐信息(无Token) -POST {{baseUrl}}/invitation -Content-Type: {{contentType}} - -{ - "page": 1 -} - -### 10.6 未授权访问 - 获取周榜(无Token) -GET {{baseUrl}}/rank_week - -### 10.7 未授权访问 - 使用兑换码(无Token) -POST {{baseUrl}}/used -Content-Type: {{contentType}} - -{ - "code": "TESTCODE123" -} - -### 10.8 未授权访问 - 获取福利屋列表(无Token) -POST {{baseUrl}}/welfare_house_list -Content-Type: application/x-www-form-urlencoded - -type=1&page=1&limit=15 - -### 10.9 参数缺失 - 优惠券详情(无ID) -POST {{baseUrl}}/coupon_detail -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{} - -### 10.10 参数缺失 - 领取任务奖励(无任务ID) -POST {{baseUrl}}/ling_task -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{} - -### 10.11 参数缺失 - 使用兑换码(空兑换码) -POST {{baseUrl}}/used -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "code": "" -} - -### 10.12 参数缺失 - 绑定邀请码(空邀请码) -POST {{baseUrl}}/bind_invite_code -Content-Type: {{contentType}} -Authorization: Bearer {{authToken}} - -{ - "inviteCode": "" -} -