def get(self, request, *args, **kwargs): """ 获取组件运行环境信息 --- parameters: - name: tenantName description: 租户名 required: true type: string paramType: path - name: serviceAlias description: 组件别名 required: true type: string paramType: path """ compile_env = compile_env_service.get_service_compile_env(self.service) bean = dict() selected_dependency = [] if compile_env: check_dependency = json.loads(compile_env.check_dependency) user_dependency = {} if compile_env.user_dependency: user_dependency = json.loads(compile_env.user_dependency) selected_dependency = [key.replace("ext-", "") for key in list(user_dependency.get("dependencies", {}).keys())] bean["check_dependency"] = check_dependency bean["user_dependency"] = user_dependency bean["service_id"] = compile_env.service_id bean["selected_dependency"] = selected_dependency result = general_message(200, "success", "查询编译环境成功", bean=bean) return Response(result, status=result["code"])
def get(self, request, *args, **kwargs): """ 获取服务运行环境信息 --- parameters: - name: tenantName description: 租户名 required: true type: string paramType: path - name: serviceAlias description: 服务别名 required: true type: string paramType: path """ try: compile_env = compile_env_service.get_service_compile_env( self.service) bean = dict() if compile_env: check_dependency = json.loads(compile_env.check_dependency) user_dependency = {} if compile_env.user_dependency: user_dependency = json.loads(compile_env.user_dependency) bean["check_dependency"] = check_dependency bean["user_dependency"] = user_dependency bean["service_id"] = compile_env.service_id result = general_message(200, "success", "查询编译环境成功", bean=bean) except Exception as e: logger.exception(e) result = error_message(e.message) return Response(result, status=result["code"])