diff --git a/pkg/service/cast/tag.go b/pkg/service/cast/tag.go index 836662e..1a8f625 100644 --- a/pkg/service/cast/tag.go +++ b/pkg/service/cast/tag.go @@ -289,6 +289,11 @@ func GenerateAutoHashtags(ctx context.Context, post string, max int32, position, max = int32(5 - len(beforeTags)) } + // 如果此时 max 小于等于0,则直接返回 + if max <= 0 { + return nil, nil, false, nil + } + profileKey, err := GetValidProfileKey(ctx, []uint32{1, 2, 3, 5}) if err != nil { return nil, nil, false, err