| | |
| | | package com.ruoyi.shop.controller.console; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.security.annotation.InnerAuth; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopRelUser; |
| | | import com.ruoyi.shop.service.shop.ShopRelUserService; |
| | | import com.ruoyi.shop.service.shop.ShopService; |
| | | import com.ruoyi.system.api.domain.poji.activity.ActivityGoods; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.domain.vo.ShopRelUserVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | |
| | | @Resource |
| | | private ShopService shopService; |
| | | |
| | | @Resource |
| | | private ShopRelUserService shopRelUserService; |
| | | |
| | | |
| | | @PostMapping("/getShop") |
| | | public R<Shop> getShop(@RequestBody Long shopId) |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getShopByUserId") |
| | | public R<ShopRelUserVo> getShopByUserId(Long userId) |
| | | { |
| | | ShopRelUser shopRelUser = shopRelUserService.getByUserId(userId); |
| | | Optional.ofNullable(shopRelUser).orElseThrow(() -> new ServiceException("未查询到商户信息")); |
| | | ShopRelUserVo shopRelUserVo = new ShopRelUserVo(); |
| | | shopRelUserVo.setShopId(shopRelUser.getShopId()); |
| | | shopRelUserVo.setUserName(shopRelUser.getUserName()); |
| | | return R.ok(shopRelUserVo); |
| | | } |
| | | |
| | | |
| | | } |