Search in sources :

Example 6 with FilterRouteDto

use of io.github.tesla.ops.filter.dto.FilterRouteDto in project tesla by linking12.

the class FilterRouteController method list.

@Log("查询路由")
@RequiresPermissions("filter:route:route")
@GetMapping("/list")
@ResponseBody
public PageDO<RouteVo> list(@RequestParam Map<String, Object> params) {
    Query query = new Query(params);
    PageDO<FilterRouteDto> pageDto = routeService.queryList(query);
    PageDO<RouteVo> pageVo = new PageDO<>();
    pageVo.setTotal(pageDto.getTotal());
    List<FilterRouteDto> zuulDtos = pageDto.getRows();
    List<RouteVo> vos = Lists.newArrayListWithCapacity(zuulDtos.size());
    for (FilterRouteDto zuulDto : zuulDtos) {
        vos.add(RouteVo.buildRouteVo(zuulDto));
    }
    pageVo.setRows(vos);
    return pageVo;
}
Also used : PageDO(io.github.tesla.ops.system.domain.PageDO) Query(io.github.tesla.ops.utils.Query) FilterRouteDto(io.github.tesla.ops.filter.dto.FilterRouteDto) RouteVo(io.github.tesla.ops.filter.vo.RouteVo) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) GetMapping(org.springframework.web.bind.annotation.GetMapping) Log(io.github.tesla.ops.common.Log) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 7 with FilterRouteDto

use of io.github.tesla.ops.filter.dto.FilterRouteDto in project tesla by linking12.

the class FilterRouteController method edit.

@RequiresPermissions("filter:route:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, Model model) {
    FilterRouteDto zuulDto = routeService.get(id);
    RouteVo zuulVo = RouteVo.buildRouteVo(zuulDto);
    model.addAttribute("route", zuulVo);
    return prefix + "/edit";
}
Also used : FilterRouteDto(io.github.tesla.ops.filter.dto.FilterRouteDto) RouteVo(io.github.tesla.ops.filter.vo.RouteVo) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 8 with FilterRouteDto

use of io.github.tesla.ops.filter.dto.FilterRouteDto in project tesla by linking12.

the class RouteVo method buildRouteDto.

public FilterRouteDto buildRouteDto() {
    FilterRouteDto routeDto = new FilterRouteDto();
    routeDto.setRouteId(this.routeId);
    routeDto.setFromPath(this.fromPath);
    routeDto.setServiceId(this.serviceId);
    routeDto.setRpc(this.rpc);
    routeDto.setToHostport(this.toHostport);
    routeDto.setToPath(this.toPath);
    routeDto.setServiceName(this.serviceName);
    routeDto.setMethodName(this.methodName);
    routeDto.setServiceGroup(this.serviceGroup);
    routeDto.setServiceVersion(this.serviceVersion);
    routeDto.setInputParam(this.inputParam);
    return routeDto;
}
Also used : FilterRouteDto(io.github.tesla.ops.filter.dto.FilterRouteDto)

Aggregations

FilterRouteDto (io.github.tesla.ops.filter.dto.FilterRouteDto)8 RequiresPermissions (org.apache.shiro.authz.annotation.RequiresPermissions)4 FilterRouteDO (io.github.tesla.filter.domain.FilterRouteDO)3 FilterRpcDO (io.github.tesla.filter.domain.FilterRpcDO)3 Log (io.github.tesla.ops.common.Log)3 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)3 CommonResponse (io.github.tesla.ops.common.CommonResponse)2 TeslaException (io.github.tesla.ops.common.TeslaException)2 RouteVo (io.github.tesla.ops.filter.vo.RouteVo)2 PageDO (io.github.tesla.ops.system.domain.PageDO)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 PostMapping (org.springframework.web.bind.annotation.PostMapping)2 Query (io.github.tesla.ops.utils.Query)1