Commit dc9fe7b5 authored by renjie's avatar renjie

更新查询店铺接口

parent a0e18ae7
...@@ -107,9 +107,6 @@ public class AccountServiceImpl implements AccountService { ...@@ -107,9 +107,6 @@ public class AccountServiceImpl implements AccountService {
@Autowired @Autowired
private UserAuthService userAuthService; private UserAuthService userAuthService;
@Autowired
private UserRepository userRepository;
@Autowired @Autowired
private ShopService shopService; private ShopService shopService;
......
...@@ -232,7 +232,7 @@ public class ShopController { ...@@ -232,7 +232,7 @@ public class ShopController {
public ResultDto queryShop(Principal principal, @RequestBody ShopRequestDto shopRequestDto) { public ResultDto queryShop(Principal principal, @RequestBody ShopRequestDto shopRequestDto) {
ResultDto resultDto = new ResultDto(); ResultDto resultDto = new ResultDto();
try { try {
ShopDto shopDto = shopService.queryShop(principal.getName(), shopRequestDto.getShopId()); ShopResultDto shopDto = shopService.queryShop(principal.getName(), shopRequestDto.getShopId());
resultDto.setData(shopDto); resultDto.setData(shopDto);
resultDto.setStatus(0); resultDto.setStatus(0);
}catch (ClientRequestException e) { }catch (ClientRequestException e) {
......
...@@ -302,7 +302,7 @@ public class ShopServiceImpl implements ShopService { ...@@ -302,7 +302,7 @@ public class ShopServiceImpl implements ShopService {
} }
@Override @Override
public ShopDto queryShop(String username, String shopId) { public ShopResultDto queryShop(String username, String shopId) {
Account account = accountRepository.findByName(username); Account account = accountRepository.findByName(username);
if (account == null) { if (account == null) {
throw new ClientRequestException(AccountErrorCode.NAMENOTEXIST); throw new ClientRequestException(AccountErrorCode.NAMENOTEXIST);
...@@ -318,7 +318,9 @@ public class ShopServiceImpl implements ShopService { ...@@ -318,7 +318,9 @@ public class ShopServiceImpl implements ShopService {
IpResource ipResource = ipResourceRepository.findByShopIdAndIsDeleted(shopId, false); IpResource ipResource = ipResourceRepository.findByShopIdAndIsDeleted(shopId, false);
if (ipResource == null) if (ipResource == null)
throw new ClientRequestException(BrowserErrorCode.IPNOTEXIST); 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 @Override
......
...@@ -22,7 +22,7 @@ public interface ShopService { ...@@ -22,7 +22,7 @@ public interface ShopService {
void assignShops(String username, List<String> shopIds, List<String> users); 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); 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