Victor_Jay
2b47380ac5
feat: 实现赞/踩系统(P2)
- 新增 PostLike/PostDislike 模型,复合主键 (user_id, post_id)
- Post 表新增 LikesCount/DislikesCount 冗余计数器
- Repository 层:reaction_repo.go,含 WithTx 事务支持
- Service 层:reaction_service.go,赞踩互斥逻辑(6 态切换),事务包裹
- Controller 层:reaction_controller.go,3 个 API(ToggleLike/ToggleDislike/GetReaction)
- 接口定义:controller/interfaces.go 新增 reactionUseCase,service/repository.go 新增 ReactionStore
- 路由注册 + 依赖注入 + AutoMigrate
- 前端:文章详情页赞踩按钮 + 状态查询 + 401 跳转登录
- 样式:posts.css 新增赞踩按钮样式
2026-06-01 15:48:18 +08:00
..
2026-06-01 15:10:47 +08:00
2026-05-31 21:20:04 +08:00
2026-05-31 11:13:32 +08:00
2026-05-30 23:36:52 +08:00
2026-06-01 14:05:47 +08:00
2026-06-01 12:10:16 +08:00
2026-06-01 15:48:18 +08:00
2026-06-01 03:32:50 +08:00
2026-05-27 13:57:08 +08:00
2026-05-31 01:23:09 +08:00
2026-05-31 15:35:20 +08:00
2026-06-01 15:48:18 +08:00
2026-05-31 01:26:04 +08:00
2026-06-01 12:10:16 +08:00
2026-05-30 23:58:37 +08:00
2026-06-01 03:32:50 +08:00
2026-05-27 13:57:08 +08:00
2026-05-31 01:23:09 +08:00
2026-06-01 13:01:45 +08:00