From f5da89af8f72f1d4042fc92b26a15eda9350aeed Mon Sep 17 00:00:00 2001 From: hajimi Date: Fri, 29 May 2026 22:04:21 +0800 Subject: [PATCH] feat: sync worldcup translations and ai comments --- docs/sql/create_la_article_ai_comment_task.sql | 16 ++++++++++++++++ docs/sql/insert_crontab_article_ai_comment.sql | 8 ++++++++ server | 2 +- uniapp | 2 +- 业务进度管理.md | 10 ++++++++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 docs/sql/create_la_article_ai_comment_task.sql create mode 100644 docs/sql/insert_crontab_article_ai_comment.sql diff --git a/docs/sql/create_la_article_ai_comment_task.sql b/docs/sql/create_la_article_ai_comment_task.sql new file mode 100644 index 0000000..bb5b0a4 --- /dev/null +++ b/docs/sql/create_la_article_ai_comment_task.sql @@ -0,0 +1,16 @@ +CREATE TABLE IF NOT EXISTS `la_article_ai_comment_task` ( + `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `article_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '文章ID', + `virtual_user_id` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '虚拟用户ID', + `comment_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '评论内容', + `run_at` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '计划执行时间', + `status` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态 0-待执行 1-已执行 2-失败', + `error_msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '错误信息', + `create_time` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + `delete_time` int UNSIGNED NULL DEFAULT NULL COMMENT '删除时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_article_status_runat`(`article_id` ASC, `status` ASC, `run_at` ASC) USING BTREE, + INDEX `idx_virtual_user`(`virtual_user_id` ASC) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '文章AI评论任务队列表' ROW_FORMAT = Dynamic; + diff --git a/docs/sql/insert_crontab_article_ai_comment.sql b/docs/sql/insert_crontab_article_ai_comment.sql new file mode 100644 index 0000000..a48ddf2 --- /dev/null +++ b/docs/sql/insert_crontab_article_ai_comment.sql @@ -0,0 +1,8 @@ +INSERT INTO `la_dev_crontab` (`name`, `type`, `system`, `remark`, `command`, `params`, `status`, `expression`, `create_time`, `update_time`) +SELECT '资讯AI评论投放', 1, 0, '轮询文章AI评论任务队列,生成并落库虚拟评论', 'article_ai_comment', '', 1, '*/5 * * * *', UNIX_TIMESTAMP(), UNIX_TIMESTAMP() +WHERE NOT EXISTS ( + SELECT 1 FROM `la_dev_crontab` + WHERE `command` = 'article_ai_comment' + AND `delete_time` IS NULL +); + diff --git a/server b/server index d9193b7..187d583 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit d9193b7e2ddeb42cbe55a9fc1dbc35f2b755afe0 +Subproject commit 187d583d217f5c4ebd162fe45dd7bd03253a2690 diff --git a/uniapp b/uniapp index 7d1787e..1b777c1 160000 --- a/uniapp +++ b/uniapp @@ -1 +1 @@ -Subproject commit 7d1787ec06d952e90e29fdf336ffb76a2389d7f7 +Subproject commit 1b777c1c346b779b78e39e502941d147f41a56f8 diff --git a/业务进度管理.md b/业务进度管理.md index 3c9c797..4371cce 100644 --- a/业务进度管理.md +++ b/业务进度管理.md @@ -256,3 +256,13 @@ ### 36. 世界杯专题新闻翻译摘要预览 - 2026-05-29:`uniapp/src/components/feed-card/feed-card.vue` 与 `uniapp/src/components/feed-video-card/feed-video-card.vue` 的首页世界杯翻译区改为摘要预览,不再全量展开正文。 - 2026-05-29:`uniapp/src/packages_match/components/WorldCupPanel.vue` 的世界杯专题新闻列表翻译块同步改为摘要预览,保持卡片高度稳定,避免整段译文撑开列表。 + +### 37. 世界杯翻译展示纯文本换行化 +- 2026-05-29:将世界杯专题右上角入口调整为“其他赛事”,点击后回到赛事中心视图,并移除原右下角悬浮返回按钮。 +- 2026-05-29:`uniapp/src/components/feed-card/feed-card.vue`、`uniapp/src/components/feed-video-card/feed-video-card.vue`、`uniapp/src/pages/news_detail/news_detail.vue`、`uniapp/src/packages_community/components/post-card.vue`、`uniapp/src/packages_community/pages/post_detail.vue` 的翻译展示统一改为原文后换行的纯文本译文,去掉独立 AI 翻译框/卡片。 +- 2026-05-29:`server/app/api/controller/CommunityController.php` 补充了特朗普帖子详情的翻译缓存兜底,确保列表与详情都能直接拿到 `translated_content`。 + +### 38. 资讯 AI 评论任务入库 +- 2026-05-29:新增 `article_ai_comment` 控制台命令、`la_article_ai_comment_task` 任务队列表以及 `docs/sql/insert_crontab_article_ai_comment.sql`,用于轮询并投放资讯 AI 评论。 +- 2026-05-29:新增虚拟账号池复用逻辑,账号使用 `ai_comment_` 前缀、昵称使用 `AI评论员` 前缀,避免额外扩张用户表结构。 +- 2026-05-29:AI 评论内容通过 `AiService::generateArticleComment()` 基于标题、摘要和正文生成专业评论,到点后再落库到 `la_article_comment` 并同步评论数。