# coding:utf-8

from fastapi import APIRouter, Depends
from app.api import Response, get_current_user
from app.models.base_model import get_db
from app.models.user_model import UserModel
from app.service.canvas import get_canvas_list

canvas_router = APIRouter()

@canvas_router.get("/list", response_model=Response)
async def canvas_list(role:str="", current_user: UserModel = Depends(get_current_user),
                          db=Depends(get_db)):
    return Response(code=200, msg="", data = await get_canvas_list(db, role, current_user.id))