feat(weibo): 增加强制分配权限与账号详情
This commit is contained in:
+18
-1
@@ -3,7 +3,7 @@
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, model_serializer
|
||||
from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator
|
||||
|
||||
from .huya_defaults import (
|
||||
HUYA_DEFAULT_BIND_ACT_ID,
|
||||
@@ -571,6 +571,23 @@ class WeiboBatchAssignRequest(BaseModel):
|
||||
assigned_to: int | None = None
|
||||
|
||||
|
||||
class WeiboForceAssignRequest(BaseModel):
|
||||
"""超级管理员或获授权用户强制改归属;按 ID 或标签二选一。"""
|
||||
|
||||
assigned_to: int = Field(..., gt=0)
|
||||
account_ids: list[int] = Field(default_factory=list)
|
||||
tag: str = Field("", max_length=64)
|
||||
expected_count: int = Field(..., ge=1)
|
||||
|
||||
@model_validator(mode="after")
|
||||
def _validate_scope(self):
|
||||
has_ids = bool(self.account_ids)
|
||||
has_tag = bool(self.tag.strip())
|
||||
if has_ids == has_tag:
|
||||
raise ValueError("account_ids 和 tag 必须且只能填写一项")
|
||||
return self
|
||||
|
||||
|
||||
class WeiboAccountDisableRequest(BaseModel):
|
||||
reason: str = Field("", max_length=256)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user