Commit Graph

100 Commits

Author SHA1 Message Date
zerosaturation
27313f414a feat(profile): render level progress bar in LV box
profile.vue only rendered fan level digit, hiding the fact that
fans level up via accumulated exhibition hours (6h/level, cap 20),
not login/task experience. Users saw "LV X" without "X more
hours to next level", so upgrades felt invisible.

- backend: surface exhibition_hours / next_level_hours on
  CurrentIdentityDTO via a new loadLevelProgress helper in
  user_controller (read-only, no proto regen, no service
  surface change). Full-level responses set next_level_hours =
  exhibition_hours so the client can derive progress=1.
- frontend: split level-box into base track + gold fill + text
  overlay; width bound to progressRatio with 0.4s transition.
  Adds "距 LV X+1 还差 N 小时" hint and MAX indicator for
  full-level users.
2026-07-27 18:02:59 +08:00
zerosaturation
e079a6c2e2 feat(asset): restore starbook home More button by Asset.LikeCount ordering
starbook 首页每个 grade/group 按 Asset.LikeCount DESC, Asset.ID ASC 取前三张,超三显示 has_more;
GetAssetsByType 不截断返回全部匹配项。包含:
- proto/asset.proto 声明 GetAssetsByType RPC + 消息,重新生成 .pb.go/.triple.go
- gateway starbook controller 改用标准 AssetService 客户端
- assetService: 三个 build*GroupForAssets 增加 previewLimit 参数
- 新增 sortAndLimitAssetItems 共享助手
- 新增 asset_service_group_test.go DB-free 单测
- 新增 TestStarbookHomePreviewAndMoreUseAssetLikeRanking 端到端回归
- frontend pages/starbook/items.vue 适配嵌套 groups/grades/items 响应,单 grade 竖向展示

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 19:20:16 +08:00
zerosaturation
7ff2d5cdc4 fix(gateway): restore /api/v1/starbook/* via assetService (recovery from Task 2 over-deletion)
- 恢复 /api/v1/starbook/home + /api/v1/starbook/items 网关路由
  (owner 从被删的 starbookService 切到 assetService);
- assetService 加 GetAssetsByType RPC (type/category/grade 过滤), 仅改 asset.pb.go (不动 triple.go);
- gateway 新建 starbook_controller.go 薄壳 (auth + 参数解析 + RPC);
  使用 Task 1 扩展接口 AssetServiceGetAssetsTypeClient (零装配增量, 复用现有 assetClient);
- 响应结构与原端点完全一致 (前端 4 处调用零修改, 实测 home 2514 bytes JSON shape 一致);
- items 支持 type/category/grade/page/page_size 完整参数;
- 路由注入到 AuthMiddleware 保护的 v1 group;
- 5/5 starbook 测试 + 完整 workspace build/vet 通过。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-24 14:04:01 +08:00
zerosaturation
8a767fb400 fix(backend): service stability — batch 3 accumulated (bcrypt off-txn / login anti-enum / MQ stub / aiChat / event reliability / gateway aggregate)
- 3.1 bcrypt 移出事务 (Register): repository.HashPassword 前移到 db.Transaction 之前。
- 3.2 Login 消除用户枚举 + 限流 + timing 抹平: pkg/errors 加 ErrInvalidCredential / ErrTooManyLoginAttempts;
  user-not-found 跑 dummy bcrypt 抹平 ~100ms 时序差; mobile 5次/ip 20次 per 15min 限流 (Redis, fail-open 降级)。
- 3.3 MQ streams adapter 停用 → stub: 0 业务调用方, noop EventProducer.Publish; Init 不再装配 streams;
  11 处硬编码 'gallery'/'default' 抽常量到 pkg/queue/consts (值不变, 消漂移)。
- 3.5 JWT 密钥治理: pkg/jwt MustInit fail-fast + atomic.Value, 50-goroutine race_test 零告警;
  MustInit 调用点 gateway main + auth_provider + loadgen 同步更新。
- 3.6 aiChat 健壮性: SaveContext 用 persona.ID(非 req.PersonaId); Redis/memory 错误 记 WARN 不静默;
  Dify err 映射稳定用户文案。
- 3.7 statistic.Client 重构: TrackEvent 改 buffered channel (cap 1024) + dispatchLoop worker。
- 3.8 网关聚合: StarCache (60s TTL, singleflight) 替换 GetFanIdentities 链式调用;
  DeleteAccount 改网关直调 userService.DeleteAccount(避免改 hand-written triple.go);
  铸造双写改异步 channel+consumer (3 retry)。
- 大量单测: 各子项 TDD (RED→GREEN), 关键并发 race_test (50 goroutine)。
- .env.example JWT_SECRET 改为 ≥32 字节 base64 示例(原为空, 被 MustInit 立即拒)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-24 14:03:21 +08:00
zerosaturation
a337f43f86 fix(config): port alignment + service test doubles (batch 4.1/4.5)
- gateway/config Dubbo URL 默认端口修正(原 20004/20005 与服务实际 20001/20004 不符);
- userService main.go 硬编码 WithPort(20000) 修死码, -port flag / PORT env 真正生效;
- .env.example 11 个 DUBBO URL 同步(对齐 serviceDefaultPorts map + 实际服务 bind);
- 删除 DUBBO_STARBOOK_SERVICE_URL 死引用(starbookService 已在 batch 4.2 删除);
- .env.example Service Ports 注释块补全 10 行, 与网关 Dubbo URL + port_test 三方一致;
- 10 个 service 各加 port_test.go, 断言 flag 默认与 serviceDefaultPorts map 一致;
- 11 个 port_test 总计 13 测试覆盖(网关 + 10 service);
- .gitignore 加 userService/main.go.bak 排除(临时备份)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-24 14:02:14 +08:00
zerosaturation
e1326acaf9 fix(backend): service stability — bcrypt off-txn / login anti-enum / MQ stub / aiChat / event reliability / gateway aggregate (batch 3)
- 3.1 bcrypt 移出事务 (Register): repository.HashPassword 前移到 db.Transaction 之前,消除连接池占用。
- 3.2 Login 消除用户枚举 + 限流 + timing 抹平: pkg/errors 加 ErrInvalidCredential
  /ErrTooManyLoginAttempts; 用户不存在/密码错/密码空 三路径统一返回同一错误;
  mobile 5次/ip 20次 per 15min 限流 (Redis, fail-open 降级); user-not-found 走
  dummy bcrypt 抹平 ~100ms 时序差,完全消除枚举侧信道;空密码分支已核实无时序 leak。
- 3.3 MQ streams adapter 停用 → stub: 0 业务调用方, 新 stub EventProducer.Publish no-op;
  pkg/mq/mq.go Init 不再装配 streams; 全仓 grep 验证 11 处硬编码
  'gallery'/'default' 集中到 pkg/queue/consts (值不变, 仅消漂移)。
- 3.5 JWT 密钥治理: pkg/jwt MustInit fail-fast + atomic.Value (见上一个 commit 293c7b1)。
- 3.6 aiChat 健壮性: SaveContext 用 persona.ID(非 req.PersonaId); Redis/memory 错误
  记 WARN 不静默; Dify err 映射稳定用户文案,原始 err 仅服务端日志。
- 3.7 statistic.Client 重构: TrackEvent 改 buffered channel (cap 1024) + dispatchLoop
  worker; 失败 ERROR 日志带字段; drop 记 WARN; Close 可重复调用。
- 3.8 网关聚合: StarCache (60s TTL, singleflight) 替换 5+ 处 GetFanIdentities 链式调用;
  DeleteAccount 改网关直调 userService.DeleteAccount(避免改 hand-written triple.go
  风险,见报告 §5 proto 风险复盘); 铸造双写改异步 channel+consumer (3 retry)。
- 大量单测: 各子项 TDD (RED→GREEN), 关键并发 race_test (50 goroutine)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-23 18:50:40 +08:00
zerosaturation
293c7b14ae fix(security): JWT key governance — MustInit fail-fast + atomic.Value
- pkg/jwt: 删 public SetSecret; 加 MustInit(secret string) 启动时强制注入,
  缺/为空/等于弱默认值时返回 error(运行期不可再改); 密钥用 atomic.Value
  存 []byte,所有读走 mustSecret() 原子 Load,消除 SetSecret/ParseToken 并发
  data race(go test -race 零告警)。
- gateway main + auth_provider: 启动时 MustInit 读 JWT_SECRET env,失败 fatal。
- scripts/loadgen/seed/tokens: 同步 MustInit。
- .env.example: JWT_SECRET 改为 ≥32 字节 base64 示例(原为空,被 MustInit
  立即拒);注释提示生产 MUST replace。
- 测试: 4 个 MustInit 行为 + 1 个 50-goroutine race 覆盖。
- 行为变更: 任何 .env 缺 JWT_SECRET 或用占位 secret 的服务,启动会 panic
  (这是 fail-fast 期望行为);其余 4 个 .env 文件占位由 ops 单独轮换。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-23 18:50:12 +08:00
zerosaturation
b7022d2dc1 fix(backend): auth boundary — trusted identity from ctx (batch 2)
- 新增 pkg/authctx: 从 Dubbo attachment/gRPC metadata 提取可信 user_id/star_id,
  统一覆盖 req 同名字段, 缺身份返 Unauthenticated。
- 各 provider 接入(堵身份伪造/越权):
  * moderation SubmitReport 等 6 RPC(举报人伪造)
  * asset CheckAssetLike/GetAssetQrcode/TrackShare(点赞/分享归因伪造)
  * social CheckFriendship(修 starID=0 隐私预言机)
  * activity PurchaseItem/BatchPurchaseItem(水晶扣费伪造)等 5 RPC
  * gallery/aiChat/task/notification 迁移 authctx, 删散落 extractUserInfo*
- social 正确性: GetUserLikedAssets OR 显式分组(防御); GetRandomUsersByStar 真随机(去 rand.Seed)。
- gateway: /auth/validate 移入 AuthMiddleware 保护组(/refresh 保留,依赖注入身份)。
- 删 userService 已迁移死函数; notification 缺身份错误码统一为 Unauthenticated。
- 各 provider 单测(伪造身份被覆盖 + 缺身份拒绝)。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-23 01:12:35 +08:00
zerosaturation
d554d7be83 feat:修改周边验证 2026-07-17 16:53:57 +08:00
zerosaturation
99775f1d11 feat:修改详细页面,修改为每个类型的页面不对 2026-07-15 19:16:28 +08:00
zerosaturation
c0b577dd40 feat:增加邮箱管理功能 2026-07-14 21:59:15 +08:00
zerosaturation
d900c0d8b2 feat:增加验证真伪访问次数和首次验证 2026-07-13 14:24:42 +08:00
zerosaturation
74853800b6 feat:增加二维码验证真伪的功能 2026-07-13 11:22:56 +08:00
zerosaturation
e5bd0c854c feat:增加忘记密码的功能 2026-07-09 19:00:03 +08:00
fbf3e6c63c feat:增加分享页下载 2026-07-09 15:49:06 +08:00
zerosaturation
a1e92448f1 feat:修改陀螺仪控制为手动控制 2026-07-06 21:20:24 +08:00
zerosaturation
958c867309 fix:修改举报/反馈的bug 2026-07-06 16:22:26 +08:00
zerosaturation
dcb4e451a1 fix:修改合并后bug 2026-07-06 10:25:06 +08:00
zerosaturation
ba44041e55 feat:修改websocket的性能和相关的问题 2026-07-03 22:08:43 +08:00
zerosaturation
8376afc5d6 feat:修改websocket的性能和相关的问题 2026-07-03 22:04:11 +08:00
zerosaturation
1afee2de73 feat:修改的欢迎页的冷启动和系统重启的错误触发和一键登录页的路径修改 2026-07-03 18:54:03 +08:00
zerosaturation
4c3388ed36 feat:新增注销账号功能,然后修改前端注册页面 2026-07-03 16:40:53 +08:00
zerosaturation
d12a84c1f0 feat:增加队列修改收益方面把轮询改为MQ队列,修改数据看板的数据问题出错 2026-07-03 12:34:55 +08:00
zerosaturation
3cd68acf6d feat:完善计算点赞押注收益 2026-06-29 14:47:32 +08:00
zerosaturation
2032246fd0 feat:增加分享界面,完善的保存图片功能 2026-06-26 16:45:29 +08:00
zerosaturation
b7e2aee399 feat:修改活动 TOP3 + 我的排名 2026-06-24 18:10:12 +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
37a3f292df feat:访问他人展览页面修改 2026-06-23 22:29:39 +08:00
zerosaturation
75ab617c6c feat:增加实时留言功能和修改轮询道具购买记录显示改为websocket显示 2026-06-23 18:13:55 +08:00
zerosaturation
7eb6dad434 feat:新增举报和反馈功能 2026-06-22 17:19:48 +08:00
zerosaturation
ef0a4f6afd feat:修改通知系统的消息 2026-06-17 11:59:51 +08:00
ddc5b89a6c frat:增加uniPush的配置 2026-06-16 23:49:40 +08:00
zerosaturation
7074546959 feat:新增通知系统 2026-06-16 21:30:58 +08:00
zerosaturation
7734d33697 feat:修改ws的配置 2026-06-15 22:33:37 +08:00
zerosaturation
060e4944fa fix:修改JWTbug 2026-06-15 21:12:59 +08:00
zerosaturation
271e0350c7 feat:重构code状态码 2026-06-15 16:28:35 +08:00
zerosaturation
b38174917a feat:修改配置 2026-06-14 21:04:05 +08:00
zerosaturation
dfb79af4b1 feat: 铸造菜单改为动态配置 2026-06-09 12:38:12 +08:00
zerosaturation
d859650136 feat:修改数据看板 2026-06-09 00:37:42 +08:00
zerosaturation
3d3f2260f3 feat(statistic): T13-T16 Gateway routes + 5-service business integration (7/7 event types)
Gateway:
- 7 routes /api/v1/dashboard/* with JWT auth (middleware.AuthMiddleware)
- statistic_controller.go: 7 methods, response format {code:200, data:resp}
- gateway/main.go: StatisticServiceClient wired
- gateway/config: StatisticServiceURL (DUBBO_STATISTIC_SERVICE_URL, default tri://127.0.0.1:20009)

pkg/statistic SDK:
- fire-and-forget TrackEvent + BatchTrackEvent
- Init(client) + Get() global singleton pattern

Business-side integration (7/7 event types):
- socialService.LikeAsset → asset.like
- galleryService.PlaceAsset → exhibition.start
- galleryService.RemoveFromSlot → exhibition.end (with duration_ms)
- taskService.OnExhibitionCompleted → exhibition.revenue
- assetService.CreateMintOrder → asset.mint
- assetService.logLevelChange → asset.level_up
- userService.UpdateCrystalBalance → crystal.change (wrapper fn added)

Cache warmup:
- main.go: 7 RPCs x 5 sample starIDs at startup (15s delay)
- prevents cold-start DB thundering herd

Existing service modifications:
- galleryService/exhibition_service.go
- taskService/revenue_service.go
- assetService/{mint_service,asset_level_service}.go
- userService/user_service.go
- socialService/asset_like_service.go

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 17:20:53 +08:00
zerosaturation
23a8051e96 feat: 修改头像显示不全,修改docker的配置 2026-06-04 16:41:20 +08:00
zerosaturation
456bf10352 feat: 修改合并bug 2026-06-04 00:52:32 +08:00
f0b650de26 feat: 解决合并冲突 2026-06-04 00:03:40 +08:00
bc3d82e20e fix: 合并冲突 2026-06-03 23:44:33 +08:00
liulong
6ff8743c72 feat:修复合并问题 2026-06-03 23:25:08 +08:00
liulong
b9527bee70 feat:合并新 2026-06-03 22:41:19 +08:00
liulong
10168f8e6b feat:实现AI生成镭射卡功能 2026-06-03 22:19:22 +08:00
zerosaturation
edadb0e082 feat:修改头像bug 2026-06-02 21:10:35 +08:00