53 lines
1.8 KiB
Python
53 lines
1.8 KiB
Python
from typing import List
|
|
from uuid import UUID
|
|
|
|
from fastapi import Body
|
|
|
|
from app.models.monito_physical_progress import PhysicalProgressModel, LastRecord
|
|
from app.repositories.monitor_physical_progress import PhysicalProgressRepository
|
|
from core.app import app
|
|
from core.utils.router import generate_router, shrink
|
|
from core.utils.table_engine import TableEngineExport, TableEngineRequestType
|
|
|
|
ThisModel = PhysicalProgressModel
|
|
router_base_url = 'monitor-physical'
|
|
_tag_base = [router_base_url]
|
|
router = generate_router(router_base_url, auth_dependencies=False, version='v2')
|
|
repo = PhysicalProgressRepository()
|
|
|
|
@router.post('/create', response_model=ThisModel, tags=_tag_base, description='پیشرفت فیزیکی')
|
|
@shrink(repo.create)
|
|
def create(coding: ThisModel = Body(...)):
|
|
pass
|
|
|
|
@router.post('/last', response_model=list[dict], tags=_tag_base, description='پیشرفت فیزیکی')
|
|
@shrink(repo.last_record)
|
|
def last_record(last:LastRecord):
|
|
pass
|
|
|
|
@router.get('/list/{_id}', response_model=List[ThisModel], tags=_tag_base, description='پیشرفت فیزیکی')
|
|
@shrink(repo.list_by_project)
|
|
def list_by_project(_id: UUID):
|
|
pass
|
|
|
|
@router.put('/{_id}', response_model=ThisModel, tags=_tag_base, description='پیشرفت فیزیکی')
|
|
@shrink(repo.update)
|
|
def update(_id: UUID, coding: ThisModel = Body(...)):
|
|
pass
|
|
|
|
@router.get('/{_id}', response_model=ThisModel, tags=_tag_base, description='پیشرفت فیزیکی')
|
|
@shrink(repo.get)
|
|
def get(_id: UUID):
|
|
pass
|
|
|
|
@router.delete('/{_id}', response_model=ThisModel, tags=_tag_base)
|
|
@shrink(repo.delete)
|
|
def delete(_id: UUID):
|
|
pass
|
|
|
|
@router.post('', response_model=TableEngineExport[ThisModel], tags=_tag_base, description='پیشرفت فیزیکی')
|
|
@shrink(repo.fetch)
|
|
def fetch(body: TableEngineRequestType = Body(...)):
|
|
pass
|
|
|
|
app.include_router(router) |