| | |
| | | package com.hrt.system.controller.miniapp; |
| | | |
| | | import com.hrt.common.core.domain.R; |
| | | import com.hrt.common.security.utils.SecurityUtils; |
| | | import com.hrt.system.domain.dto.AppBaseGetDto; |
| | | import com.hrt.system.domain.dto.AppGoodsInfoGetDto; |
| | | import com.hrt.system.domain.poji.member.Member; |
| | | import com.hrt.system.domain.vo.AppGoodsInfoVo; |
| | | import com.hrt.system.domain.vo.AppShopInfoVo; |
| | | import com.hrt.system.service.goods.GoodsService; |
| | | import com.hrt.system.service.member.MemberService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private GoodsService goodsService; |
| | | |
| | | @Autowired |
| | | private MemberService memberService; |
| | | |
| | | @RequestMapping(value = "/getGoodsInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商品详情") |
| | | public R<AppGoodsInfoVo> getGoodsInfo(@RequestBody AppGoodsInfoGetDto appGoodsInfoGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if(userId!=null){ |
| | | Member member = memberService.getById(userId); |
| | | if(member!=null&&member.getRealtionShopId()!=null){ |
| | | appGoodsInfoGetDto.setShopId(member.getRealtionShopId()); |
| | | } |
| | | } |
| | | AppGoodsInfoVo appGoodsInfoVo = goodsService.getGoodsInfo(appGoodsInfoGetDto); |
| | | return R.ok(appGoodsInfoVo); |
| | | } |