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

Method modify_group_projects

mod/project/java/groupMod.py:868–889  ·  view source on GitHub ↗
(group_id: str, project_datas: list)

Source from the content-addressed store, hash-verified

866
867 @staticmethod
868 def modify_group_projects(group_id: str, project_datas: list) -> Optional[str]:
869 g = Group(group_id)
870 if not g.config:
871 return "项目组不存在"
872
873 project_ids = [p["id"] for p in project_datas]
874 project_list = public.M("sites").where(
875 'project_type=? AND id IN ({})'.format(",".join(["?"] * len(project_ids))),
876 ('Java', *project_ids)
877 ).select()
878
879 for p in project_list:
880 project_config = json.loads(p["project_config"])
881 if not project_config["java_type"] in GroupMager.cache_type:
882 return "指定项目【{}】不是spring boot项目, 不支持设置到项目组".format(p["name"])
883
884 g.config["projects"] = project_datas
885 res = g.check_group_data()
886 if isinstance(res, str):
887 return res
888
889 g.save_group_data()
890
891 @staticmethod
892 def modify_group_project(group_id: str, project_id: int,

Callers

nothing calls this directly

Calls 9

check_group_dataMethod · 0.95
save_group_dataMethod · 0.95
GroupClass · 0.70
selectMethod · 0.45
whereMethod · 0.45
MMethod · 0.45
formatMethod · 0.45
joinMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected