/**
* 根据商品id查询商品信息
*/
@RequestMapping(
"/item/{itemId}")
public TbItem
getItemById(@PathVariable Long itemId){
TbItem tbItem = itemService.getItemById(itemId);
return tbItem;
}
结果:
改正:
@RequestMapping(
"/item/{itemId}")
@ResponseBody
public TbItem
getItemById(@PathVariable Long itemId){
TbItem tbItem = itemService.getItemById(itemId);
return tbItem;
}
结果: