xiaolongmr commited on
Commit ·
31d7fcf
1
Parent(s): 638cad0
编辑功能(测试)
Browse files
services/account_service.py
CHANGED
|
@@ -440,6 +440,27 @@ class AccountService:
|
|
| 440 |
def _normalize_account_type(value: Any) -> str:
|
| 441 |
return _normalize_account_type_value(value)
|
| 442 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 443 |
@classmethod
|
| 444 |
def _search_account_type(cls, value: Any) -> str | None:
|
| 445 |
if isinstance(value, dict):
|
|
|
|
| 440 |
def _normalize_account_type(value: Any) -> str:
|
| 441 |
return _normalize_account_type_value(value)
|
| 442 |
|
| 443 |
+
@classmethod
|
| 444 |
+
def _account_matches_any_plan_type(
|
| 445 |
+
cls,
|
| 446 |
+
account: dict | None,
|
| 447 |
+
plan_types: set[str] | tuple[str, ...] | list[str] | None = None,
|
| 448 |
+
) -> bool:
|
| 449 |
+
"""判断账号套餐类型是否命中给定集合;未指定集合时视为全部命中。"""
|
| 450 |
+
if not plan_types:
|
| 451 |
+
return True
|
| 452 |
+
if not isinstance(account, dict):
|
| 453 |
+
return False
|
| 454 |
+
normalized_account = cls._normalize_account_type(account.get("type"))
|
| 455 |
+
if not normalized_account:
|
| 456 |
+
return False
|
| 457 |
+
normalized_plans = {
|
| 458 |
+
normalized
|
| 459 |
+
for plan_type in plan_types
|
| 460 |
+
if (normalized := cls._normalize_account_type(plan_type))
|
| 461 |
+
}
|
| 462 |
+
return normalized_account in normalized_plans
|
| 463 |
+
|
| 464 |
@classmethod
|
| 465 |
def _search_account_type(cls, value: Any) -> str | None:
|
| 466 |
if isinstance(value, dict):
|
web/src/app/image/components/image-annotation-editor.tsx
CHANGED
|
@@ -1159,7 +1159,7 @@ export function ImageAnnotationEditor({
|
|
| 1159 |
<div className="min-w-0">
|
| 1160 |
<DialogTitle className="flex items-center gap-2 text-lg text-stone-950 sm:text-xl">
|
| 1161 |
<Pencil className="size-5 text-violet-600" />
|
| 1162 |
-
编辑图片
|
| 1163 |
</DialogTitle>
|
| 1164 |
<DialogDescription className="mt-1 truncate text-xs sm:text-sm">
|
| 1165 |
标记并修改局部内容,或扩展图片画幅。更多编辑能力会在这里持续加入。
|
|
|
|
| 1159 |
<div className="min-w-0">
|
| 1160 |
<DialogTitle className="flex items-center gap-2 text-lg text-stone-950 sm:text-xl">
|
| 1161 |
<Pencil className="size-5 text-violet-600" />
|
| 1162 |
+
编辑图片(测试)
|
| 1163 |
</DialogTitle>
|
| 1164 |
<DialogDescription className="mt-1 truncate text-xs sm:text-sm">
|
| 1165 |
标记并修改局部内容,或扩展图片画幅。更多编辑能力会在这里持续加入。
|