优化视频复刻和商品内容大小

This commit is contained in:
Azmat@qq.com
2026-08-28 18:42:28 +08:00
parent a618f02315
commit 6b6146e595
20 changed files with 1557 additions and 382 deletions
+7 -5
View File
@@ -413,11 +413,13 @@ class AssetViewSet(TeamScopedViewSetMixin, ModelViewSet):
product_ids.update(str(x) for x in pid3 if x)
if not product_ids:
return []
# 团队隔离(即便某 product_id 越权也过滤掉);只取 id/title
rows = Product.objects.filter(team=self.get_team(), id__in=product_ids).values("id", "title")
products = [{"id": str(r["id"]), "title": r["title"]} for r in rows]
products.sort(key=lambda x: x["title"] or "")
return products
# 团队隔离(即便某 product_id 越权也过滤掉);只取 id/title,最新添加的在前
rows = (
Product.objects.filter(team=self.get_team(), id__in=product_ids)
.order_by("-created_at")
.values("id", "title")
)
return [{"id": str(r["id"]), "title": r["title"]} for r in rows]
@action(detail=True, methods=["get"], url_path="raw")
def raw(self, request, pk=None):