Commit Graph

157 Commits

Author SHA1 Message Date
d5a08db56c feat:添加存储空间 2026-07-29 16:03:33 +08:00
zerosaturation
3d984f19cd feat(asset-detail): pull-down/up card gestures with smooth follow
Add AssetCardPullExpand component for locked-state display and wire
up/down gesture symmetry on the asset detail page.

Down-pull at top of list:
- card scales 1.0 -> 1.6 with translateY follow, sibling modules fade
  out, hint text '下拉查看大图' -> '松手查看大图' past 80rpx
- on release past threshold, viewMode flips to expanded

Up-pull in expanded state:
- card shrinks 1.6 -> 1.0 with translateY follow, sibling modules fade
  back in, hint text '上拉收起' -> '松手收起' past 80rpx
- on release past threshold, viewMode flips back to normal
- the locked scale(1.6) lives on the wrapper so the release animation
  stays single-jump, not dual-jump

Implementation:
- AssetCardPullExpand renders the card at scale(1) and exposes isExpanded
  for the parent's locked-state toggle (showMask prop gates the legacy
  full-screen tap-to-collapse overlay)
- both gesture surfaces use lazy startY capture in onMove to avoid
  tap-induced jumps; no CSS transition on the wrapper during active pull
- 0.15s transform transition smooths the release interpolation only
- header bar and report/share buttons stay visible in both states;
  v-if/v-else-if/v-else chain (loading -> error -> expanded -> scroll-view)
  preserved; existing 8 card class names and parent CSS untouched

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 14:13:39 +08:00
zerosaturation
89d5d12450 fix(task): backfill id=1/2 trigger_event + cleanup misleading NULL comments
daily_browse_asset (id=2) / daily_login (id=1) 之前永远不触发,根因:
2026_07_21_004 迁移只 backfill 了 id=3/4 的 trigger_event=task_key,
id=1/2 留 NULL。但 ProcessTaskEvent 引擎按 trigger_event = ? 严格匹配
(spec §4 单一隔离单元),NULL 不会命中,前端 reportEvent 后引擎跑空
循环、daily-tasks 任务永远 pending。

修复:
- 新增 2026_07_27_005 迁移:回填 id=1/2 的 trigger_event=task_key(幂等)
- 修订原 004 迁移的错误注释('trigger_event 留 NULL'误导后人)
- model/task_models.go:删除 'NULL 仍走 def.TaskKey 兜底' 不实承诺
- impl plan §37/39:修订错描述('暂不依赖 trigger_event 列')
- docker/init-db.sql:124668/124671:重建 dev DB 时也带 trigger_event
- daily_task_repo_test.go:补 2 个回归测试
  - NullTriggerEvent_NotMatched:trigger_event=NULL 时查不到
  - TriggerEventEqualsTaskKey_Matches:trigger_event=task_key 时能命中

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 16:36:40 +08:00
zerosaturation
4284775ed6 docs(daily-task): 修订设计 spec + 新增实施计划
- specs/2026-07-21-daily-task-config-driven-design.md: 修订 8 处反映实施反馈
  (frontend 入口迁移、TaskEventPayload 路径、emit 失败仅 Warn 等)
