Commit dc9fe7b5 authored by renjie's avatar renjie

更新查询店铺接口

parent a0e18ae7
......@@ -107,9 +107,6 @@ public class AccountServiceImpl implements AccountService {
@Autowired
private UserAuthService userAuthService;
@Autowired
private UserRepository userRepository;
@Autowired
private ShopService shopService;
......
......@@ -232,7 +232,7 @@ public class ShopController {
public ResultDto queryShop(Principal principal, @RequestBody ShopRequestDto shopRequestDto) {
ResultDto resultDto = new ResultDto();
try {
ShopDto shopDto = shopService.queryShop(principal.getName(), shopRequestDto.getShopId());
ShopResultDto shopDto = shopService.queryShop(principal.getName(), shopRequestDto.getShopId());
resultDto.setData(shopDto);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
......
......@@ -302,7 +302,7 @@ public class ShopServiceImpl implements ShopService {
}
@Override
public ShopDto queryShop(String username, String shopId) {
public ShopResultDto queryShop(String username, String shopId) {
Account account = accountRepository.findByName(username);
if (account == null) {
throw new ClientRequestException(AccountErrorCode.NAMENOTEXIST);
......@@ -318,7 +318,9 @@ public class ShopServiceImpl implements ShopService {
IpResource ipResource = ipResourceRepository.findByShopIdAndIsDeleted(shopId, false);
if (ipResource == null)
throw new ClientRequestException(BrowserErrorCode.IPNOTEXIST);
return new ShopDto(shop);
String group = userShopRepository.findByUsernameAndShopId(username, shop.getShopId()).getGroupId();
ShopResultDto shopResultDto = ShopResultDto.of(shop, group, ipResource);
return shopResultDto;
}
@Override
......
......@@ -22,7 +22,7 @@ public interface ShopService {
void assignShops(String username, List<String> shopIds, List<String> users);
ShopDto queryShop(String username, String shopId);
ShopResultDto queryShop(String username, String shopId);
ShopPageResultDto getShopList(String username, String groupId, int page, int amount, ShopFilterDto shopFilterDto);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment