fix: 完善商品—模特库-视频项目-自由创作等删除先进垃圾桶及可恢复等流程

This commit is contained in:
hh
2026-07-10 15:06:07 +08:00
parent 3e52942547
commit 564215dc53
28 changed files with 1086 additions and 190 deletions
+4
View File
@@ -73,12 +73,14 @@ class ImageConversation(TeamOwnedModel):
related_name="image_conversations",
)
is_deleted = models.BooleanField(default=False)
purged_at = models.DateTimeField(null=True, blank=True)
# 每次在该对话里发起生成都刷新,左栏「最近」按它倒序
last_active_at = models.DateTimeField(auto_now_add=True)
class Meta:
indexes = [
models.Index(fields=["team", "mode", "-last_active_at"]),
models.Index(fields=["team", "is_deleted", "purged_at"]),
]
def __str__(self) -> str:
@@ -149,6 +151,7 @@ class AITask(TeamOwnedModel):
# 自由创作任务流的收藏 / 软删(其它任务类型恒 False,无行为影响)
is_favorited = models.BooleanField(default=False)
is_deleted = models.BooleanField(default=False)
purged_at = models.DateTimeField(null=True, blank=True)
class Meta:
indexes = [
@@ -163,6 +166,7 @@ class AITask(TeamOwnedModel):
models.Index(fields=["team", "read_at"]),
# 自由创作任务流:按团队 + 类型倒序分页
models.Index(fields=["team", "task_type", "-created_at"]),
models.Index(fields=["team", "is_deleted", "purged_at"]),
]
def __str__(self) -> str: