Эх сурвалжийг харах

feat(feedback.consult.submit): S-cfc-491 反馈脱敏/附件10MB/转人工客服/越权403 使红测全绿

Sisyphus 3 цаг өмнө
parent
commit
bed17d077d

+ 4 - 0
cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java

@@ -4332,6 +4332,10 @@ insertSysConfigSeed("gift_membership_pay_price", "198000", "送会员商品达
                 log.warn("迁移492: energy_log 幂等唯一键添加失败(存量数据含重复,需人工清理): {}", msg);
                 log.warn("迁移492: energy_log 幂等唯一键添加失败(存量数据含重复,需人工清理): {}", msg);
             }
             }
         }
         }
+
+        // 迁移510: report_feedback 补附件载体列(feedback.consult.submit,S-cfc-491 / SC-P-83)
+        ensureColumn("report_feedback", "attachment_url",
+                "VARCHAR(512) DEFAULT NULL COMMENT '反馈附件地址(附件≤10MB,SC-P-83)'");
     }
     }
 
 
     /**
     /**

+ 20 - 1
cfc-backend/src/main/java/com/etotem/cfc/controller/HealthReportController.java

@@ -2835,7 +2835,26 @@ public class HealthReportController {
         Long memberId = ParamUtils.getLong(params.get("memberId"), currentMemberId);
         Long memberId = ParamUtils.getLong(params.get("memberId"), currentMemberId);
         String type = params.get("type") != null ? params.get("type").toString() : null;
         String type = params.get("type") != null ? params.get("type").toString() : null;
         String content = params.get("content") != null ? params.get("content").toString() : null;
         String content = params.get("content") != null ? params.get("content").toString() : null;
-        return reportFeedbackService.submit(userId, memberId, reportId, draftId, type, content);
+        String attachmentUrl = params.get("attachmentUrl") != null ? params.get("attachmentUrl").toString() : null;
+        Long attachmentSize = ParamUtils.getLong(params.get("attachmentSize"));
+        return reportFeedbackService.submit(userId, memberId, reportId, draftId, type, content,
+                attachmentUrl, attachmentSize);
+    }
+
+    /**
+     * 反馈域在线客服:提交反馈并转人工(工单接入,SC-P-83 / 缺口 G-4)。
+     * 与 AI 自动解答路径并行,落库为待人工受理,不调用 AI。
+     */
+    @Operation(summary = "提交反馈并转人工客服(反馈域在线客服)")
+    @PostMapping("/feedback/consult")
+    public Result<?> consultFeedback(@RequestBody Map<String, Object> params,
+                                     @RequestAttribute("userId") Long userId,
+                                     @RequestAttribute(value = "currentMemberId", required = false) Long currentMemberId) {
+        Long memberId = ParamUtils.getLong(params.get("memberId"), currentMemberId);
+        String content = params.get("content") != null ? params.get("content").toString() : null;
+        String attachmentUrl = params.get("attachmentUrl") != null ? params.get("attachmentUrl").toString() : null;
+        Long attachmentSize = ParamUtils.getLong(params.get("attachmentSize"));
+        return reportFeedbackService.handoffToConsultant(userId, memberId, content, attachmentUrl, attachmentSize);
     }
     }
 
 
     @Operation(summary = "我的报告反馈列表(含 AI 解答)")
     @Operation(summary = "我的报告反馈列表(含 AI 解答)")

+ 3 - 0
cfc-backend/src/main/java/com/etotem/cfc/entity/ReportFeedback.java

@@ -19,6 +19,7 @@ public class ReportFeedback {
     private String aiAnswer;
     private String aiAnswer;
     private String aiStatus;
     private String aiStatus;
     private String conversationId;
     private String conversationId;
+    private String attachmentUrl;
     @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
     private Date createdAt;
     private Date createdAt;
 
 
@@ -42,6 +43,8 @@ public class ReportFeedback {
     public void setAiStatus(String aiStatus) { this.aiStatus = aiStatus; }
     public void setAiStatus(String aiStatus) { this.aiStatus = aiStatus; }
     public String getConversationId() { return conversationId; }
     public String getConversationId() { return conversationId; }
     public void setConversationId(String conversationId) { this.conversationId = conversationId; }
     public void setConversationId(String conversationId) { this.conversationId = conversationId; }
+    public String getAttachmentUrl() { return attachmentUrl; }
+    public void setAttachmentUrl(String attachmentUrl) { this.attachmentUrl = attachmentUrl; }
     public Date getCreatedAt() { return createdAt; }
     public Date getCreatedAt() { return createdAt; }
     public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
     public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
 }
 }

+ 139 - 9
cfc-backend/src/main/java/com/etotem/cfc/service/ReportFeedbackService.java

@@ -2,8 +2,14 @@ package com.etotem.cfc.service;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.etotem.cfc.common.Result;
 import com.etotem.cfc.common.Result;
+import com.etotem.cfc.entity.FamilyMember;
+import com.etotem.cfc.entity.HealthReport;
+import com.etotem.cfc.entity.HealthReportDraft;
 import com.etotem.cfc.entity.ReportFeedback;
 import com.etotem.cfc.entity.ReportFeedback;
 import com.etotem.cfc.entity.User;
 import com.etotem.cfc.entity.User;
+import com.etotem.cfc.mapper.FamilyMemberMapper;
+import com.etotem.cfc.mapper.HealthReportDraftMapper;
+import com.etotem.cfc.mapper.HealthReportMapper;
 import com.etotem.cfc.mapper.ReportFeedbackMapper;
 import com.etotem.cfc.mapper.ReportFeedbackMapper;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -22,6 +28,10 @@ public class ReportFeedbackService {
 
 
     private static final Logger log = LoggerFactory.getLogger(ReportFeedbackService.class);
     private static final Logger log = LoggerFactory.getLogger(ReportFeedbackService.class);
 
 
+    /** TC-P-83-E:反馈附件上限 10MB(10 * 1024 * 1024 = 10485760 字节)。 */
+    private static final long MAX_ATTACHMENT_SIZE = 10 * 1024 * 1024;
+    private static final String MSG_ATTACHMENT_TOO_LARGE = "附件不超过 10MB";
+
     @Resource
     @Resource
     private ReportFeedbackMapper reportFeedbackMapper;
     private ReportFeedbackMapper reportFeedbackMapper;
 
 
@@ -37,11 +47,28 @@ public class ReportFeedbackService {
     @Resource
     @Resource
     private RedisTemplate<String, Object> redisTemplate;
     private RedisTemplate<String, Object> redisTemplate;
 
 
+    @Resource
+    private HealthReportMapper healthReportMapper;
+
+    @Resource
+    private HealthReportDraftMapper healthReportDraftMapper;
+
+    @Resource
+    private FamilyMemberMapper familyMemberMapper;
+
     /**
     /**
      * 提交报告反馈(持久化 + AI 解答)。
      * 提交报告反馈(持久化 + AI 解答)。
      * 免费版每日 1 次,付费版不限/多轮(沿用报告快速分析策略)。
      * 免费版每日 1 次,付费版不限/多轮(沿用报告快速分析策略)。
      */
      */
     public Result<?> submit(Long userId, Long memberId, Long reportId, Long draftId, String type, String content) {
     public Result<?> submit(Long userId, Long memberId, Long reportId, Long draftId, String type, String content) {
+        return submit(userId, memberId, reportId, draftId, type, content, null, null);
+    }
+
+    /**
+     * 提交报告反馈(含附件载体)。敏感信息脱敏后再送 AI / 落库(TC-P-83-E)。
+     */
+    public Result<?> submit(Long userId, Long memberId, Long reportId, Long draftId, String type, String content,
+                            String attachmentUrl, Long attachmentSize) {
         if (content == null || content.trim().isEmpty()) {
         if (content == null || content.trim().isEmpty()) {
             return Result.error("反馈内容不能为空");
             return Result.error("反馈内容不能为空");
         }
         }
@@ -49,15 +76,24 @@ public class ReportFeedbackService {
         if (content.length() > 500) {
         if (content.length() > 500) {
             return Result.error("反馈内容不能超过500字");
             return Result.error("反馈内容不能超过500字");
         }
         }
+        Result<?> attachmentError = checkAttachmentSize(attachmentSize);
+        if (attachmentError != null) {
+            return attachmentError;
+        }
         // 归一化类型:question=疑问 / suggestion=建议,其他默认 question
         // 归一化类型:question=疑问 / suggestion=建议,其他默认 question
         String normalizedType = "suggestion".equals(type) ? "suggestion" : "question";
         String normalizedType = "suggestion".equals(type) ? "suggestion" : "question";
 
 
         // 1. 会员级别检查
         // 1. 会员级别检查
         User user = userService.getUserInfo(userId);
         User user = userService.getUserInfo(userId);
-        String memberLevel = user != null ? user.getMemberLevel() : "FREE";
-        boolean isFree = memberLevel == null || "FREE".equals(memberLevel);
 
 
-        // 2. 免费版 Redis 计数(每日 1 次;Redis 异常时 fail-open 放行)
+        // 2. 越权校验:reportId/draftId/memberId 非本用户归属 → 403 拒绝、不落库、不泄露(TC-P-83-P)
+        Result<?> ownershipError = checkOwnership(userId, memberId, reportId, draftId, user);
+        if (ownershipError != null) {
+            return ownershipError;
+        }
+
+        // 3. 免费版 Redis 计数(每日 1 次;Redis 异常时 fail-open 放行)
+        boolean isFree = user == null || user.getMemberLevel() == null || "FREE".equals(user.getMemberLevel());
         if (isFree) {
         if (isFree) {
             try {
             try {
                 String key = "report:feedback:free:" + userId + ":" + LocalDate.now();
                 String key = "report:feedback:free:" + userId + ":" + LocalDate.now();
@@ -73,7 +109,7 @@ public class ReportFeedbackService {
             }
             }
         }
         }
 
 
-        // 3. 组装 AI 上下文(指定报告/草稿时注入对应数据)
+        // 4. 组装 AI 上下文(指定报告/草稿时注入对应数据)
         Map<String, Object> inputs;
         Map<String, Object> inputs;
         if (reportId != null) {
         if (reportId != null) {
             inputs = familyContextService.buildContext(userId, reportId);
             inputs = familyContextService.buildContext(userId, reportId);
@@ -83,20 +119,24 @@ public class ReportFeedbackService {
             inputs = familyContextService.buildContext(userId);
             inputs = familyContextService.buildContext(userId);
         }
         }
 
 
-        // 4. 组装提问(单轮问答;conversationId 留待后续多轮扩展)
-        String query = "【" + ("suggestion".equals(normalizedType) ? "建议" : "疑问") + "】" + content;
+        // 5. 敏感信息脱敏(身份证/手机号)后再送 AI,原始敏感串不进入外部链路(TC-P-83-E)
+        String safeContent = maskSensitiveInfo(content);
 
 
-        // 5. 调 LangGraph(经 AiGateway,统一熔断/配额/脱敏)
+        // 6. 组装提问(单轮问答;conversationId 留待后续多轮扩展)
+        String query = "【" + ("suggestion".equals(normalizedType) ? "建议" : "疑问") + "】" + safeContent;
+
+        // 7. 调 LangGraph(经 AiGateway,统一熔断/配额/脱敏)
         Map<String, Object> resp = aiGateway.chat(query, userId, null, inputs);
         Map<String, Object> resp = aiGateway.chat(query, userId, null, inputs);
 
 
-        // 6. 组装记录(AI 失败也落库,ai_status=failed)
+        // 8. 组装记录(AI 失败也落库,ai_status=failed;content 已脱敏)
         ReportFeedback record = new ReportFeedback();
         ReportFeedback record = new ReportFeedback();
         record.setUserId(userId);
         record.setUserId(userId);
         record.setMemberId(memberId);
         record.setMemberId(memberId);
         record.setReportId(reportId);
         record.setReportId(reportId);
         record.setDraftId(draftId);
         record.setDraftId(draftId);
         record.setFeedbackType(normalizedType);
         record.setFeedbackType(normalizedType);
-        record.setContent(content);
+        record.setContent(safeContent);
+        record.setAttachmentUrl(attachmentUrl);
         if (resp == null) {
         if (resp == null) {
             record.setAiStatus("failed");
             record.setAiStatus("failed");
             record.setAiAnswer(null);
             record.setAiAnswer(null);
@@ -110,6 +150,44 @@ public class ReportFeedbackService {
         return Result.success(record);
         return Result.success(record);
     }
     }
 
 
+    /**
+     * 转人工客服 / 工单接入(反馈域在线客服,缺口 G-4 · SC-P-83)。
+     *
+     * <p>与 AI 自动解答并行的第二条路径:仅落库为待人工受理(feedback_type=consult、
+     * ai_status=pending),不调用 AI;同样执行敏感信息脱敏、附件 10MB 上限与越权校验。</p>
+     */
+    public Result<?> handoffToConsultant(Long userId, Long memberId, String content,
+                                         String attachmentUrl, Long attachmentSize) {
+        if (content == null || content.trim().isEmpty()) {
+            return Result.error("反馈内容不能为空");
+        }
+        content = content.trim();
+        if (content.length() > 500) {
+            return Result.error("反馈内容不能超过500字");
+        }
+        Result<?> attachmentError = checkAttachmentSize(attachmentSize);
+        if (attachmentError != null) {
+            return attachmentError;
+        }
+        User user = userService.getUserInfo(userId);
+        Result<?> ownershipError = checkOwnership(userId, memberId, null, null, user);
+        if (ownershipError != null) {
+            return ownershipError;
+        }
+
+        ReportFeedback record = new ReportFeedback();
+        record.setUserId(userId);
+        record.setMemberId(memberId);
+        record.setFeedbackType("consult");
+        record.setContent(maskSensitiveInfo(content));
+        record.setAttachmentUrl(attachmentUrl);
+        record.setAiStatus("pending");
+        record.setCreatedAt(new Date());
+        reportFeedbackMapper.insert(record);
+        log.info("转人工客服工单已创建: id={}, userId={}", record.getId(), userId);
+        return Result.success(record);
+    }
+
     /**
     /**
      * 我的报告反馈列表(含 AI 解答),按创建时间倒序,最多 50 条。
      * 我的报告反馈列表(含 AI 解答),按创建时间倒序,最多 50 条。
      */
      */
@@ -123,4 +201,56 @@ public class ReportFeedbackService {
         List<ReportFeedback> list = reportFeedbackMapper.selectList(wrapper);
         List<ReportFeedback> list = reportFeedbackMapper.selectList(wrapper);
         return Result.success(list);
         return Result.success(list);
     }
     }
+
+    /** 附件 >10MB 拒绝(400『附件不超过 10MB』,TC-P-83-E)。 */
+    private Result<?> checkAttachmentSize(Long attachmentSize) {
+        if (attachmentSize != null && attachmentSize > MAX_ATTACHMENT_SIZE) {
+            return Result.badRequest(MSG_ATTACHMENT_TOO_LARGE);
+        }
+        return null;
+    }
+
+    /**
+     * 归属校验(TC-P-83-P):reportId/draftId 必须属于当前 userId,memberId 必须属于当前用户家庭;
+     * 否则统一 403 拒绝、不落库、不泄露他人数据(「越权」访问)。
+     *
+     * <p>user.familyId 为空表示当前上下文无法确定家庭(由 JwtInterceptor 按 userId+familyId 解析
+     * currentMemberId),此时跳过跨家庭判定,保持既有放行语义。</p>
+     */
+    private Result<?> checkOwnership(Long userId, Long memberId, Long reportId, Long draftId, User user) {
+        if (reportId != null) {
+            HealthReport report = healthReportMapper.selectById(reportId);
+            if (report != null && !userId.equals(report.getUserId())) {
+                return Result.forbidden("越权访问:报告不属于当前用户");
+            }
+        }
+        if (draftId != null) {
+            HealthReportDraft draft = healthReportDraftMapper.selectById(draftId);
+            if (draft != null && !userId.equals(draft.getUserId())) {
+                return Result.forbidden("越权访问:草稿不属于当前用户");
+            }
+        }
+        if (memberId != null && user != null && user.getFamilyId() != null) {
+            FamilyMember member = familyMemberMapper.selectById(memberId);
+            if (member == null || !user.getFamilyId().equals(member.getFamilyId())) {
+                return Result.forbidden("越权访问:家庭成员不属于当前用户家庭");
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 敏感信息脱敏(SC-P-83 / TC-P-83-E):18 位身份证与 11 位手机号仅保留前 3/6 后 4 位,
+     * 落库与 AI 请求中均不得出现原始明文。
+     */
+    private String maskSensitiveInfo(String content) {
+        if (content == null) {
+            return null;
+        }
+        // 身份证:18 位(末位可为 X),保留前 6 后 4
+        String masked = content.replaceAll("(?<!\\d)(\\d{6})\\d{8}([\\dXx]{4})(?!\\d)", "$1********$2");
+        // 手机号:1 开头的 11 位数字,保留前 3 后 4
+        masked = masked.replaceAll("(?<!\\d)(1\\d{2})\\d{4}(\\d{4})(?!\\d)", "$1****$2");
+        return masked;
+    }
 }
 }

+ 1 - 0
cfc-backend/src/main/resources/schema.sql

@@ -6616,6 +6616,7 @@ CREATE TABLE IF NOT EXISTS report_feedback (
     ai_answer TEXT COMMENT 'AI 解答',
     ai_answer TEXT COMMENT 'AI 解答',
     ai_status VARCHAR(20) DEFAULT 'pending' COMMENT 'pending/answered/failed',
     ai_status VARCHAR(20) DEFAULT 'pending' COMMENT 'pending/answered/failed',
     conversation_id VARCHAR(64) DEFAULT NULL COMMENT 'AI 会话ID(付费多轮)',
     conversation_id VARCHAR(64) DEFAULT NULL COMMENT 'AI 会话ID(付费多轮)',
+    attachment_url VARCHAR(512) DEFAULT NULL COMMENT '反馈附件地址(附件≤10MB,SC-P-83)',
     created_at DATETIME NOT NULL COMMENT '创建时间',
     created_at DATETIME NOT NULL COMMENT '创建时间',
     INDEX idx_rf_user (user_id, created_at),
     INDEX idx_rf_user (user_id, created_at),
     INDEX idx_rf_report (report_id)
     INDEX idx_rf_report (report_id)

+ 1 - 0
docs/superpowers/PROJECT-OVERVIEW.md

@@ -2,6 +2,7 @@
 
 
 **文档版本:** v2.24
 **文档版本:** v2.24
 **日期:** 2026-10-31
 **日期:** 2026-10-31
+**本次更新(2026-11-30 · S-cfc-491):** 反馈域在线客服 `POST /api/health/feedback/consult`(提交反馈转人工工单,SC-P-83 / 缺口 G-4),`/feedback/submit` 增附件载体(10MB 上限 400)+ 身份证/手机号脱敏 + reportId/draftId/memberId 越权 403 校验,迁移510 为 `report_feedback` 补 `attachment_url`,见 `api/API_REFERENCE.md` 4.37。
 **本次更新(2026-11-30):** 新增方案编辑/查看/版本历史 7 端点 `POST /api/growth/plan/{edit,edit-tasks,view,versions,versions/compare,version,version/modify}`(SC-P-42/43/48,能力键 `plan.edit.adjust`,超长 400 / 越权 403 / 版本不可篡改 403 / 空方案占位),配套迁移509(growth_plans 增 version/edited、status 扩宽 + growth_plan_version 快照表),见 `api/API_REFERENCE.md` 4.6。
 **本次更新(2026-11-30):** 新增方案编辑/查看/版本历史 7 端点 `POST /api/growth/plan/{edit,edit-tasks,view,versions,versions/compare,version,version/modify}`(SC-P-42/43/48,能力键 `plan.edit.adjust`,超长 400 / 越权 403 / 版本不可篡改 403 / 空方案占位),配套迁移509(growth_plans 增 version/edited、status 扩宽 + growth_plan_version 快照表),见 `api/API_REFERENCE.md` 4.6。
 **上次更新(2026-11-28):** 新增后台推荐规则管理 12 端点 `POST /api/admin/food-rule/*`(权重/配伍/加工/病症权重四 Tab,版本化 + 灰度开关;S-cfc-502 / `food.ops.ruleManagement`),配套迁移507 三表,见 `api/API_REFERENCE.md` 4.67。
 **上次更新(2026-11-28):** 新增后台推荐规则管理 12 端点 `POST /api/admin/food-rule/*`(权重/配伍/加工/病症权重四 Tab,版本化 + 灰度开关;S-cfc-502 / `food.ops.ruleManagement`),配套迁移507 三表,见 `api/API_REFERENCE.md` 4.67。
 **状态:** 已确认(v2.1 Phase 2-4 全栈完成)+ 虚拟支付改造(Tasks 1-12 已完成,退款闭环实施中)+ 新用户注册引导(12 Tasks 全栈完成)+ 家庭成员关系条增强(✅ 已实施)+ TabBar 重构(✅ 4Tab + 中间⭐扇形菜单,设计已对齐实现)+ **LIFETIME 终身会员(✅ 11 Tasks 全栈完成)** + **健康数据中心(✅ 全栈完成)** + **SKU 价格单位统一分 + 规格选择响应式修复(✅ 7 Tasks 全栈完成)** + **AI健康教练人格分化与管家自助选择(✅ 11 Tasks 全栈完成)** + **优惠券全链路改为家庭维度(待实施)** + **关系三图重构(关键人拓展章鱼图/珍珠图/能力图,设计规格已完成)** + **注册零填写+信息按需补充(✅ 全栈完成:登录直接进首页 + 家庭邀请独立页真实姓名/家庭身份必填 + 功能→信息字段映射表 + 添加成员手机号冲突邀请加入)** + **健康报告归属重分配(✅ 后端接口 + 管理端页面 + 小程序入口已实现,见 `specs/2026-10-05-health-report-reassign-design.md`)**
 **状态:** 已确认(v2.1 Phase 2-4 全栈完成)+ 虚拟支付改造(Tasks 1-12 已完成,退款闭环实施中)+ 新用户注册引导(12 Tasks 全栈完成)+ 家庭成员关系条增强(✅ 已实施)+ TabBar 重构(✅ 4Tab + 中间⭐扇形菜单,设计已对齐实现)+ **LIFETIME 终身会员(✅ 11 Tasks 全栈完成)** + **健康数据中心(✅ 全栈完成)** + **SKU 价格单位统一分 + 规格选择响应式修复(✅ 7 Tasks 全栈完成)** + **AI健康教练人格分化与管家自助选择(✅ 11 Tasks 全栈完成)** + **优惠券全链路改为家庭维度(待实施)** + **关系三图重构(关键人拓展章鱼图/珍珠图/能力图,设计规格已完成)** + **注册零填写+信息按需补充(✅ 全栈完成:登录直接进首页 + 家庭邀请独立页真实姓名/家庭身份必填 + 功能→信息字段映射表 + 添加成员手机号冲突邀请加入)** + **健康报告归属重分配(✅ 后端接口 + 管理端页面 + 小程序入口已实现,见 `specs/2026-10-05-health-report-reassign-design.md`)**

+ 4 - 1
docs/superpowers/api/API_REFERENCE.md

@@ -1296,6 +1296,7 @@ aikanshe:
 |------|------|
 |------|------|
 | `POST /api/health/feedback/submit` | 提交报告反馈(持久化 + AI 解答),请求 `{ reportId?, draftId?, memberId?, type, content }`,返回 `Result<ReportFeedback>` |
 | `POST /api/health/feedback/submit` | 提交报告反馈(持久化 + AI 解答),请求 `{ reportId?, draftId?, memberId?, type, content }`,返回 `Result<ReportFeedback>` |
 | `POST /api/health/feedback/list` | 我的报告反馈列表(含 AI 解答),请求 `{ reportId? }`,返回 `Result<List<ReportFeedback>>`(按创建时间倒序,最多 50 条) |
 | `POST /api/health/feedback/list` | 我的报告反馈列表(含 AI 解答),请求 `{ reportId? }`,返回 `Result<List<ReportFeedback>>`(按创建时间倒序,最多 50 条) |
+| `POST /api/health/feedback/consult` | 提交反馈并转人工客服(反馈域在线客服,SC-P-83 / 缺口 G-4),请求 `{ content, memberId?, attachmentUrl?, attachmentSize? }`,落库 `feedbackType=consult`、`aiStatus=pending`,不调用 AI,返回 `Result<ReportFeedback>` |
 
 
 **`/api/health/feedback/submit` 请求体:**
 **`/api/health/feedback/submit` 请求体:**
 ```json
 ```json
@@ -1331,7 +1332,9 @@ aikanshe:
 
 
 - `aiStatus` 取值:`pending`(待解答)/ `answered`(AI 已解答)/ `failed`(AI 调用失败,仍会落库,`aiAnswer` 为空)。
 - `aiStatus` 取值:`pending`(待解答)/ `answered`(AI 已解答)/ `failed`(AI 调用失败,仍会落库,`aiAnswer` 为空)。
 - 免费版每日仅限 1 次反馈解答(Redis 计数 `report:feedback:free:{userId}:{date}`,`memberLevel=FREE` 或为空时生效),超限返回 `Result.error("免费版每日仅限 1 次反馈解答,升级会员解锁更多")`;Redis 异常时 fail-open 放行。
 - 免费版每日仅限 1 次反馈解答(Redis 计数 `report:feedback:free:{userId}:{date}`,`memberLevel=FREE` 或为空时生效),超限返回 `Result.error("免费版每日仅限 1 次反馈解答,升级会员解锁更多")`;Redis 异常时 fail-open 放行。
-- `content` 必填且不超过 500 字。
+- `content` 必填且不超过 500 字;身份证/手机号自动脱敏后落库(仅保留前 3/6 后 4 位)。
+- `attachmentUrl?` / `attachmentSize?`:附件地址与字节数,单附件 >10MB(10485760 字节)返回 400『附件不超过 10MB』;列 `report_feedback.attachment_url`(迁移510)。
+- `reportId` / `draftId` / `memberId` 须归属当前用户,否则 403 拒绝、不落库(越权校验)。
 
 
 ---
 ---