(get)
| 699 | |
| 700 | @staticmethod |
| 701 | def modify_service(get): |
| 702 | try: |
| 703 | project_name = get.project_name.strip() |
| 704 | sid = get.sid.strip() |
| 705 | service_conf = get.service_conf |
| 706 | if isinstance(service_conf, str): |
| 707 | service_conf = json.loads(service_conf) |
| 708 | if not isinstance(service_conf, dict): |
| 709 | return json_response(False, '服务参数配置错误') |
| 710 | except: |
| 711 | return json_response(False, '参数错误') |
| 712 | |
| 713 | s_mgr = ServiceManager.new_mgr(project_name) |
| 714 | if isinstance(s_mgr, str): |
| 715 | return json_response(False, s_mgr) |
| 716 | |
| 717 | res = s_mgr.modify_service(sid, service_conf) |
| 718 | if isinstance(res, str): |
| 719 | return json_response(False, res) |
| 720 | return json_response(True, msg="修改成功") |
| 721 | |
| 722 | @staticmethod |
| 723 | def remove_service(get): |
nothing calls this directly
no test coverage detected