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

Method add_service

mod/project/python/serviceMod.py:681–698  ·  view source on GitHub ↗
(get)

Source from the content-addressed store, hash-verified

679
680 @staticmethod
681 def add_service(get):
682 try:
683 project_name = get.project_name.strip()
684 service_conf = get.service_conf
685 if isinstance(service_conf, str):
686 service_conf = json.loads(service_conf)
687 if not isinstance(service_conf, dict):
688 return json_response(False, '服务参数配置错误')
689 except:
690 return json_response(False, '参数错误')
691
692 s_mgr = ServiceManager.new_mgr(project_name)
693 if isinstance(s_mgr, str):
694 return json_response(False, s_mgr)
695 res = s_mgr.add_service(service_conf)
696 if isinstance(res, str):
697 return json_response(False, res)
698 return json_response(True, msg="添加成功")
699
700 @staticmethod
701 def modify_service(get):

Callers

nothing calls this directly

Calls 3

json_responseFunction · 0.90
new_mgrMethod · 0.80
loadsMethod · 0.45

Tested by

no test coverage detected