Esempio n. 1
0
 def get(self: Resource, args: typing.Dict):
     count, processed, result = ManualTaskService(
     ).get_user_task_or_mark_task_result_by_role(self.get_current_user(),
                                                 args)
     return {
         "message": "请求成功",
         "result": result,
         "count": count,
         "processed": processed
     }, 200
Esempio n. 2
0
    def get(self: Resource, args: typing.Dict,
            task_id: int) -> typing.Tuple[typing.Dict, int]:
        preview_task_id, next_task_id = ManualTaskService(
        ).get_preview_and_next_task_id(self.get_current_user(), task_id, args)

        return {
            "message": "请求成功",
            "next_id": next_task_id,
            "prev_id": preview_task_id
        }, 200
Esempio n. 3
0
 def patch(self: Resource, args: typing.Dict,
           task_id: int) -> typing.Tuple[typing.Dict, int]:
     """
     仅仅作为标注员保存自己的标注数据
     """
     result = ManualTaskService().update_user_task_status(
         self.get_current_user(), task_id, args)
     return {
         "message": "更新成功",
         "result": result,
     }, 201
Esempio n. 4
0
 def post(self, task_id: int):
     """
     导出审核员查看详情时,导出pdf
     :param task_id:
     :return:
     """
     doc_unique_name, doc_raw_name, labels = ManualTaskService().export_pdf(
         task_id)
     return PDFAnnotationExport(
         folder='upload',
         unique_name=doc_unique_name,
         file_name=doc_raw_name).export_with_annotation(labels)
Esempio n. 5
0
 def get(self: Resource, task_id: int) -> typing.Tuple[typing.Dict, int]:
     result = ManualTaskService().get_mark_task_or_user_task(
         self.get_current_user(), task_id)
     return {"message": "请求成功", "result": result}, 200
Esempio n. 6
0
 def put(self, task_id):
     ManualTaskService().reject_mark_task(task_id)
     return {
         "message": "更新成功",
     }, 201
Esempio n. 7
0
 def delete(self, task_id):
     ManualTaskService().detele_task(task_id)
     return {
         "message": "删除成功",
     }, 204