HELP.md | |||||
target/ | |||||
!.mvn/wrapper/maven-wrapper.jar | |||||
!**/src/main/**/target/ | |||||
!**/src/test/**/target/ | |||||
### STS ### | |||||
.apt_generated | |||||
.classpath | |||||
.factorypath | |||||
.project | |||||
.settings | |||||
.springBeans | |||||
.sts4-cache | |||||
### IntelliJ IDEA ### | |||||
.idea | |||||
*.iws | |||||
*.iml | |||||
*.ipr | |||||
### NetBeans ### | |||||
/nbproject/private/ | |||||
/nbbuild/ | |||||
/dist/ | |||||
/nbdist/ | |||||
/.nb-gradle/ | |||||
build/ | |||||
!**/src/main/**/build/ | |||||
!**/src/test/**/build/ | |||||
### VS Code ### | |||||
.vscode/ |
* 获取算法的调度包行业信息及对应的算法实例 | * 获取算法的调度包行业信息及对应的算法实例 | ||||
*/ | */ | ||||
public static final String FIND_EXAMPLE = "/industryServiceInst/list"; | public static final String FIND_EXAMPLE = "/industryServiceInst/list"; | ||||
/** | |||||
* 获取算法的调度包行业信息及对应的算法实例 | |||||
*/ | |||||
public static final String FIND_MODELIST = "/industryServiceInst/getModelList"; | |||||
} | } |
package com.tuoheng.model.param; | package com.tuoheng.model.param; | ||||
import com.tuoheng.third.request.ModelInfoDao; | |||||
import com.tuoheng.third.vo.ModelInfoVo; | |||||
import lombok.Data; | import lombok.Data; | ||||
import java.util.List; | |||||
/** | /** | ||||
* @author chenjiandong | * @author chenjiandong | ||||
* @description: TODO | * @description: TODO | ||||
/** | /** | ||||
* 该平台对应服务实例id(多个逗号隔开) | * 该平台对应服务实例id(多个逗号隔开) | ||||
*/ | */ | ||||
private String serviceId;; | |||||
private String serviceId; | |||||
/** | /** | ||||
* 该平台对应角色id | * 该平台对应角色id | ||||
*/ | */ | ||||
* 角色名 | * 角色名 | ||||
*/ | */ | ||||
private String roleName; | private String roleName; | ||||
/** | |||||
* 服务实例名称 | |||||
*/ | |||||
private String serviceName; | |||||
/** | |||||
* 模型集合及其对应检测目标集合 | |||||
*/ | |||||
private List<ModelInfoDao> modelInfoDaos; | |||||
} | } |
* 1 启用 0禁用 | * 1 启用 0禁用 | ||||
*/ | */ | ||||
private Integer status; | private Integer status; | ||||
///** | |||||
// *是否包含机场平台 | |||||
// */ | |||||
// | |||||
//private Boolean isAirport; | |||||
} | } |
import com.tuoheng.model.vo.TenantVo; | import com.tuoheng.model.vo.TenantVo; | ||||
import com.tuoheng.model.vo.UserVo; | import com.tuoheng.model.vo.UserVo; | ||||
import com.tuoheng.service.TenantService; | import com.tuoheng.service.TenantService; | ||||
import com.tuoheng.third.service.impl.ThirdServiceImpl; | |||||
import com.tuoheng.until.JsonResult; | import com.tuoheng.until.JsonResult; | ||||
import com.tuoheng.until.MapUtils; | import com.tuoheng.until.MapUtils; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
@Autowired | @Autowired | ||||
private RestTemplate restTemplate; | private RestTemplate restTemplate; | ||||
@Autowired | |||||
private ThirdServiceImpl thirdService; | |||||
@Autowired | @Autowired | ||||
private PlatformMapper platformMapper; | private PlatformMapper platformMapper; | ||||
clientUserRoleMapper.batchInsert(clientUserRolePoArrayList); | clientUserRoleMapper.batchInsert(clientUserRolePoArrayList); | ||||
//todo:调用业务系统完成租户创建 | //todo:调用业务系统完成租户创建 | ||||
List<ClientRoleDto> list = createClientTenantDto.getClientRoleDtoList(); | List<ClientRoleDto> list = createClientTenantDto.getClientRoleDtoList(); | ||||
list = thirdService.getModelList(list); | |||||
createClientTenantDto.setClientRoleDtoList(list); | |||||
for (ClientRoleDto clientRoleDto : list) { | for (ClientRoleDto clientRoleDto : list) { | ||||
try { | try { | ||||
log.info("参数:{}", clientRoleDto.toString()); | log.info("参数:{}", clientRoleDto.toString()); | ||||
log.info("删除集合:{}", deleteClientRoleDtoList.toString()); | log.info("删除集合:{}", deleteClientRoleDtoList.toString()); | ||||
log.info("交集集合:{}", coincideClientRoleDtoList.toString()); | log.info("交集集合:{}", coincideClientRoleDtoList.toString()); | ||||
//交集集合做更新操作 editTenant | //交集集合做更新操作 editTenant | ||||
clientTenantDto.setClientRoleDtoList(thirdService.getModelList(clientTenantDto.getClientRoleDtoList())); | |||||
for (ClientRoleDto clientRoleDto : coincideClientRoleDtoList) { | for (ClientRoleDto clientRoleDto : coincideClientRoleDtoList) { | ||||
try { | try { | ||||
editResult(clientTenantDto, clientRoleDto.getClientId(), DictConstant.EDIT_TENANT, loginUser); | editResult(clientTenantDto, clientRoleDto.getClientId(), DictConstant.EDIT_TENANT, loginUser); | ||||
if (CollectionUtil.isNotEmpty(insertClientRoleDtoList)) { | if (CollectionUtil.isNotEmpty(insertClientRoleDtoList)) { | ||||
//todo:调用业务系统完成租户创建 | //todo:调用业务系统完成租户创建 | ||||
dto.setClientRoleDtoList(thirdService.getModelList(dto.getClientRoleDtoList())); | |||||
for (ClientRoleDto clientRoleDto : insertClientRoleDtoList) { | for (ClientRoleDto clientRoleDto : insertClientRoleDtoList) { | ||||
try { | try { | ||||
log.info("参数:{}", clientRoleDto.toString()); | log.info("参数:{}", clientRoleDto.toString()); |
package com.tuoheng.third.request; | |||||
import lombok.Data; | |||||
@Data | |||||
public class ModelInfoDao { | |||||
private String id; | |||||
private String serviceInstId; | |||||
private String modelId; | |||||
private String modelName; | |||||
private String detectTargetsId; | |||||
private String detectTargetsName; | |||||
private String detectTargetsCode; | |||||
private String serviceName; | |||||
} |
package com.tuoheng.third.service; | package com.tuoheng.third.service; | ||||
import com.tuoheng.model.dto.LoginUser; | import com.tuoheng.model.dto.LoginUser; | ||||
import com.tuoheng.model.param.ClientRoleDto; | |||||
import com.tuoheng.third.request.ThirdRequest; | import com.tuoheng.third.request.ThirdRequest; | ||||
import com.tuoheng.until.JsonResult; | import com.tuoheng.until.JsonResult; | ||||
import java.util.List; | |||||
public interface ThirdService { | public interface ThirdService { | ||||
/** | /** | ||||
* dsp -获取算法实例 | * dsp -获取算法实例 | ||||
* @return | * @return | ||||
*/ | */ | ||||
JsonResult getMenuList(ThirdRequest request, LoginUser loginUser); | JsonResult getMenuList(ThirdRequest request, LoginUser loginUser); | ||||
/** | |||||
* 获取对应算法实例及其对应名称及其相关模型监测目标等 | |||||
* @param list | |||||
* @return | |||||
*/ | |||||
List<ClientRoleDto> getModelList(List<ClientRoleDto> list); | |||||
} | } |
import com.tuoheng.model.dto.Platform; | import com.tuoheng.model.dto.Platform; | ||||
import com.tuoheng.model.dto.RoleDto; | import com.tuoheng.model.dto.RoleDto; | ||||
import com.tuoheng.model.entity.DictData; | import com.tuoheng.model.entity.DictData; | ||||
import com.tuoheng.model.param.ClientRoleDto; | |||||
import com.tuoheng.third.request.ModelInfoDao; | |||||
import com.tuoheng.third.request.ThirdRequest; | import com.tuoheng.third.request.ThirdRequest; | ||||
import com.tuoheng.third.service.ThirdService; | import com.tuoheng.third.service.ThirdService; | ||||
import com.tuoheng.third.vo.*; | import com.tuoheng.third.vo.*; | ||||
import org.springframework.core.ParameterizedTypeReference; | import org.springframework.core.ParameterizedTypeReference; | ||||
import org.springframework.http.*; | import org.springframework.http.*; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import org.springframework.util.CollectionUtils; | |||||
import org.springframework.util.StringUtils; | |||||
import org.springframework.web.client.RestTemplate; | import org.springframework.web.client.RestTemplate; | ||||
import java.util.*; | import java.util.*; | ||||
return JsonResult.success(serviceInstListVoList); | return JsonResult.success(serviceInstListVoList); | ||||
} | } | ||||
/** | |||||
* 根据serviceIds获取对面模型集合相关 | |||||
* | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public List<ClientRoleDto> getModelList(List<ClientRoleDto> list) { | |||||
for (ClientRoleDto clientRoleDto : list) { | |||||
if (ObjectUtil.isNotEmpty(clientRoleDto.getServiceId())) { | |||||
List<String> collect = Arrays.stream(clientRoleDto.getServiceId().split(",")).collect(Collectors.toList()); | |||||
String param = collect.toString().replace("[", "").replace("]", ""); | |||||
String url = CommonConfig.dspURL + DspConstant.FIND_MODELIST + "?serviceIds=" + param; | |||||
ParameterizedTypeReference<JsonResult<List<ModelInfoDao>>> parameterizedTypeReference = | |||||
new ParameterizedTypeReference<JsonResult<List<ModelInfoDao>>>() { | |||||
}; | |||||
ResponseEntity<JsonResult<List<ModelInfoDao>>> response; | |||||
try { | |||||
log.info("url:{}", url); | |||||
response = restTemplate.exchange(url, HttpMethod.GET, null, parameterizedTypeReference); | |||||
} catch (Exception e) { | |||||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "请求发送内部出现异常!"); | |||||
} | |||||
if (null == response || !response.hasBody() || response.getBody().getCode() != JsonResult.SUCCESS) { | |||||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "dsp获取服务实例异常"); | |||||
} | |||||
List<ModelInfoDao> modelInfoDaos = response.getBody().getData(); | |||||
clientRoleDto.setModelInfoDaos(modelInfoDaos); | |||||
} | |||||
} | |||||
return list; | |||||
} | |||||
/** | /** | ||||
* 查询对应业务平台的所有角色 | * 查询对应业务平台的所有角色 | ||||
* | * |
package com.tuoheng.third.vo; | |||||
import lombok.Data; | |||||
/** | |||||
* @Author xiaoying | |||||
* @Date 2023/9/13 10:22 | |||||
*/ | |||||
@Data | |||||
public class DetectTargetsVo { | |||||
/** | |||||
* 检测目标id | |||||
*/ | |||||
private String detectTargetsId; | |||||
/** | |||||
* 检测目标名称 | |||||
*/ | |||||
private String detectTargetsName; | |||||
/** | |||||
* 检测目标code | |||||
*/ | |||||
private String detectTargetsCode; | |||||
} |
package com.tuoheng.third.vo; | |||||
import lombok.Data; | |||||
import java.util.List; | |||||
/** | |||||
* @Author xiaoying | |||||
* @Date 2023/9/13 10:22 | |||||
*/ | |||||
@Data | |||||
public class ModelInfoVo { | |||||
/** | |||||
* 模型id | |||||
*/ | |||||
private String modelId; | |||||
/** | |||||
* 模型名称 | |||||
*/ | |||||
private String modelName; | |||||
/** | |||||
* 检测目标集合 | |||||
*/ | |||||
private List<DetectTargetsVo> detectTargetsVoList; | |||||
} |
*/ | */ | ||||
private String name; | private String name; | ||||
/** | /** | ||||
* 服务实例id | |||||
* 服务实例详情 | |||||
*/ | */ | ||||
private String description; | private String description; | ||||
} | } |
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport-test.t-aaron.com | airport-url: https://airport-test.t-aaron.com | ||||
#dsp配置地址 | #dsp配置地址 | ||||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||||
dsp-url: http://192.168.11.11:7011/api/web/dsp | |||||
# 高德Key | # 高德Key | ||||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | gaodeKey: 5a1f63e7563cba471a9d0773e218144a | ||||
# 图片域名 | # 图片域名 |
package com.tuoheng; | package com.tuoheng; | ||||
import com.tuoheng.model.param.ClientRoleDto; | |||||
import com.tuoheng.third.service.impl.ThirdServiceImpl; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.security.crypto.password.PasswordEncoder; | import org.springframework.security.crypto.password.PasswordEncoder; | ||||
import org.springframework.test.context.junit4.SpringRunner; | import org.springframework.test.context.junit4.SpringRunner; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
/** | /** | ||||
* @Author xiaoying | * @Author xiaoying | ||||
* @Date 2023/2/21 11:12 | * @Date 2023/2/21 11:12 | ||||
@Autowired | @Autowired | ||||
PasswordEncoder passwordEncoder; | PasswordEncoder passwordEncoder; | ||||
@Autowired | |||||
ThirdServiceImpl thirdService; | |||||
/* | /* | ||||
明文,加密成密文 | 明文,加密成密文 | ||||
*/ | */ | ||||
boolean matches = passwordEncoder.matches(password, encode); | boolean matches = passwordEncoder.matches(password, encode); | ||||
System.out.println(matches); | System.out.println(matches); | ||||
} | } | ||||
@Test | |||||
public void getModelList() { | |||||
List<ClientRoleDto> list =new ArrayList<>(); | |||||
ClientRoleDto clientRoleDto = new ClientRoleDto(); | |||||
clientRoleDto.setServiceId("85b0fe8a352c4dbda6191a382362a81a"); | |||||
ClientRoleDto clientRoleDto2 = new ClientRoleDto(); | |||||
clientRoleDto.setServiceId("e5137ec466db426c96a8b194a6853b77"); | |||||
list.add(clientRoleDto); | |||||
list.add(clientRoleDto2); | |||||
List<ClientRoleDto> modelList = thirdService.getModelList(list); | |||||
System.out.println("modelList = " + modelList); | |||||
} | |||||
} | } |
# 最小连接池数量 | # 最小连接池数量 | ||||
minIdle: 5 | minIdle: 5 | ||||
# 最大连接池数量 | # 最大连接池数量 | ||||
maxActive: 20 | |||||
maxActive: 50 | |||||
# 配置获取连接等待超时的时间 | # 配置获取连接等待超时的时间 | ||||
maxWait: 60000 | maxWait: 60000 | ||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
spring: | spring: | ||||
profiles: | profiles: | ||||
active: test | |||||
active: dev | |||||
web: | web: | ||||
resources: | resources: | ||||
static-locations: classpath:/ | static-locations: classpath:/ |
spring: | spring: | ||||
profiles: | profiles: | ||||
active: test | |||||
active: dev | |||||
web: | web: | ||||
resources: | resources: | ||||
static-locations: classpath:/ | static-locations: classpath:/ |
com\tuoheng\config\MyCorsFilter.class | com\tuoheng\config\MyCorsFilter.class | ||||
com\tuoheng\config\JWKSourceConfig.class | com\tuoheng\config\JWKSourceConfig.class | ||||
com\tuoheng\mapper\AuthoritiesMapper.class | com\tuoheng\mapper\AuthoritiesMapper.class | ||||
com\tuoheng\exception\DiyException.class | |||||
com\tuoheng\controller\HealthController.class | com\tuoheng\controller\HealthController.class | ||||
com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationConverter.class | com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationConverter.class | ||||
com\tuoheng\model\po\AuthoritiesPo.class | com\tuoheng\model\po\AuthoritiesPo.class | ||||
com\tuoheng\oauth2\authentication\OAuth2EndpointUtils.class | com\tuoheng\oauth2\authentication\OAuth2EndpointUtils.class | ||||
com\tuoheng\model\param\CreateUserDto.class | com\tuoheng\model\param\CreateUserDto.class | ||||
com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationProvider.class | com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationProvider.class | ||||
com\tuoheng\model\dto\AuthoritiesDto.class | |||||
com\tuoheng\service\OidcUserInfoService.class | com\tuoheng\service\OidcUserInfoService.class | ||||
com\tuoheng\model\param\GetUserInfoDto.class | com\tuoheng\model\param\GetUserInfoDto.class |
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\config\VerifyCodeFilter.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\config\VerifyCodeFilter.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\dto\UserBaseInfoDto.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\dto\UserBaseInfoDto.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\service\impl\OidcUserInfoServiceImpl.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\service\impl\OidcUserInfoServiceImpl.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\exception\DiyException.java | |||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationConverter.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationConverter.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\config\MyCorsFilter.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\config\MyCorsFilter.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\service\impl\UserServiceImpl.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\service\impl\UserServiceImpl.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\dto\ClientRoleDto.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\dto\ClientRoleDto.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationProvider.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationProvider.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\mapper\AuthoritiesMapper.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\mapper\AuthoritiesMapper.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\dto\AuthoritiesDto.java | |||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationToken.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\oauth2\authentication\OAuth2ResourceOwnerPasswordAuthenticationToken.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\param\CreateUserDto.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\param\CreateUserDto.java | ||||
D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\po\AuthoritiesPo.java | D:\myprojects\tuohen\tuoheng_oidc\tuoheng_oidc_server\src\main\java\com\tuoheng\model\po\AuthoritiesPo.java |