Search in sources :

Example 1 with FilterRpcDO

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;
}
Also used : FilterRouteDO(io.github.tesla.filter.domain.FilterRouteDO) FilterRouteDto(io.github.tesla.ops.filter.dto.FilterRouteDto) FilterRpcDO(io.github.tesla.filter.domain.FilterRpcDO)

Example 2 with FilterRpcDO

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;
}
Also used : FilterRouteDO(io.github.tesla.filter.domain.FilterRouteDO) FilterRpcDO(io.github.tesla.filter.domain.FilterRpcDO)

Example 3 with FilterRpcDO

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;
}
Also used : FilterRouteDO(io.github.tesla.filter.domain.FilterRouteDO) FilterRouteDto(io.github.tesla.ops.filter.dto.FilterRouteDto) FilterRpcDO(io.github.tesla.filter.domain.FilterRpcDO)

Example 4 with FilterRpcDO

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;
}
Also used : PageDO(io.github.tesla.ops.system.domain.PageDO) FilterRouteDO(io.github.tesla.filter.domain.FilterRouteDO) FilterRouteDto(io.github.tesla.ops.filter.dto.FilterRouteDto) FilterRpcDO(io.github.tesla.filter.domain.FilterRpcDO)

Example 5 with FilterRpcDO

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;
}
Also used : FilterRpcDO(io.github.tesla.filter.domain.FilterRpcDO)

Aggregations

FilterRpcDO (io.github.tesla.filter.domain.FilterRpcDO)9 FilterRouteDO (io.github.tesla.filter.domain.FilterRouteDO)6 FilterRouteDto (io.github.tesla.ops.filter.dto.FilterRouteDto)3 ByteBuf (io.netty.buffer.ByteBuf)2 DefaultFullHttpResponse (io.netty.handler.codec.http.DefaultFullHttpResponse)2 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)2 PageDO (io.github.tesla.ops.system.domain.PageDO)1