(get)
| 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): |
nothing calls this directly
no test coverage detected