Search in sources :

Example 1 with RouteVo

use of io.github.tesla.ops.filter.vo.RouteVo 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 2 with RouteVo

use of io.github.tesla.ops.filter.vo.RouteVo 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)

Aggregations

FilterRouteDto (io.github.tesla.ops.filter.dto.FilterRouteDto)2 RouteVo (io.github.tesla.ops.filter.vo.RouteVo)2 RequiresPermissions (org.apache.shiro.authz.annotation.RequiresPermissions)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 Log (io.github.tesla.ops.common.Log)1 PageDO (io.github.tesla.ops.system.domain.PageDO)1 Query (io.github.tesla.ops.utils.Query)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1