MCPcopy Create free account
hub / github.com/C3ting/ARL / post

Method post

app/routes/github_task.py:48–73  ·  view source on GitHub ↗

Github 任务添加

(self)

Source from the content-addressed store, hash-verified

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
76delete_github_task_fields = ns.model('DeleteGithubTask', {

Callers

nothing calls this directly

Calls 2

submit_github_taskFunction · 0.90
parse_argsMethod · 0.80

Tested by

no test coverage detected