Skip to content

feat: 去掉改洞时的 tags 数量上限(仅影响管理员) - #231

Open
DavidYe68 wants to merge 1 commit into
OpenTreeHole:mainfrom
DavidYe68:remove-modify-tag-limit
Open

feat: 去掉改洞时的 tags 数量上限(仅影响管理员)#231
DavidYe68 wants to merge 1 commit into
OpenTreeHole:mainfrom
DavidYe68:remove-modify-tag-limit

Conversation

@DavidYe68

Copy link
Copy Markdown

Closes #230

改洞接口的标签修改本来就仅限管理员(CheckPermission 中非管理员直接 Forbidden),但 ModifyModel 嵌入的 TagCreateModelSlice 带着 max=10 校验,导致管理员想给已有 10 个标签的帖子追加管理用标签时,只能先删楼主原有标签。

改动:给 ModifyModel 换成自己的 Tags 字段,去掉 max=10(保留 min=1 和逐项校验),并补上原来由嵌入结构体提供的 ToName。发帖(CreateModel)的 10 个上限不受影响。

已本地 go build ./...go vetgofmt 通过;tests/ 在本地因缺测试环境文件(data/names_mapping.json)在 main 上同样失败,与本改动无关。

🤖 Generated with Claude Code

Tag modification via ModifyHole is admin-only (enforced in
CheckPermission), so the max=10 validation inherited from
TagCreateModelSlice only blocked admins from appending management
tags to holes that already have 10 tags. Give ModifyModel its own
Tags field without the count cap; hole creation keeps max=10.

Closes OpenTreeHole#230

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

管理员修改标签时希望放开 tags 数量上限(max=10)

1 participant