/*
/product/categorybrandrelation/brands/list
1、Controller:处理请求,接受和校验数据
2、Service接受controller传来的数据,进行业务处理
3、Controller接受Service处理完的数据,封装页面指定的vo
*/
如:
/*** /product/categorybrandrelation/brands/list** 1、Controller:处理请求,接受和校验数据* 2、Service接受controller传来的数据,进行业务处理* 3、Controller接受Service处理完的数据,封装页面指定的vo*/@GetMapping("/brands/list")public R relationBrandsList(@RequestParam(value = "catId",required = true)Long catId){List<BrandEntity> vos = categoryBrandRelationService.getBrandsByCatId(catId);List<BrandVo> collect = vos.stream().map(item -> {BrandVo brandVo = new BrandVo();brandVo.setBrandId(item.getBrandId());brandVo.setBrandName(item.getName());return brandVo;}).collect(Collectors.toList());return R.ok().put("data",collect);}
