34 lines
645 B
Python
34 lines
645 B
Python
import uuid
|
|
from datetime import datetime
|
|
from enum import Enum
|
|
from typing import List
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from schemas import DBBase
|
|
|
|
|
|
class DashboardBase(BaseModel):
|
|
name: str = None
|
|
|
|
|
|
# 解析请求json 创建项目
|
|
class DashboardCreate(DashboardBase):
|
|
name: str
|
|
project_id: str
|
|
# cat: str
|
|
pid: str
|
|
|
|
class Category(str, Enum):
|
|
project = 'kanban'
|
|
space = 'space'
|
|
# --------------------------------------------------------------
|
|
# 数据库模型
|
|
class DashboardDB(DBBase):
|
|
name: str
|
|
user_id: str
|
|
project_id: str
|
|
# cat: Category
|
|
pid: str
|
|
create_date: datetime = datetime.now()
|