fix: 添加auth功能

This commit is contained in:
root
2025-07-12 18:01:17 +08:00
parent 41363d182e
commit e4d4677f3a
12 changed files with 1725 additions and 91 deletions

View File

@@ -2,6 +2,23 @@ from dataclasses import dataclass
from typing import Dict, List, Any, Optional
@dataclass
class ResourceCategory:
"""素材分类数据结构"""
id: str
title: str # 分类标题
ai_prompt: str # AI识别提示词
color: str # 展示颜色 (hex格式如 #FF5733)
created_at: str
updated_at: str
is_active: bool = True
# is_cloud false 代表本地资源 那么只加载自己的 如果是 true 就是公用的
is_cloud: bool
# 创建用户
user_id: str
@dataclass
class MaterialInfo:
"""Material information structure"""
@@ -13,6 +30,11 @@ class MaterialInfo:
relative_path: str
duration: Optional[int] = None
size: Optional[int] = None
# is_cloud false 代表本地资源 那么只加载自己的 如果是 true 就是公用的
is_cloud: bool
# 创建用户
user_id: str
@dataclass
class TemplateInfo:
@@ -29,7 +51,7 @@ class TemplateInfo:
material_count: int
track_count: int
tags: List[str]
# local/cloud 如果类型是 local 那么只加载自己的 如果是 cloud 就是公用的
type: str
# is_cloud false 代表本地资源 那么只加载自己的 如果是 true 就是公用的
is_cloud: bool
# 创建用户
user_id: str

View File

@@ -0,0 +1,8 @@
# 用户表
from python_core.kv import kv
from .db import Db
class UserDb(Db):
def __init__(self):
self.key = "model"
pass