From d8d202554327c2c230e92626951ddbfd282e0730 Mon Sep 17 00:00:00 2001
From: scottpan <43121650@qq.com>
Date: Thu, 5 Mar 2026 09:35:00 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20T10=20=E5=9B=9E=E5=BD=92=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95=20Bug=20=E4=BF=AE=E5=A4=8D=E4=B8=8E=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复 BUG-001 至 BUG-009 及 T10-1 至 T10-6 相关问题:
- 打卡积分显示与累加逻辑优化
- 食谱计算器 Tab 选中样式修复
- 食物百科列表图片与简介展示修复
- 食物详情页数据加载修复
- AI营养师差异化回复优化
- 健康知识/营养知识名称统一
- 饮食指南/科普文章详情页内容展示修复
- 帖子营养统计数据展示修复
- 社区帖子类型中文命名统一
- 帖子详情标签中文显示修复
- 食谱营养AI填充功能完善
- 食谱收藏/点赞功能修复
新增:
- ToolNutritionFillService 营养填充服务
- T10 回归测试用例 (Playwright)
- 知识文章数据 SQL 脚本
涉及模块:
- crmeb-common: VO/Request/Response 优化
- crmeb-service: 业务逻辑完善
- crmeb-front: API 接口扩展
- msh_single_uniapp: 前端页面修复
- tests/e2e: 回归测试用例
---
docs/Testing/T10-full-regression-report.md | 73 +++++
docs/sql/check_knowledge_articles.sql | 21 ++
docs/sql/seed_v2_knowledge_guide_article.sql | 43 +++
.../interceptor/SwaggerInterceptor.java | 12 +-
.../java/com/zbkj/common/page/CommonPage.java | 12 +-
.../common/request/ArticleSearchRequest.java | 8 +
.../zbkj/common/request/PageParamRequest.java | 8 +
.../common/request/SystemMenuRequest.java | 35 +++
.../request/SystemMenuSearchRequest.java | 8 +
.../common/response/CozeBaseResponse.java | 60 +++-
.../zbkj/common/response/MenusResponse.java | 25 +-
.../kieai/KieAICreateTaskResponse.java | 15 +-
.../kieai/KieAINanoBananaResponse.java | 9 +-
.../kieai/KieAIQueryTaskResponse.java | 50 +++-
.../com/zbkj/common/result/ResultAdvice.java | 9 +-
.../common/token/FrontTokenComponent.java | 10 +-
.../com/zbkj/common/vo/DateLimitUtilVo.java | 17 ++
.../com/zbkj/common/vo/ImageMergeUtilVo.java | 25 ++
.../java/com/zbkj/common/vo/LoginUserVo.java | 15 +-
.../java/com/zbkj/common/vo/MenuCheckVo.java | 62 +++-
.../java/com/zbkj/common/vo/MenuTree.java | 5 +-
.../zbkj/front/controller/ToolController.java | 49 +++-
.../service/impl/SystemConfigServiceImpl.java | 4 +-
.../impl/tool/ToolCheckinServiceImpl.java | 109 +++++--
.../impl/tool/ToolCommunityServiceImpl.java | 38 ++-
.../impl/tool/ToolGrokServiceImpl.java | 82 +++++-
.../impl/tool/ToolKnowledgeServiceImpl.java | 25 ++
.../tool/ToolNutritionFillServiceImpl.java | 100 +++++++
.../impl/tool/ToolRecipeServiceImpl.java | 271 ++++++++++++++++++
.../service/tool/ToolCommunityService.java | 7 +
.../service/tool/ToolKnowledgeService.java | 7 +
.../tool/ToolNutritionFillService.java | 20 ++
.../service/tool/ToolRecipeService.java | 7 +
msh_single_uniapp/api/tool.js | 25 ++
.../pages/tool/ai-nutritionist.vue | 4 +-
.../pages/tool/calculator-result.vue | 6 +-
msh_single_uniapp/pages/tool/checkin.vue | 8 +-
msh_single_uniapp/pages/tool/food-detail.vue | 11 +-
.../pages/tool/food-encyclopedia.vue | 21 +-
.../pages/tool/nutrition-knowledge.vue | 40 +--
msh_single_uniapp/pages/tool/post-detail.vue | 158 +++++++---
.../pages/tool/recipe-detail.vue | 39 ++-
.../pages/tool_main/community.vue | 8 +-
tests/e2e/bug-regression.spec.ts | 140 +++++++++
44 files changed, 1536 insertions(+), 165 deletions(-)
create mode 100644 docs/Testing/T10-full-regression-report.md
create mode 100644 docs/sql/check_knowledge_articles.sql
create mode 100644 docs/sql/seed_v2_knowledge_guide_article.sql
create mode 100644 msh_crmeb_22/crmeb-service/src/main/java/com/zbkj/service/service/impl/tool/ToolNutritionFillServiceImpl.java
create mode 100644 msh_crmeb_22/crmeb-service/src/main/java/com/zbkj/service/service/tool/ToolNutritionFillService.java
diff --git a/docs/Testing/T10-full-regression-report.md b/docs/Testing/T10-full-regression-report.md
new file mode 100644
index 0000000..f2209c2
--- /dev/null
+++ b/docs/Testing/T10-full-regression-report.md
@@ -0,0 +1,73 @@
+# T10 Full Regression Test Report
+
+**Plan:** smooth-moseying-tiger · **Task:** T10 Full regression testing
+**Date:** 2026-03-04
+**Scope:** Verify all 6 fixes: post detail tag, post/recipe AI fill, recipe favorite, recipe like visual, knowledge navigation.
+
+---
+
+## Summary
+
+| # | Issue | Test ID | Pass/Fail | Notes |
+|---|--------|---------|-----------|--------|
+| 1 | Post detail tag shows Chinese | T10-1 | *(run tests)* | Asserts `.meal-tag`/`.type-tag` has Chinese on post detail |
+| 2 | Post nutrition AI fill works | T10-2 | *(run tests)* | Clicks "AI 补充营养", expects stats and no error |
+| 3 | Recipe nutrition AI fill works | T10-3 | *(run tests)* | Recipe detail shows nutrition (API or AI fill) |
+| 4 | Recipe favorite no error | T10-4 | *(run tests)* | Favorite button shows 已收藏/已取消收藏, no 操作失败 |
+| 5 | Recipe like emoji changes visual | T10-5 | *(run tests)* | Like button emoji 🤍 ↔ ❤️ on click |
+| 6 | Knowledge articles can navigate to detail | T10-6 | *(run tests)* | 科普文章 → first item → detail has content |
+
+**To get pass/fail:** Run `./scripts/run-t10-regression.sh` or `npx playwright test tests/e2e/bug-regression.spec.ts --grep "T10"`, then set each row to PASS or FAIL from the test output.
+
+---
+
+## How to Run
+
+**Prerequisites:** Frontend at `http://localhost:8080`, backend API at `http://127.0.0.1:20822`, logged-in test account (phone/password in spec).
+
+```bash
+cd /Users/apple/scott2026/msh-system
+npx playwright test tests/e2e/bug-regression.spec.ts --grep "T10" --reporter=list
+```
+
+To run with HTML report:
+
+```bash
+npx playwright test tests/e2e/bug-regression.spec.ts --grep "T10" --reporter=html
+npx playwright show-report tests/e2e/reports
+```
+
+---
+
+## Test Descriptions
+
+| # | Issue | What the test does |
+|---|--------|---------------------|
+| **1** | **Post detail tag shows Chinese** | Opens community → first post → checks `.meal-tag` / `.type-tag` contains Chinese (e.g. 早餐/午餐/晚餐/分享). |
+| **2** | **Post nutrition AI fill works** | Opens a post detail; if "🤖 AI 补充营养" is visible, clicks it, waits ~8s; asserts no error and nutrition stats appear. |
+| **3** | **Recipe nutrition AI fill works** | Opens recipe detail (from tool main or `recipe-detail?id=1`), waits for nutrition card; asserts nutrition values are present (from API or AI fill). |
+| **4** | **Recipe favorite no error** | Opens recipe detail, clicks favorite (⭐) button; expects toast "已收藏" or "已取消收藏" and no "操作失败". |
+| **5** | **Recipe like emoji changes visual** | Opens recipe detail, reads like button emoji (🤍/❤️), clicks like; asserts emoji or state changes. |
+| **6** | **Knowledge articles can navigate to detail** | Goes to nutrition-knowledge → 科普文章 tab → clicks first article; asserts detail page has visible content. |
+
+---
+
+## After Running: Fill Pass/Fail
+
+Replace **Run tests to fill** in the Summary table with **PASS** or **FAIL** per test, and add any Notes (e.g. timeout, missing data, API error).
+
+Example:
+
+| # | Issue | Test ID | Pass/Fail | Notes |
+|---|--------|---------|-----------|--------|
+| 1 | Post detail tag shows Chinese | T10-1 | PASS | |
+| 2 | Post nutrition AI fill works | T10-2 | PASS | |
+| ... | ... | ... | ... | ... |
+
+---
+
+## Related Existing Tests
+
+- **TC-B07** – Diet guide & science article detail content (same scope as item 6).
+- **TC-B08** – Post detail nutrition stats visible.
+- **TC-B09** – Community tabs and post type tags in Chinese (list page; T10-1 checks post *detail* page).
diff --git a/docs/sql/check_knowledge_articles.sql b/docs/sql/check_knowledge_articles.sql
new file mode 100644
index 0000000..c33d29a
--- /dev/null
+++ b/docs/sql/check_knowledge_articles.sql
@@ -0,0 +1,21 @@
+-- T04: Check database for knowledge articles (v2_knowledge)
+-- Run against your DB: mysql -u user -p your_db < docs/sql/check_knowledge_articles.sql
+-- Or use API: GET /api/front/tool/knowledge/stats (returns total, byType, byStatus)
+--
+-- If (guide + article, published) counts are 0: run docs/sql/seed_v2_knowledge_guide_article.sql
+-- If data exists but list click doesn't open detail: check front-end console for
+-- [nutrition-knowledge] goToDetail logs (item keys, resolved id, navigate url).
+
+SELECT 'v2_knowledge: total' AS report, COUNT(*) AS cnt FROM v2_knowledge;
+
+SELECT type, status, COUNT(*) AS cnt
+FROM v2_knowledge
+GROUP BY type, status
+ORDER BY type, status;
+
+-- Published count by type (guide + article must be > 0 for list/click to work)
+SELECT type, COUNT(*) AS cnt
+FROM v2_knowledge
+WHERE status = 'published'
+GROUP BY type
+ORDER BY type;
diff --git a/docs/sql/seed_v2_knowledge_guide_article.sql b/docs/sql/seed_v2_knowledge_guide_article.sql
new file mode 100644
index 0000000..b60ecdb
--- /dev/null
+++ b/docs/sql/seed_v2_knowledge_guide_article.sql
@@ -0,0 +1,43 @@
+-- T04/T05: Seed v2_knowledge with guide/article rows when none exist (status='published')
+-- 1) Check first: run docs/sql/check_knowledge_articles.sql or GET /api/front/tool/knowledge/stats
+-- 2) If (guide + article, published) counts are 0, run this once.
+-- Usage: mysql -u user -p your_db < docs/sql/seed_v2_knowledge_guide_article.sql
+-- Example (local): mysql -h 127.0.0.1 -u test_java -p test_java < docs/sql/seed_v2_knowledge_guide_article.sql
+
+INSERT INTO `v2_knowledge` (
+ `title`, `content`, `summary`, `cover_image`, `type`, `category`,
+ `view_count`, `like_count`, `collect_count`, `share_count`, `status`,
+ `is_recommend`, `sort_order`, `published_at`
+) VALUES
+-- 饮食指南 (type=guide)
+(
+ '慢性肾病饮食指南概述',
+ '
慢性肾病(CKD)患者需在医生或营养师指导下调整饮食,以延缓病情、减少并发症。
基本原则:适量优质蛋白、控制钾磷钠、限水(必要时)、充足热量。
',
+ 'CKD饮食基本原则:优质蛋白、控钾磷钠、限水与充足热量。',
+ NULL, 'guide', '饮食指南', 0, 0, 0, 0, 'published', 1, 10, NOW()
+),
+(
+ '优质蛋白怎么选',
+ '优质蛋白主要来自蛋、奶、瘦肉、鱼及大豆类。
非优质蛋白(如米面、部分豆类)需在总蛋白控制下搭配,避免加重肾脏负担。
',
+ '蛋奶瘦肉鱼及大豆为优质蛋白来源,需在总蛋白限量内合理选择。',
+ NULL, 'guide', '饮食指南', 0, 0, 0, 0, 'published', 1, 9, NOW()
+),
+(
+ '钾与磷的饮食控制要点',
+ '高钾食物:香蕉、橙子、土豆、番茄、深色蔬菜等,需根据血钾水平限量和焯水去钾。
高磷食物:奶制品、坚果、动物内脏、全谷等,需配合磷结合剂与饮食控制。
',
+ '高钾高磷食物识别与限量、焯水去钾等实用要点。',
+ NULL, 'guide', '饮食指南', 0, 0, 0, 0, 'published', 1, 8, NOW()
+),
+-- 科普文章 (type=article)
+(
+ '认识慢性肾病分期与营养',
+ 'CKD 1–5期营养重点不同:早期注重预防与均衡,中晚期需严格控蛋白、钾、磷、钠及液体。
定期复查并与营养师沟通,制定个体化饮食方案。
',
+ '各分期营养侧重点与个体化饮食方案简介。',
+ NULL, 'article', '科普', 0, 0, 0, 0, 'published', 1, 10, NOW()
+),
+(
+ '透析患者一日饮食安排建议',
+ '透析日与非透析日可在营养师指导下微调蛋白与液体。
建议定时定量、少盐少油、适量优质蛋白,并注意钾磷控制。
',
+ '透析患者日常饮食安排与注意事项。',
+ NULL, 'article', '科普', 0, 0, 0, 0, 'published', 1, 9, NOW()
+);
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/interceptor/SwaggerInterceptor.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/interceptor/SwaggerInterceptor.java
index fcb0776..bb43420 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/interceptor/SwaggerInterceptor.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/interceptor/SwaggerInterceptor.java
@@ -6,8 +6,6 @@ import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-import sun.misc.BASE64Decoder;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -34,6 +32,14 @@ public class SwaggerInterceptor extends HandlerInterceptorAdapter {
this.password = password;
this.check = check;
}
+
+ public String getUsername() { return username; }
+ public void setUsername(String username) { this.username = username; }
+ public String getPassword() { return password; }
+ public void setPassword(String password) { this.password = password; }
+ public Boolean getCheck() { return check; }
+ public void setCheck(Boolean check) { this.check = check; }
+
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String authorization = request.getHeader("Authorization");
@@ -52,7 +58,7 @@ public class SwaggerInterceptor extends HandlerInterceptorAdapter {
public boolean httpBasicAuth(String authorization) throws IOException {
if(check){
if (authorization != null && authorization.split(" ").length == 2) {
- String userAndPass = new String(new BASE64Decoder().decodeBuffer(authorization.split(" ")[1]));
+ String userAndPass = new String(java.util.Base64.getDecoder().decode(authorization.split(" ")[1]));
String username = userAndPass.split(":").length == 2 ? userAndPass.split(":")[0] : null;
String password = userAndPass.split(":").length == 2 ? userAndPass.split(":")[1] : null;
return this.username.equals(username) && this.password.equals(password);
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/page/CommonPage.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/page/CommonPage.java
index 7f4d9d2..49e9c23 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/page/CommonPage.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/page/CommonPage.java
@@ -2,7 +2,6 @@ package com.zbkj.common.page;
import com.zbkj.common.constants.Constants;
import com.github.pagehelper.PageInfo;
-import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Page;
@@ -15,7 +14,6 @@ import java.util.List;
* | Author:ScottPan
* +----------------------------------------------------------------------
*/
-@Data
public class CommonPage {
private Integer page = Constants.DEFAULT_PAGE;
private Integer limit = Constants.DEFAULT_LIMIT;
@@ -23,6 +21,16 @@ public class CommonPage {
private Long total = 0L ;
private List list = new ArrayList<>();
+ public Integer getPage() { return page; }
+ public void setPage(Integer page) { this.page = page; }
+ public Integer getLimit() { return limit; }
+ public void setLimit(Integer limit) { this.limit = limit; }
+ public Integer getTotalPage() { return totalPage; }
+ public void setTotalPage(Integer totalPage) { this.totalPage = totalPage; }
+ public Long getTotal() { return total; }
+ public void setTotal(Long total) { this.total = total; }
+ public List getList() { return list; }
+ public void setList(List list) { this.list = list; }
/**
* 将PageHelper分页后的list转为分页信息
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/ArticleSearchRequest.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/ArticleSearchRequest.java
index 33e2821..a49bbfb 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/ArticleSearchRequest.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/ArticleSearchRequest.java
@@ -35,4 +35,12 @@ public class ArticleSearchRequest implements Serializable {
@ApiModelProperty(value = "搜索关键字")
private String keywords;
+ public String getCid() {
+ return cid;
+ }
+
+ public String getKeywords() {
+ return keywords;
+ }
+
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/PageParamRequest.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/PageParamRequest.java
index e215db4..ad4cb4b 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/PageParamRequest.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/PageParamRequest.java
@@ -19,4 +19,12 @@ public class PageParamRequest {
@ApiModelProperty(value = "每页数量", example = Constants.DEFAULT_LIMIT + "")
private int limit = Constants.DEFAULT_LIMIT;
+ public int getPage() {
+ return page;
+ }
+
+ public int getLimit() {
+ return limit;
+ }
+
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuRequest.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuRequest.java
index 680b8c3..5920800 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuRequest.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuRequest.java
@@ -64,5 +64,40 @@ public class SystemMenuRequest implements Serializable {
@NotNull(message = "显示状态不能为空")
private Boolean isShow;
+ public Integer getId() {
+ return id;
+ }
+
+ public Integer getPid() {
+ return pid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public String getPerms() {
+ return perms;
+ }
+
+ public String getComponent() {
+ return component;
+ }
+
+ public String getMenuType() {
+ return menuType;
+ }
+
+ public Integer getSort() {
+ return sort;
+ }
+
+ public Boolean getIsShow() {
+ return isShow;
+ }
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuSearchRequest.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuSearchRequest.java
index 2555148..83e568f 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuSearchRequest.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/request/SystemMenuSearchRequest.java
@@ -22,4 +22,12 @@ public class SystemMenuSearchRequest {
@ApiModelProperty(value = "菜单类型:M-目录,C-菜单,A-按钮")
@StringContains(limitValues = {"M","C","A"}, message = "未知的菜单类型")
private String menuType;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getMenuType() {
+ return menuType;
+ }
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/CozeBaseResponse.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/CozeBaseResponse.java
index 1a427ba..4a7dbf3 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/CozeBaseResponse.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/CozeBaseResponse.java
@@ -2,16 +2,7 @@ package com.zbkj.common.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-/**
- * Coze API 统一响应
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
@ApiModel(value = "CozeBaseResponse", description = "Coze API 统一响应")
public class CozeBaseResponse {
@@ -24,15 +15,60 @@ public class CozeBaseResponse {
@ApiModelProperty(value = "响应数据")
private T data;
+ public CozeBaseResponse() {
+ }
+
+ public CozeBaseResponse(Integer code, String message, T data) {
+ this.code = code;
+ this.message = message;
+ this.data = data;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+
public static CozeBaseResponse success(T data) {
- return new CozeBaseResponse<>(200, "success", data);
+ CozeBaseResponse response = new CozeBaseResponse<>();
+ response.setCode(200);
+ response.setMessage("success");
+ response.setData(data);
+ return response;
}
public static CozeBaseResponse error(Integer code, String message) {
- return new CozeBaseResponse<>(code, message, null);
+ CozeBaseResponse response = new CozeBaseResponse<>();
+ response.setCode(code);
+ response.setMessage(message);
+ response.setData(null);
+ return response;
}
public static CozeBaseResponse error(String message) {
- return new CozeBaseResponse<>(500, message, null);
+ CozeBaseResponse response = new CozeBaseResponse<>();
+ response.setCode(500);
+ response.setMessage(message);
+ response.setData(null);
+ return response;
}
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/MenusResponse.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/MenusResponse.java
index a1f153f..dbb7288 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/MenusResponse.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/MenusResponse.java
@@ -2,9 +2,6 @@ package com.zbkj.common.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
@@ -15,9 +12,6 @@ import java.util.List;
* | Author:ScottPan
* +----------------------------------------------------------------------
*/
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
@ApiModel(value="MenusResponse对象", description="系统左侧菜单对象")
public class MenusResponse implements Serializable {
@@ -49,4 +43,23 @@ public class MenusResponse implements Serializable {
@ApiModelProperty(value = "子对象列表")
private List childList;
+
+ public Integer getId() { return id; }
+ public void setId(Integer id) { this.id = id; }
+ public Integer getPid() { return pid; }
+ public void setPid(Integer pid) { this.pid = pid; }
+ public String getName() { return name; }
+ public void setName(String name) { this.name = name; }
+ public String getIcon() { return icon; }
+ public void setIcon(String icon) { this.icon = icon; }
+ public String getPerms() { return perms; }
+ public void setPerms(String perms) { this.perms = perms; }
+ public String getComponent() { return component; }
+ public void setComponent(String component) { this.component = component; }
+ public String getMenuType() { return menuType; }
+ public void setMenuType(String menuType) { this.menuType = menuType; }
+ public Integer getSort() { return sort; }
+ public void setSort(Integer sort) { this.sort = sort; }
+ public List getChildList() { return childList; }
+ public void setChildList(List childList) { this.childList = childList; }
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAICreateTaskResponse.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAICreateTaskResponse.java
index 04950e2..d921ad4 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAICreateTaskResponse.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAICreateTaskResponse.java
@@ -2,7 +2,6 @@ package com.zbkj.common.response.kieai;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
import java.io.Serializable;
@@ -13,7 +12,6 @@ import java.io.Serializable;
* | Author:ScottPan
* +----------------------------------------------------------------------
*/
-@Data
@ApiModel(value = "KieAI创建任务响应", description = "KieAI创建任务响应结果")
public class KieAICreateTaskResponse implements Serializable {
@@ -28,6 +26,13 @@ public class KieAICreateTaskResponse implements Serializable {
@ApiModelProperty(value = "响应数据")
private TaskData data;
+ public Integer getCode() { return code; }
+ public void setCode(Integer code) { this.code = code; }
+ public String getMsg() { return msg; }
+ public void setMsg(String msg) { this.msg = msg; }
+ public TaskData getData() { return data; }
+ public void setData(TaskData data) { this.data = data; }
+
/**
* 便捷方法:获取任务ID
*/
@@ -42,7 +47,6 @@ public class KieAICreateTaskResponse implements Serializable {
return code != null && code == 200;
}
- @Data
public static class TaskData implements Serializable {
private static final long serialVersionUID = 1L;
@@ -51,5 +55,10 @@ public class KieAICreateTaskResponse implements Serializable {
@ApiModelProperty(value = "记录ID", example = "5d5ba5bc66c11c1a97f719312c76a5df")
private String recordId;
+
+ public String getTaskId() { return taskId; }
+ public void setTaskId(String taskId) { this.taskId = taskId; }
+ public String getRecordId() { return recordId; }
+ public void setRecordId(String recordId) { this.recordId = recordId; }
}
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAINanoBananaResponse.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAINanoBananaResponse.java
index 82cde48..5a0a018 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAINanoBananaResponse.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAINanoBananaResponse.java
@@ -2,7 +2,6 @@ package com.zbkj.common.response.kieai;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
import java.io.Serializable;
@@ -12,7 +11,6 @@ import java.io.Serializable;
* | Author:ScottPan
* +----------------------------------------------------------------------
*/
-@Data
@ApiModel(value = "KieAI NanoBanana响应", description = "KieAI NanoBanana通用响应")
public class KieAINanoBananaResponse implements Serializable {
@@ -27,6 +25,13 @@ public class KieAINanoBananaResponse implements Serializable {
@ApiModelProperty(value = "响应数据")
private T data;
+ public int getCode() { return code; }
+ public void setCode(int code) { this.code = code; }
+ public String getMessage() { return message; }
+ public void setMessage(String message) { this.message = message; }
+ public T getData() { return data; }
+ public void setData(T data) { this.data = data; }
+
public static KieAINanoBananaResponse success(T data) {
KieAINanoBananaResponse response = new KieAINanoBananaResponse<>();
response.setCode(200);
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAIQueryTaskResponse.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAIQueryTaskResponse.java
index 95c1826..ae2b5ec 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAIQueryTaskResponse.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/response/kieai/KieAIQueryTaskResponse.java
@@ -2,9 +2,9 @@ package com.zbkj.common.response.kieai;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
import java.io.Serializable;
+import java.util.List;
/**
* KieAI 查询任务响应 DTO(新版 API v1)
@@ -13,7 +13,6 @@ import java.io.Serializable;
* | Author:ScottPan
* +----------------------------------------------------------------------
*/
-@Data
@ApiModel(value = "KieAI查询任务响应", description = "KieAI查询任务状态及结果")
public class KieAIQueryTaskResponse implements Serializable {
@@ -28,6 +27,13 @@ public class KieAIQueryTaskResponse implements Serializable {
@ApiModelProperty(value = "响应数据")
private TaskData data;
+ public Integer getCode() { return code; }
+ public void setCode(Integer code) { this.code = code; }
+ public String getMsg() { return msg; }
+ public void setMsg(String msg) { this.msg = msg; }
+ public TaskData getData() { return data; }
+ public void setData(TaskData data) { this.data = data; }
+
/**
* 便捷方法:获取任务ID
*/
@@ -59,7 +65,7 @@ public class KieAIQueryTaskResponse implements Serializable {
/**
* 便捷方法:获取结果URL数组
*/
- public java.util.List getResultUrls() {
+ public List getResultUrls() {
return data != null ? data.getResultUrls() : null;
}
@@ -70,7 +76,6 @@ public class KieAIQueryTaskResponse implements Serializable {
return code != null && code == 200;
}
- @Data
public static class TaskData implements Serializable {
private static final long serialVersionUID = 1L;
@@ -89,17 +94,9 @@ public class KieAIQueryTaskResponse implements Serializable {
@ApiModelProperty(value = "结果JSON(包含resultUrls)", example = "{\"resultUrls\":[\"https://...\"]}")
private String resultJson;
-
+
@ApiModelProperty(value = "结果URL数组(视频/图片地址)")
- private java.util.List resultUrls;
-
- /**
- * 显式添加 setter 方法以确保 Jackson 反序列化正常工作
- * 解决 "Problem deserializing 'setterless' property" 错误
- */
- public void setResultUrls(java.util.List resultUrls) {
- this.resultUrls = resultUrls;
- }
+ private List resultUrls;
@ApiModelProperty(value = "失败错误码")
private String failCode;
@@ -118,5 +115,30 @@ public class KieAIQueryTaskResponse implements Serializable {
@ApiModelProperty(value = "更新时间戳")
private Long updateTime;
+
+ public String getTaskId() { return taskId; }
+ public void setTaskId(String taskId) { this.taskId = taskId; }
+ public String getModel() { return model; }
+ public void setModel(String model) { this.model = model; }
+ public String getState() { return state; }
+ public void setState(String state) { this.state = state; }
+ public String getParam() { return param; }
+ public void setParam(String param) { this.param = param; }
+ public String getResultJson() { return resultJson; }
+ public void setResultJson(String resultJson) { this.resultJson = resultJson; }
+ public List getResultUrls() { return resultUrls; }
+ public void setResultUrls(List resultUrls) { this.resultUrls = resultUrls; }
+ public String getFailCode() { return failCode; }
+ public void setFailCode(String failCode) { this.failCode = failCode; }
+ public String getFailMsg() { return failMsg; }
+ public void setFailMsg(String failMsg) { this.failMsg = failMsg; }
+ public Long getCostTime() { return costTime; }
+ public void setCostTime(Long costTime) { this.costTime = costTime; }
+ public Long getCompleteTime() { return completeTime; }
+ public void setCompleteTime(Long completeTime) { this.completeTime = completeTime; }
+ public Long getCreateTime() { return createTime; }
+ public void setCreateTime(Long createTime) { this.createTime = createTime; }
+ public Long getUpdateTime() { return updateTime; }
+ public void setUpdateTime(Long updateTime) { this.updateTime = updateTime; }
}
}
diff --git a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/result/ResultAdvice.java b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/result/ResultAdvice.java
index c03f5a7..1f7fd09 100644
--- a/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/result/ResultAdvice.java
+++ b/msh_crmeb_22/crmeb-common/src/main/java/com/zbkj/common/result/ResultAdvice.java
@@ -1,8 +1,8 @@
package com.zbkj.common.result;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.zbkj.common.annotation.CustomResponseAnnotation;
-import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
@@ -49,11 +49,14 @@ public class ResultAdvice implements ResponseBodyAdvice