- plans/2026-07-21-daily-task-config-driven-impl.md: 新增 8 阶段实施计划
  (A schema → B 事件目录 → C 完成引擎 → D 事件接入 → E 重置 → F 测试 → G 部署 → H 验收)
  时序与 spec §4 子章节对齐

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 15:47:24 +08:00
zerosaturation
383b5e042e docs(starbook): add has_more design spec and implementation plan
记录星册首页 More 按钮恢复的方案说明与 TDD 实施计划,作为本次特性 commit e079a6c 的设计依据。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 19:20:32 +08:00
zerosaturation
d3b57e3058 docs: add starbook-recovery implementation plan (2026-07-24)
- 5 Task plan: proto 加 GetAssetsByType RPC (只改 .pb.go 不动 .triple.go);
- assetService provider 实现新 handler;
- gateway 重建 starbook_controller.go 薄壳(接口零变, owner→assetService);
- 路由注册 + main.go 装配;
- 端到端验证;
- 由于 Task 2 误删,本 plan 完整回滚 + 重建,前端 4 处调用零修改。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-24 14:05:01 +08:00
zerosaturation
d026102a91 docs: backend audit report 2026-07-21 (findings + corrections)
后端全面审查报告:微服务耦合/边界、配置、各服务正确性与安全问题分级(P0/P1/P2),
含数据库实测复核(§七 结算超发/累计时长)与多处复核更正(peripheral 密钥、social OR)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-23 01:11:13 +08:00
zerosaturation
d5103f7043 docs:新增后端bug修改文档 2026-07-21 21:14:22 +08:00
zerosaturation
c0b577dd40 feat:增加邮箱管理功能 2026-07-14 21:59:15 +08:00
zerosaturation
6425cbf747 docs(spec): 站内邮箱聚合收件箱设计 (v1.2.10)
10 轮迭代后定稿:
- 复用 notifications 表,扩 type 白名单 4 类
- like 暂不进邮箱 (保留旧 push 体验)
- 前端两页路由 pages/mailbox/{index,detail}.vue
- profile.vue 服务与工具 section 加入口 + Vuex getter inboxUnreadOnly
- uniPush receive + payload 含 unreads_by_type 零轮询
- 三道防线节流 (60s/10s + Vuex 幂等)
- +N 通知聚合
- 4 emitter + DELETE /notifications/clear
- 实施路径 ~3.7d

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 13:48:52 +08:00
zerosaturation
74853800b6 feat:增加二维码验证真伪的功能 2026-07-13 11:22:56 +08:00
345a22e5fa docs:增加周边扫描功能 2026-07-10 12:35:12 +08:00
zerosaturation
e5bd0c854c feat:增加忘记密码的功能 2026-07-09 19:00:03 +08:00
zerosaturation
31eee930ca feat:去掉无用的函数方法 2026-07-09 16:08:25 +08:00
fbf3e6c63c feat:增加分享页下载 2026-07-09 15:49:06 +08:00
5625f6ac28 feat:增加预加载接口 2026-07-09 13:27:25 +08:00
ce1ef491f8 feat:增加uniapp更新页面 2026-07-07 14:44:23 +08:00
zerosaturation
a1e92448f1 feat:修改陀螺仪控制为手动控制 2026-07-06 21:20:24 +08:00
66d226948f Merge pull request 'feat/actvity' (#4) from feat/actvity into dev
Reviewed-on: https://git.liantu.tech/xiaoyu/topfans/pulls/4
合并feat/actvity
2026-07-03 16:28:30 +00:00
zerosaturation
d12a84c1f0 feat:增加队列修改收益方面把轮询改为MQ队列,修改数据看板的数据问题出错 2026-07-03 12:34:55 +08:00
4eab42b3fb feat:改为加速度计优化 2026-07-02 19:05:54 +08:00
Lenticular Studio Agent
65ce6bba12 feat: Dify 部署脚本修复 + AI 搭子 MVP 接入
主要改动:

fix(docker/dify-deploy): 修复脚本核心功能
- heredoc 单引号 bug: 'ENVEOF' 改为 ENVEOF,变量正确展开
- 端口默认值 8083/8084/8085 对齐 .env.prod 生产配置
- 加 dc_cmd() 兼容 docker-compose v1/v2 plugin
- openssl rand 生成强随机密码与 SECRET_KEY(42 字符)
- install 跳过已存在 .env,保护用户配置(管理员密码/SECRET_KEY)
- read -p < /dev/tty 兼容非 tty 环境(CI/CD)
- show-config 改用 DIFY_NGINX_PORT(nginx 入口)而非 APP_WEB_PORT

docs(mvp-design): 修正 §3.2 workflow inputs 描述
- 实际只有 query,删除错误的 user_id input 声明
- 节点序列图同步更新

feat(aiChatService): 新增 Dify 客户端与适配器
- service/dify_client.go: Dify Workflow 调用 + SSE 解析
- service/dify_adapter.go: 与现有 chat_service 桥接
- provider/ai_chat_provider.go: Dubbo 入口简化
- main.go: 装配 ConversationRepository + DifyClient

feat(migrations): 新增 AI 搭子会话表 ai_chat.sql
- ai_conversations / ai_messages 表 + 索引

docs: 新增 Dify 集成设计文档
- 2026-06-29-ai-chat-dify-mvp-design.md (MVP 实施级)
- 2026-06-29-ai-chat-dify-integration-v2-design.md (V2 演进路线图)
- docs/dify/角角.yml (Workflow DSL 导出)

config: 更新 env 模板与 docker 配置
- backend/.env.example: DIFY_* 环境变量声明
- docker/.env.prod: DIFY_API_BASE 对齐 8083
- docker/build.sh: 微调
- CLAUDE.md: 项目规范补充

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-02 12:32:34 +08:00
zerosaturation
2032246fd0 feat:增加分享界面,完善的保存图片功能 2026-06-26 16:45:29 +08:00
zerosaturation
0d6b7a9e95 feat:增加购买道具的聚合功能 2026-06-24 19:51:13 +08:00
Lenticular Studio Agent
fd5e317e05 merge: 解决 docker-compose 和 SocketManager 冲突
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 23:06:24 +08:00
Lenticular Studio Agent
67cf3d4177 chore: 清理 laserCompositor 微服务残留
- 删除已弃用的 compositor_client.go
- 删除激光合成微服务代码
- 添加 gateway 合成控制器和测试文件
- 添加 Dify prompt 补丁脚本

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 22:44:03 +08:00
Lenticular Studio Agent
af7908e72e feat: 接入微达API中转站,重构镭射卡生图流程
- 替换中转站从 xbcl.link 到 weda.cc
- prompt 模板改为镭射卡全图生成(去掉 6 层合成/抠图依赖)
- 4 路并发调用 + 原图展示 = 5 张 variant
- 前端提示词中译英支持
- 全局 Vue errorHandler
- WebSocket 鉴权失败跳登录
- 删除已弃用的 laserCompositor 微服务

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 22:43:49 +08:00
zerosaturation
12571eedba feat:修改活动弹窗bug 2026-06-23 18:57:50 +08:00
zerosaturation
75ab617c6c feat:增加实时留言功能和修改轮询道具购买记录显示改为websocket显示 2026-06-23 18:13:55 +08:00
zerosaturation
b4d34f9ec1 docs:增加文档 2026-06-22 20:02:00 +08:00
zerosaturation
7eb6dad434 feat:新增举报和反馈功能 2026-06-22 17:19:48 +08:00
zerosaturation
7074546959 feat:新增通知系统 2026-06-16 21:30:58 +08:00
zerosaturation
d9473fda7a docs:修改文档 2026-06-16 02:45:19 +08:00
zerosaturation
271e0350c7 feat:重构code状态码 2026-06-15 16:28:35 +08:00
f30655ec64 feat:添加压测工具脚本 2026-06-15 15:28:25 +08:00
zerosaturation
ddb3620eb1 feat: 修改星河,星榜的样式 2026-06-15 12:07:56 +08:00
zerosaturation
942dee0fa8 docs:增加文档 2026-06-12 17:00:46 +08:00
3b14922e48 docs(plan): 修复 4 个真实编译风险 + 1 个范围声明
- Task 3.3: 补 rate-limit 函数(IncrMobileCount/IncrIPCount 等)
  场景化,11 个函数完整列出
- Task 4: 加 4.4-4.6 修复 auth_provider.go / unified_provider.go /
  auth_controller.go 调用点(否则编译失败);修订'明确不动'列表
- Task 4.3: 引入 VerifyTokenFn package-level var DI 模式(让
  Task 6.2 的 setupVerifyTokenMock 可工作)
- Task 6.3: 改用 VerifyTokenFn 注入调用,匹配 DI 模式
- Task 7: 5 PASS + 5 SKIP 明确分工(避免验收标准误导)
- Task 10.2: 完整 import 块 + 用 errors.Is 标准库 + pbCommon 别名
- 依赖图:刷新编号,前端 Task 9/11 可独立推进说明
- 验收标准:5 PASS + 5 SKIP 标注
2026-06-12 15:18:40 +08:00
ae6dabba69 docs(plan): 修改密码功能实现计划 - 12 个 Task
- Task 1: proto 加 verify_token + regen
- Task 2: errors.go 新增错误码 + ToStatusCode errors.Is 改造
- Task 3: SMS Redis key scene-aware 重构
- Task 4: SMS service SendCode/VerifyCode/VerifyToken 加 scene
- Task 5: auth_service.Register 调用点更新
- Task 6: user_service.UpdatePassword 完整实现(TDD)
- Task 7: password_test 10 个测试骨架
- Task 8: user_provider 透传 ctx
- Task 9: api.js 拦截器去 400 自动登出
- Task 10: auth_service.Login BUG 修复 + 2 测试
- Task 11: profile.vue 改密弹窗 5 UI 区 + handler + CSS
- Task 12: 回归 + 灰度发布

总览:
- 12 个 task,每 task 含文件路径+步骤+命令
- TDD 优先,frequent commits
- 任务依赖图清晰,可识别可并行项
- 验收标准 12 条
2026-06-12 15:13:53 +08:00
b15788d1fc docs(change-password): 全面检查 - 5 issues
- §3.1 序列图弹窗描述过长 -> 简化为'5个UI区'
- §4.3 GetByID 错误处理用 '...' 省略 -> 补完整(NotFound/wrap)
- §4.5 错误映射表 - 删除重复的 ErrPasswordTooShort 行
- §10 文件变更总览 - 补 auth_service_login_test.go (§12.4 新增)
- §11 部署清单 - 增 'API 接口回归' 和 '登录态回归' 重点
  (401 不变,403 上升,500 下降)
2026-06-12 15:03:38 +08:00
397ebed805 docs(change-password): 自审修复 - 7 issues
🔴 高 (4):
1. §3.1 序列图'6 UI 区' -> '5 UI 区'(实际是 1+1+3=5)
2. §4.3 'service.VerifyToken' 错误引用 -> 'VerifyToken' (同包)
3. §5.3.3 confirmChangePassword else 分支是死代码
   (api.js 业务码 400 时 reject 跳到 catch),删除 else 分支
4. §5.3.3 setInterval 倒计时无 cleanup
   - 新增 codeCountdownTimer ref
   - handleSendCode 存 timer,清旧 timer
   - closePasswordModal 清 timer

🟡 中 (2):
5. §4.3 事务内代码 // 原逻辑保持 占位 -> 补完整
   (password_hash + updated_at + access_token=nil 分两步)
6. §4.5 ErrUserInactive 描述'不变'不准 -> 改为'修复'
   (此前 default 500,本次 403),并补完整 ToStatusCode 函数代码

🟢 低 (1):
7. §12.5 状态码重构 spec 描述'草稿' -> '已 Approved'
2026-06-12 13:43:34 +08:00
e52f46e50f docs(status-code): 合并 5 个 review advisory 修复
- §7.1 测试表 #9/#10 重复行清理
- §6.1 增加 Phase 0a Dubbo 探针(验证 dubbo-go-pixiu/triples
  对 gRPC code->HTTP status 的实际行为,影响 gateway 拦截器策略)
- §6.3 Day 4 与 §5.1 冲突修复(老前端拦截器保持不变,只新业务代码引入 getGrpcCode)
- §5.4 / §8 文件数 '10+/15+/12+' 统一为 'TBD pending audit'
- §10 E2E 测试细化(3 类断言);增加'第三方客户端风险通知'清单项
2026-06-12 13:37:39 +08:00
7c897ec4e0 docs(status-code): 自审修复 - 12 个问题
🔴 严重 (2):
1. "双协议期"实际无法双协议: 原设计 code=gRPC 会破坏老前端(它们读 code 期望 HTTP 码)
   - 修订: code 字段保持 HTTP 镜像码不变,新增 grpc_code 字段;老前端零改动
2. Gateway 拦截器只改 header 不改 body: Dubbo 已把 gRPC code 写进 body 字段
   - 修订: 用 responseRecorder 完整捕获 body,重写 header 200 后回写

🟡 高 (3):
3. errors.go 代码块缺 import (status, strings)
4. responseRecorder 类型引用但未定义 -> 补充完整类型定义
5. ErrInvalidOldPassword (change-password spec §4.5 新增) 未在 ToStatusCode/ToGRPCCode 映射
   - 修订: 同步加到两个函数的 InvalidArgument 分支
6. ErrUserInactive 此前 fall into default 500 -> 现在映射到 PermissionDenied (修复)

🟢 中 (4):
7. ToStatusCode 函数需要保留作为兼容(原 spec 说删) -> 保留并补 case
8. NewError 函数引用 status 但无 import -> 补 import
9. 缺 AuthMiddleware 与 GRPCStatusInterceptor 中间件链顺序说明
10. Phase 0 描述与实际实现对齐(保留 ToStatusCode)

🔵 低 (3):
11. grep 命令可能漏掉 raw 数字赋值 -> 补 grep -rn 'Code:\s*uint32...'
12. 全文清理 legacy_code / ToLegacyCode 残留
13. §3.4 完整响应流示例更新为新设计(code+grpc_code)
14. §5.1 getBizCode helper 改为新增 getGrpcCode helper,老前端拦截器不动
15. §6.1 Phase 0 描述对齐,Phase 3 清理描述对齐
16. §10 部署清单更新
2026-06-12 13:30:53 +08:00
fd763298c7 docs(status-code): 重构设计 - google.rpc.Code 标准化 + 双协议期迁移
核心:
- proto: BaseResponse.code 改用 google.rpc.Code 数字 (0/3/5/7/8/13/16)
- proto: 新增 legacy_code 字段保留旧 HTTP 镜像码(过渡期用)
- errors.go: 重写 ToStatusCode -> ToGRPCCode + ToLegacyCode,全面用 errors.Is
- service: 所有硬编码 StatusCode_STATUS_X 改为 status.Error(codes.X, msg)
- gateway: 新增拦截器强制 HTTP 200,剥除 Dubbo 自动 gRPC->HTTP 转换
- 前端: api.js 拦截器重写,优先读 code 兼容 legacy_code

迁移: 双协议期 4 阶段(准备/双协议/前端升级/清理),约 4 sprint
执行顺序: 先实现 change-password spec,再启动本重构

与 change-password spec 协同:
- §4.5 错误码映射自动升级为 gRPC code
- §5.1 拦截器修复方案被本设计自然吸收
- §12 Login BUG 修复(ToGRPCCode 用 errors.Is)作为前置依赖
2026-06-12 13:20:29 +08:00
8c90de5b08 docs(change-password): 追加 §12 顺带修复 Login 账号状态码 BUG
问题: auth_service.go Login 流程被冻结/封禁时用 fmt.Errorf/errors.New
返回 generic error,落到 ToStatusCode default 分支 -> 500 而非 403

修复:
- errors.go: 新增 NewAccountBannedError / NewAccountFrozenError 2 helper,
  保留 typed error 身份但允许附加 reason / frozenUntil 信息
- errors.go: ToStatusCode 改用 errors.Is 全面识别 wrapped error
  (一处 switch 大改造,使其他 service 中已有的 fmt.Errorf("%w") 自动受益)
- auth_service.go: Login 流程 2 处 return 改用 helper
- auth_service_login_test.go (新建或追加): 2 个新单测验证 403 行为
2026-06-12 13:04:11 +08:00
e5d5808a84 docs(change-password): 架构级修正 - 状态码语义替代白名单方案
按用户反馈,BUG #1 修复应从状态码语义入手,而非前端 URL 白名单:

后端修订 (§4.5):
- ErrInvalidVerifyToken: 401 -> 400 (业务校验,非鉴权)
- 新增 ErrInvalidOldPassword: 400 (改密场景下旧密码错)
- 保留 ErrInvalidPassword (Login 用) = 401 不变
- 关键原则:已登录态下的业务校验都走 400

前端简化 (§5.1):
- 拦截器去掉 NO_AUTO_LOGOUT_PATHS 白名单
- 只对 401 (token 失效) / 403 (账号被封) 自动登出
- 400 类业务错误统一 toast,让用户重试

同步:
- §4.3 service 代码:用 ErrInvalidOldPassword 替代 ErrInvalidPassword
- §4.6 测试用例 #5:用 ErrInvalidOldPassword
- §6.2 手动测试 #2:旧密码错返回 400
- §7 错误码表:增加是否触发自动登出列,统一规则
- §10 文件列表:errors.go 新增 3 错误码,api.js 改为非白名单改造
- §1.1 BUG #1 描述同步更新
2026-06-12 12:51:47 +08:00
0a3d8e0afc docs(change-password): 合并 7 个 second-pass issues
- 3.1 序列图:补 GetByID 调用,与 §4.3 一致
- 4.2: 加 call-site 审计 grep 命令 + 已确认 9 文件列表
- 4.6: 补 mocking 模式代码示例 + Test #9 错误类型规约
- 5.3.3: 解释手动 removeStorageSync 的原因(store 不清 temp_register_*)
- 5.3.4: 补 updatePasswordApi 调用点审计(2 文件已确认)
- 9: 补 AuthMiddleware 已挂载,前端凭 token 即可访问
2026-06-12 12:41:56 +08:00
c875151daa docs(change-password): 修复合并 5 个 spec review issues
- 4.2: 明确 VerifyToken 函数改造为 (ctx, scene, mobile, token)
- 4.3: 补 scene="password" 传入,加 scene 一致性注释
- 5.3.4: 确认 sendCodeApi/verifyCodeApi 已支持 scene,updatePasswordApi 需扩展为 3 参数
- 7: 增加 401 业务码多义性说明,提示 res.message 必须稳定
- 10: auth_service.go 改动明确为 Register 中 VerifyToken 调用加 scene 参数
2026-06-12 12:36:29 +08:00
e8061c7d05 docs(change-password): 设计文档 - 旧密码+短信双保险+修复3 BUG
- 后端:proto 加 verify_token,SMS Redis key 场景化,Service 加 verify_token 校验+新旧密码一致性
- 前端:BUG#1 拦截器白名单修复、BUG#2 补 APP介绍 handler、BUG#3 加前端校验
- 新增 2 个错误码:ErrInvalidVerifyToken、ErrSameAsOldPassword
- 后端单测覆盖矩阵 10 条
- 前端手动验证 checklist 10 条
2026-06-12 11:51:09 +08:00
claude
a595440915 docs(moderation): 自审修复 - target_type 命名/跨schema/Lua lock/补流程 2026-06-11 21:50:58 +08:00