fix: 添加auth功能
This commit is contained in:
@@ -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
|
||||
8
python_core/database/user.py
Normal file
8
python_core/database/user.py
Normal 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
|
||||
Reference in New Issue
Block a user