feat:add list contract by project_id
This commit is contained in:
@@ -61,3 +61,8 @@ class ContractRepository(BaseRepository):
|
|||||||
}
|
}
|
||||||
},return_document=ReturnDocument.AFTER)
|
},return_document=ReturnDocument.AFTER)
|
||||||
return result
|
return result
|
||||||
|
async def get_list(self,project_id:uuid.UUID):
|
||||||
|
contract = await use_collection(TaskEnv.CLN_CONTRACT).find(
|
||||||
|
{"project_id": project_id}
|
||||||
|
).to_list(None)
|
||||||
|
return contract
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from typing import List
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from fastapi import Body
|
from fastapi import Body
|
||||||
@@ -39,6 +40,11 @@ def update_extention(contract_id: UUID,coding: ExtensionModel = Body(...)):
|
|||||||
def create(coding: ContractModel = Body(...)):
|
def create(coding: ContractModel = Body(...)):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@router.get('/list/{project_id}', response_model=List[ContractModel], tags=_tag_base)
|
||||||
|
@shrink(repo.get_list)
|
||||||
|
def get_list(project_id:UUID):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
@router.put('/{_id}', response_model=ContractModel, tags=_tag_base)
|
@router.put('/{_id}', response_model=ContractModel, tags=_tag_base)
|
||||||
@shrink(repo.update)
|
@shrink(repo.update)
|
||||||
|
|||||||
Reference in New Issue
Block a user