能力挂接注册网关

This commit is contained in:
huangweixiong 2022-08-08 15:17:03 +08:00
parent f7af710466
commit 1e8c970c39
1 changed files with 14 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import io.renren.common.utils.Result;
import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.modules.processForm.service.ApiGatewayService;
import io.renren.modules.resource.dataResource.AbstractDataResourceService;
import io.renren.modules.resource.dataResource.DataResourceFactory;
import io.renren.modules.resource.dto.GetDataResourceListDto;
@ -107,6 +108,9 @@ public class ResourceController {
@Autowired
private SysDeptService sysDeptService;
@Autowired
private ApiGatewayService apiGatewayService;
@Lazy
@Autowired
private JdbcTemplate jdbcTemplate;
@ -246,6 +250,16 @@ public class ResourceController {
logger.info(dto.toString());
resourceService.insertWithAttrs(dto);
if (!"f".equals(source) && dto.getId() != null) {//后台挂架直接上架
try {
apiGatewayService.registerApi2Gateway(dto.getId().toString());
}catch (Exception exception){
//注册失败忽略简单记录一下
logger.error("挂接网关注册失败", exception);
}
}
return new Result().ok(dto.getId() == null ? "" : dto.getId());
}