(group_id: str, project_datas: list)
| 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, |
nothing calls this directly
no test coverage detected