feat:add get list for progress rial and physical
This commit is contained in:
@@ -44,3 +44,7 @@ class PhysicalProgressRepository(BaseRepository):
|
|||||||
create = await mongo_inserter(_inp, COLLECTION, getter=self.get)
|
create = await mongo_inserter(_inp, COLLECTION, getter=self.get)
|
||||||
await ProjectRepository().set_sts_two_for_monitor(_inp.project_id)
|
await ProjectRepository().set_sts_two_for_monitor(_inp.project_id)
|
||||||
return create
|
return create
|
||||||
|
|
||||||
|
async def list_by_project(self,_id:uuid.UUID):
|
||||||
|
_get = await use_collection(COLLECTION).find({"project_id":_id}).to_list(None)
|
||||||
|
return _get
|
||||||
|
|||||||
@@ -21,4 +21,8 @@ class RialProgressRepository(BaseRepository):
|
|||||||
async def create(self,_inp:RialProgressModel):
|
async def create(self,_inp:RialProgressModel):
|
||||||
create = await mongo_inserter(_inp,TaskEnv.CLN_MONITOR_RIAL,getter=self.get)
|
create = await mongo_inserter(_inp,TaskEnv.CLN_MONITOR_RIAL,getter=self.get)
|
||||||
await ProjectRepository().set_sts_two_for_monitor(_inp.project_id)
|
await ProjectRepository().set_sts_two_for_monitor(_inp.project_id)
|
||||||
return create
|
return create
|
||||||
|
|
||||||
|
async def list_by_project(self, _id: uuid.UUID):
|
||||||
|
_get = await use_collection(TaskEnv.CLN_MONITOR_RIAL).find({"project_id": _id}).to_list(None)
|
||||||
|
return _get
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from typing import List
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from fastapi import Body
|
from fastapi import Body
|
||||||
@@ -24,6 +25,11 @@ def create(coding: ThisModel = Body(...)):
|
|||||||
def last_record(last:LastRecord):
|
def last_record(last:LastRecord):
|
||||||
pass
|
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='پیشرفت فیزیکی')
|
@router.put('/{_id}', response_model=ThisModel, tags=_tag_base, description='پیشرفت فیزیکی')
|
||||||
@shrink(repo.update)
|
@shrink(repo.update)
|
||||||
def update(_id: UUID, coding: ThisModel = Body(...)):
|
def update(_id: UUID, coding: ThisModel = Body(...)):
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from typing import List
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from fastapi import Body
|
from fastapi import Body
|
||||||
@@ -20,6 +21,11 @@ repo = RialProgressRepository()
|
|||||||
def create(coding: ThisModel = Body(...)):
|
def create(coding: ThisModel = Body(...)):
|
||||||
pass
|
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.post('/last', response_model=ThisModel, tags=_tag_base, description='پیشرفت ریالی')
|
@router.post('/last', response_model=ThisModel, tags=_tag_base, description='پیشرفت ریالی')
|
||||||
@shrink(repo.last_record)
|
@shrink(repo.last_record)
|
||||||
def last_record(last:LastRecord):
|
def last_record(last:LastRecord):
|
||||||
|
|||||||
Reference in New Issue
Block a user