MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / create_flow_template

Method create_flow_template

mod/project/node/executorMod.py:837–850  ·  view source on GitHub ↗
(get)

Source from the content-addressed store, hash-verified

835
836 @staticmethod
837 def create_flow_template(get):
838 err = FlowTemplates.check(get)
839 if err:
840 return json_response(status=False, msg=err)
841 s = FlowTemplates.from_dict(get)
842 # 查重
843 e_db = TaskFlowsDB()
844 if e_db.FlowTemplate.find("name = ?", (s.name,)):
845 return json_response(status=False, msg="脚本名称已存在")
846 err = e_db.FlowTemplate.create(s)
847 if isinstance(err, str):
848 return json_response(status=False, msg=err)
849 e_db.close()
850 return json_response(status=True, msg="创建成功", data=s.to_dict())
851
852 @staticmethod
853 def modify_flow_template(get):

Callers

nothing calls this directly

Calls 8

closeMethod · 0.95
json_responseFunction · 0.90
TaskFlowsDBClass · 0.90
checkMethod · 0.45
from_dictMethod · 0.45
findMethod · 0.45
createMethod · 0.45
to_dictMethod · 0.45

Tested by

no test coverage detected