前端传递的变量和后端接收的变量名字不一致时,用注解@RequestParam来实现数据的传递
例如:@RequestParam(value="id")
//实现商品的分类目录展现
/**
* value="实现数据的传递"
* defaultValue:如果参数为null时生效
* required=true,该参数必须传值
* @param parentId
* @return
*/
@RequestMapping("/cat/list")
@ResponseBody
public List<EasyUITree> findItemCatById(
@RequestParam(value="id",defaultValue="0") Long parentId){
//查询一级商品分类标题
//Long parentId=id;
return itemCatService.findItemCatListById(parentId);
}
相关文章:
-
2022-12-23
-
2022-12-23
-
2021-11-07
-
2022-12-23
-
2022-01-01
-
2022-12-23
猜你喜欢
-
2022-12-23
-
2021-10-14
-
2022-12-23
-
2021-06-18
-
2022-12-23
-
2021-09-13
-
2021-05-27
相关资源
-
下载
2022-12-17
-
下载
2023-03-21
-
下载
2021-07-02