Controller层负责前后端交互,接收前端请求,调用Service层,接收Service层返回的数据,最后返回具体的数据和页面到客户端
@NoAuth
@RequestMapping("/findCommodityListByType")
public Object findCommodityListByType(@RequestParam(value = "typeId", required = false) Integer typeId) {
if (typeId == null) {
return BaseResponse.error("typeId参数不可为空");
}
List<Commodity> commodityType = commodityService.getCommodityType(typeId);
return BaseResponse.success(commodityType);
}
Service层:Service层也可以分为三个方面
(1)接口:用来声