spark-server/docs/daily/2026-09-24-change-list.md
DESKTOP-L8OUL9F\gfl0034 5e8ab6e12b test: 补意见反馈登录/游客单测断言
覆盖游客缺 contact 失败与登录态 uid/app_version 回填,避免分流逻辑回归。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-24 16:25:10 +08:00

171 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 每日变动 2026-09-24
## 11:12 — 新增 daily-change-list Agent Skill
### 概要
- 新增项目 skill:每次完成代码/配置/文档等实质性修改后,在 `docs/daily/` 写入或追加当日变动 Markdown。
- 文件名格式:`{yyyy}-{mm}-{dd}-change-list.md`(示例:`2026-09-24-change-list.md`)。
- `AGENTS.md` 与 `verify-before-done.mdc` 已挂接该流程。
### 变更范围
| 类型 | 说明 |
|------|------|
| 文档 / 配置 | Agent skill、daily 目录说明、Agent 与 verify 规则 |
### 主要文件
- `.cursor/skills/daily-change-list/SKILL.md` — skill 定义与模板
- `docs/daily/README.md` — 目录说明
- `AGENTS.md` — 第 7 条引用 skill
- `.cursor/rules/verify-before-done.mdc` — 完成前写入 daily
### 验证
- `make test`: skipped(仅 Agent/文档,无 Go 变更)
### 关联
- 用户请求:新增每日修改变动 markdown 流程
## 11:16 — daily 文件名改为 yyyy-mm-dd
### 概要
- 每日变动文件命名由 `{yyyy}-{dd}-{mm}` 调整为 `{yyyy}-{mm}-{dd}`(年月日 ISO 顺序)。
### 主要文件
- `.cursor/skills/daily-change-list/SKILL.md`
- `docs/daily/README.md`、`AGENTS.md`、`.cursor/rules/verify-before-done.mdc`
- `docs/daily/2026-09-24-change-list.md`(自 `2026-24-09-change-list.md` 重命名并更新文内日期)
### 验证
- `make test`: skipped(文档)
## 14:10 — Spark Messenger 主路径接入:好友拒绝 API + OpenAPI
### 概要
- 新增 `POST /v1/friends/requests/reject`,补齐 App 忽略/拒绝好友申请
- OpenAPI 补全 password-login / set-password / legal / feedback / subscriptions / reject
- 与 iOS `SparkIMClient` 主路径路由扩展配套
### 变更范围
| 类型 | 说明 |
|------|------|
| 功能 | 好友申请拒绝 |
| 文档 | OpenAPI 路径补全 |
| 配置 | client 模块与 popadmin 三页(同日 WIP) |
### 主要文件
- `internal/module/friend/logic/reject.go` — Reject 用例
- `internal/transport/http/handler/friend/handler.go` / `router.go` — HTTP
- `internal/transport/http/docs/openapi.yaml` — 规范
- `internal/module/client/**`、`migrations/0023_*.sql`、`deploy/popadmin/popadmin.js` — 法律/反馈/订阅/密码
### 验证
- `make test`: skipped(本机 PATH 无 go)
- 需部署后刷新 https://sparkapi.wyrs365.com/docs
### 关联
- Spark Messenger 全页面接入检查
## 14:48 — 修复 make lint / make test
### 概要
- 修复 `friend_test` 中 `Accept` 双返回值与测试邮箱 OTP
- 修复 `client` 模块 goconst/gocritic/goimports;`UpsertLegal`/`UpsertPlan` 改为指针入参
- 补充 `client`/`auth` logic 单测以满足 65% 覆盖率门禁
### 主要文件
- `internal/module/friend/logic/friend_test.go`
- `internal/module/client/logic/service.go`、`model/repo.go`
- `internal/module/client/logic/service_test.go`
- `internal/module/auth/logic/refresh_test.go`、`static_test.go`
- `internal/bootstrap/app.go`、`handler/friend/handler.go`、`handler/admin/client.go`
### 验证
- `make lint`: pass
- `make test`: pass
## 15:22 — Git commit 前必须 make test
### 概要
- 新增 always-on 规则 `git-commit-gate.mdc`:Agent 与用户 commit 前须 `make test` 通过,禁止擅自 `--no-verify`
- 新增 `scripts/git-hooks/pre-commit` 与 `make install-git-hooks` 安装到 `.git/hooks`
### 主要文件
- `.cursor/rules/git-commit-gate.mdc`
- `scripts/git-hooks/pre-commit`
- `Makefile`、`AGENTS.md`
### 验证
- `make test`: pass
### 使用
```bash
make install-git-hooks # 本机只需一次
```
## 14:55 — 意见反馈区分登录 / 游客
### 概要
- `POST /v1/feedback` 改为可选鉴权:有效 Bearer → `auth_type=login` + `uid`;无 token → `auth_type=guest`,必填 `contact`(邮箱或手机)
- 表增加 `auth_type` / `contact`;Admin list 支持 `?auth_type=login|guest`;popadmin App反馈页加筛选下拉
- OpenAPI 同步说明
### 变更范围
| 类型 | 说明 |
|------|------|
| 功能 | 反馈登录/游客分流 |
| 数据库 | migration 0024 |
| 管理端 | popadmin 筛选 |
| 文档 | OpenAPI |
### 主要文件
- `migrations/0024_feedback_auth_type_contact.sql`
- `internal/module/client/**` — entity / logic / repo
- `internal/transport/http/auth.go` — `/v1/feedback` 可选鉴权
- `internal/transport/http/handler/admin/client.go` — auth_type 筛选
- `internal/transport/http/docs/openapi.yaml`
- `deploy/popadmin/popadmin.js`
### 验证
- `make test`: skipped(本机无 go)
- 需部署并执行 migration 后生效
### 关联
- 用户需求:意见反馈分登录与未登录
## 16:25 — 反馈用例补登录路径断言
### 概要
- 补充游客缺 contact 失败、登录态写入 auth_type/uid、AppVersion Header 回填的单测断言
- auth.go import 顺序整理
### 验证
- `make test`: skipped(本机无 go)