能力挂接注册网关
This commit is contained in:
parent
f7af710466
commit
1e8c970c39
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue