feat: 去掉改洞时的 tags 数量上限(仅影响管理员) - #231
Open
DavidYe68 wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #230
改洞接口的标签修改本来就仅限管理员(
CheckPermission中非管理员直接 Forbidden),但ModifyModel嵌入的TagCreateModelSlice带着max=10校验,导致管理员想给已有 10 个标签的帖子追加管理用标签时,只能先删楼主原有标签。改动:给
ModifyModel换成自己的Tags字段,去掉max=10(保留min=1和逐项校验),并补上原来由嵌入结构体提供的ToName。发帖(CreateModel)的 10 个上限不受影响。已本地
go build ./...、go vet、gofmt通过;tests/在本地因缺测试环境文件(data/names_mapping.json)在 main 上同样失败,与本改动无关。🤖 Generated with Claude Code