1
0
mirror of https://gitee.com/coder-xiaomo/flashsale synced 2025-01-10 19:58:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

商品详情页

This commit is contained in:
程序员小墨 2022-03-03 15:38:55 +08:00
parent 14f999e598
commit ab0b78f278

View File

@ -42,6 +42,17 @@ public class ItemController extends BaseController {
return CommonReturnType.create(itemVO);
}
// 商品详情页浏览
@RequestMapping(value = "/get", method = {RequestMethod.GET})
@ResponseBody
public CommonReturnType getItem(@RequestParam(name = "id") Integer id) {
ItemModel itemModel = itemService.getItemById(id);
ItemVO itemVO = convertVOFromModel(itemModel);
return CommonReturnType.create(itemVO);
}
private ItemVO convertVOFromModel(ItemModel itemModel) {
if (itemModel == null) {
return null;