Skip to content

fix(api)!: rename subject tag total_cont to total_count#1130

Merged
trim21 merged 1 commit into
bangumi:masterfrom
huoshen80:fix/subject-tag-total-count-spelling
Jul 23, 2026
Merged

fix(api)!: rename subject tag total_cont to total_count#1130
trim21 merged 1 commit into
bangumi:masterfrom
huoshen80:fix/subject-tag-total-count-spelling

Conversation

@huoshen80

Copy link
Copy Markdown
Contributor

背景

#1124 补全并记录了标签总使用次数字段,但 total_cont 应为 total_count:领域模型和数据库映射均使用 TotalCount,只有 API 响应层存在该拼写错误。

当前提交直接将 total_cont 重命名为 total_count,不保留旧字段,因此属于破坏性变更。

由于 #1124 尚未部署,现在直接修正可以避免在更多接口中固化错误名称。想确认:

  1. 是否接受直接重命名?
  2. 还是应同时保留两个字段,将 total_cont 标记为 deprecated,后续再移除?
  3. fix(api): populate and document subject tag total count #1124 的接口改动和 API 文档预计何时发布?

修改内容

  • TotalCont / total_cont 重命名为 TotalCount / total_count
  • 更新相关响应映射和 OpenAPI
  • 增加 JSON 序列化测试

测试

  • go test -tags test ./web/res/... ./internal/search/subject/...
  • yarn run test

Replace the misspelled subject tag field across JSON responses and OpenAPI.

BREAKING CHANGE: subject tag responses now expose total_count instead of total_cont.
@trim21

trim21 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

之前那个还没上线,你要改的话可以直接改(

@huoshen80

Copy link
Copy Markdown
Contributor Author

之前那个还没上线,你要改的话可以直接改(

👌欧克,那麻烦你合一下
因为我软件打算使用这个字段过滤排除掉一些低质量 tag,所以才想问一下这几次修改正式部署的时间

@huoshen80
huoshen80 marked this pull request as ready for review July 23, 2026 16:15
@mergify

mergify Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@trim21
trim21 merged commit a02c614 into bangumi:master Jul 23, 2026
8 checks passed
@huoshen80
huoshen80 deleted the fix/subject-tag-total-count-spelling branch July 23, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants