use of cn.exrick.manager.dto.ItemDto in project xmall by Exrick.
the class ItemServiceImpl method getItemById.
@Override
public ItemDto getItemById(Long id) {
ItemDto itemDto = new ItemDto();
TbItem tbItem = tbItemMapper.selectByPrimaryKey(id);
itemDto = DtoUtil.TbItem2ItemDto(tbItem);
TbItemCat tbItemCat = tbItemCatMapper.selectByPrimaryKey(itemDto.getCid());
itemDto.setCname(tbItemCat.getName());
TbItemDesc tbItemDesc = tbItemDescMapper.selectByPrimaryKey(id);
itemDto.setDetail(tbItemDesc.getItemDesc());
return itemDto;
}
Aggregations