use of io.github.tesla.filter.domain.FilterRpcDO in project tesla by linking12.
the class FilterRouteServiceImpl method list.
@Override
public List<FilterRouteDto> list(Map<String, Object> map) {
List<FilterRouteDO> routes = routeDao.list(map);
List<FilterRouteDto> routeDtos = Lists.newArrayList();
for (FilterRouteDO route : routes) {
FilterRpcDO rpc = rpcDao.get(route.getId());
FilterRouteDto routeDto = FilterRouteDto.buildRouteDto(route, rpc);
routeDtos.add(routeDto);
}
return routeDtos;
}
use of io.github.tesla.filter.domain.FilterRpcDO in project tesla by linking12.
the class FilterRouteServiceImpl method update.
@Override
public int update(FilterRouteDto routeDto) {
FilterRouteDO routeDo = routeDto.buildRoute();
FilterRpcDO rpcDo = routeDto.buildRpc();
int success2 = routeDao.update(routeDo);
if (routeDo.getRpc()) {
int success1 = rpcDao.update(rpcDo);
if (success1 > 0 && success2 > 0) {
return CommonResponse.SUCCESS;
} else {
return CommonResponse.ERROR;
}
}
return success2;
}
use of io.github.tesla.filter.domain.FilterRpcDO in project tesla by linking12.
the class FilterRouteServiceImpl method get.
@Override
public FilterRouteDto get(Long routeId) {
FilterRouteDO route = routeDao.get(routeId);
FilterRpcDO rpc = rpcDao.get(routeId);
FilterRouteDto routeDto = FilterRouteDto.buildRouteDto(route, rpc);
return routeDto;
}
use of io.github.tesla.filter.domain.FilterRpcDO in project tesla by linking12.
the class FilterRouteServiceImpl method queryList.
@Override
public PageDO<FilterRouteDto> queryList(Query query) {
int total = routeDao.count(query);
List<FilterRouteDO> routes = routeDao.list(query);
List<FilterRouteDto> dtos = Lists.newArrayListWithCapacity(routes.size());
for (FilterRouteDO routeDo : routes) {
FilterRpcDO rpcDO = rpcDao.get(routeDo.getId());
FilterRouteDto dto = FilterRouteDto.buildRouteDto(routeDo, rpcDO);
dtos.add(dto);
}
PageDO<FilterRouteDto> page = new PageDO<>();
page.setTotal(total);
page.setRows(dtos);
return page;
}
use of io.github.tesla.filter.domain.FilterRpcDO in project tesla by linking12.
the class FilterRouteDto method buildRpc.
public FilterRpcDO buildRpc() {
FilterRpcDO rpcDO = new FilterRpcDO();
rpcDO.setServiceName(this.serviceName);
rpcDO.setMethodName(this.methodName);
rpcDO.setServiceGroup(this.serviceGroup);
rpcDO.setServiceVersion(this.serviceVersion);
rpcDO.setProtoContext(this.protoContext);
rpcDO.setInputParam(this.inputParam);
rpcDO.setRouteId(this.routeId);
return rpcDO;
}
Aggregations