|
|
@@ -14,6 +14,7 @@ import com.tuoheng.third.request.ThirdRequest; |
|
|
|
import com.tuoheng.third.service.ThirdService; |
|
|
|
import com.tuoheng.third.vo.IndustryVo; |
|
|
|
import com.tuoheng.third.vo.RoleMenuVo; |
|
|
|
import com.tuoheng.third.vo.ServiceExampleVo; |
|
|
|
import com.tuoheng.until.JsonResult; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@@ -64,7 +65,19 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
if (response == null || !response.hasBody() || response.getBody().getCode() != JsonResult.SUCCESS) { |
|
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "dsp获取服务实例异常"); |
|
|
|
} |
|
|
|
return JsonResult.success(response.getBody().getData()); |
|
|
|
|
|
|
|
List<IndustryVo> list = response.getBody().getData(); |
|
|
|
List<ServiceExampleVo> serviceInstListVoList = new ArrayList<>(); |
|
|
|
for (IndustryVo industryVo : list) { |
|
|
|
List<ServiceExampleVo> serviceExampleVos = industryVo.getServiceInstListVoList(); |
|
|
|
if (ObjectUtil.isNotEmpty(serviceExampleVos)) { |
|
|
|
for (ServiceExampleVo serviceExampleVo : serviceExampleVos) { |
|
|
|
serviceInstListVoList.add(serviceExampleVo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return JsonResult.success(serviceInstListVoList); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -80,19 +93,7 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
if (ObjectUtil.isEmpty(clientId)) { |
|
|
|
return JsonResult.error("clientId不能为空"); |
|
|
|
} |
|
|
|
List<ClientRoleListDto> clientRoleListDtos = new ArrayList<>(); |
|
|
|
|
|
|
|
if (clientId.contains(CommonConstant.COMMA)) { |
|
|
|
String[] clientIds = clientId.split(CommonConstant.COMMA); |
|
|
|
for (String id : clientIds) { |
|
|
|
ClientRoleListDto dto = getRoleListByClinetId(id, loginUser); |
|
|
|
clientRoleListDtos.add(dto); |
|
|
|
} |
|
|
|
} else { |
|
|
|
ClientRoleListDto dto = getRoleListByClinetId(clientId, loginUser); |
|
|
|
clientRoleListDtos.add(dto); |
|
|
|
} |
|
|
|
return JsonResult.success(clientRoleListDtos); |
|
|
|
return JsonResult.success(getRoleListByClinetId(clientId, loginUser)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -178,7 +179,7 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
* @param loginUser |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private ClientRoleListDto getRoleListByClinetId(String clientId, LoginUser loginUser) { |
|
|
|
private List<RoleDto> getRoleListByClinetId(String clientId, LoginUser loginUser) { |
|
|
|
|
|
|
|
Platform platform = platformMapper.selectOne(Wrappers.<Platform>lambdaQuery() |
|
|
|
.eq(Platform::getPlatformCode, clientId) |
|
|
@@ -186,9 +187,6 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
if (ObjectUtil.isNull(platform)) { |
|
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "该业务平台不存在"); |
|
|
|
} |
|
|
|
ClientRoleListDto clientRoleListDto = new ClientRoleListDto(); |
|
|
|
clientRoleListDto.setPlatformName(platform.getPlatformName()); |
|
|
|
clientRoleListDto.setClientId(platform.getPlatformCode()); |
|
|
|
|
|
|
|
String url = platform.getPlatformUrl(); |
|
|
|
//根据不同业务平台进行动态匹配 ->并修改对应标识权限 |
|
|
@@ -235,9 +233,7 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
} |
|
|
|
List<RoleDto> roleDtos = response.getBody().getData(); |
|
|
|
|
|
|
|
clientRoleListDto.setRoleDtoList(roleDtos); |
|
|
|
|
|
|
|
return clientRoleListDto; |
|
|
|
return roleDtos; |
|
|
|
|
|
|
|
} |
|
|
|
} |