Github 任务添加
(self)
| 46 | @auth |
| 47 | @ns.expect(add_github_task_fields) |
| 48 | def post(self): |
| 49 | """ |
| 50 | Github 任务添加 |
| 51 | """ |
| 52 | args = self.parse_args(add_github_task_fields) |
| 53 | name = args.pop('name') |
| 54 | keyword = args.pop('keyword') |
| 55 | keyword = keyword.strip() |
| 56 | if not keyword: |
| 57 | return utils.build_ret(ErrorMsg.GithubKeywordEmpty, data={}) |
| 58 | |
| 59 | task_data = { |
| 60 | "name": name, |
| 61 | "keyword": keyword, |
| 62 | "start_time": "-", |
| 63 | "end_time": "-", |
| 64 | "status": TaskStatus.WAITING, |
| 65 | } |
| 66 | |
| 67 | task_data = submit_github_task(task_data=task_data, |
| 68 | action=CeleryAction.GITHUB_TASK_TASK, delay_flag=True) |
| 69 | |
| 70 | if isinstance(task_data, str): |
| 71 | return utils.build_ret(ErrorMsg.Error, data={"error": task_data}) |
| 72 | |
| 73 | return utils.build_ret(ErrorMsg.Success, data=task_data) |
| 74 | |
| 75 | |
| 76 | delete_github_task_fields = ns.model('DeleteGithubTask', { |
nothing calls this directly
no test coverage detected