56 lines
912 B
Python
56 lines
912 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 DashboardDelete(DBBase):
|
|
pass
|
|
|
|
|
|
class Category(str, Enum):
|
|
project = 'kanban'
|
|
space = 'space'
|
|
|
|
|
|
class DashboardMove(BaseModel):
|
|
source_id: str
|
|
dest_id: str
|
|
cat: Category
|
|
|
|
|
|
class AddReport(DBBase):
|
|
report_ids: List[str]
|
|
|
|
|
|
class DelReport(DBBase):
|
|
report_ids: List[str]
|
|
|
|
|
|
# --------------------------------------------------------------
|
|
# 数据库模型
|
|
class DashboardDB(DBBase):
|
|
name: str
|
|
user_id: str
|
|
project_id: str
|
|
# cat: Category
|
|
reports: List[str] = []
|
|
pid: str
|
|
create_date: datetime = datetime.now()
|