|
|
97adf54d6d
|
fix: golangci-lint 零告警通过 (57→0) + gofumpt/goimports 全量格式化
## CI 修复 (P0/P1)
P0 — 编译阻塞:
- interfaces.go: postUseCase ISP 接口移除不用的 Create/Update/Delete
P1 — 必须修复:
- ST1000: 为 13 个包添加包注释 (common/config/model/service/...)
- ST1005: redis_store.go 全部错误消息改为小写开头
- errcheck (19处): defer Close()→闭包忽略, notifier.Create→_=, r.Run→检查error
- errorlint (9处): switch-on-error→errors.Is 链, ==→errors.Is
- ST1020/ST1022: 导出符号注释以符号名开头
P2 — 安全评审:
- gosec (12处): G203/G301/G304/G306 添加 nolint 注释并附理由
P3 — 清理:
- unused: 移除 hasUnicode/energyStore/current/energyAdminUseCase
- gofumpt + goimports 全量格式化 (35+ 文件)
|
2026-06-22 02:27:35 +08:00 |
|
|
|
a2e8242c21
|
chore: 全局包名路径从 metalab 更改为 mce
|
2026-06-21 16:55:46 +08:00 |
|
|
|
3df7b2e672
|
fix: Service 层移除直接持有的 *gorm.DB,引入 Repository Transaction 方法
- ReactionStore/FollowStore/EnergyStore/FavoriteStore 接口新增 Transaction 方法
- EnergyStore.Transaction 支持跨仓库事务(EnergyStore + FundStore)
- ReactionRepo/FollowRepo/FavoriteRepo/EnergyRepo 实现 Transaction 方法
- ReactionRepo 新增 GetPostLikesCount 方法,消除 Service 直查 DB
- ReactionService/FollowService/FavoriteService/EnergyService 移除 db 字段
- EnergyRepo 通过 SetFundStore 注入 FundStore 用于跨仓库事务
- 更新 deps_extra.go 构造函数调用
|
2026-06-02 16:46:44 +08:00 |
|
|
|
ff9886f08b
|
refactor: 文件行数超标拆解(Service + Controller 9/16 完成)
- Service 层:energy_service → energize/operations/admin/query 四文件
- Service 层:post_service → helpers/audit + 核心 CRUD 保留
- Service 层:favorite_service → items + 核心文件夹操作保留
- Service 层:auth_service → password + 核心注册/登录保留
- Service 层:notification_service → notify + 核心列表/已读保留
- Service 层:audit_service → review + 核心列表/详情保留
- Controller 层:studio_controller → page/write/api/post_api/action 五文件
- Controller 层:post_controller → page/api/upload 三文件
- Controller 层:comment_controller → list/write/action/upload 四文件
- 清理未使用导入(notification_service.go 移除 fmt)
|
2026-06-02 15:45:54 +08:00 |
|