Commit b8163943 authored by jim's avatar jim

log

parent 16abe225
......@@ -42,7 +42,7 @@ public class ShopController {
shopStringResultDto.setId(shopService.addShop(principal.getName(), shopResultDto));
resultDto.setData(shopStringResultDto);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -56,7 +56,7 @@ public class ShopController {
public ResultDto addShops(Principal principal, @RequestParam("file") MultipartFile file) {
ResultDto resultDto = new ResultDto();
String name = file.getOriginalFilename();
if(name.length()<6 || !name.substring(name.length()-5).equals(".xlsx")){
if (name.length() < 6 || !name.substring(name.length() - 5).equals(".xlsx")) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", BrowserErrorCode.INFORMATIONNOTCOMPELETE.getCode());
......@@ -87,7 +87,7 @@ public class ShopController {
shopStringResultDto.setId(shopService.updateShop(principal.getName(), shopResultDto));
resultDto.setData(shopStringResultDto);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -103,7 +103,7 @@ public class ShopController {
try {
shopService.deleteShop(principal.getName(), shopRequestDto.getShopId());
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -119,7 +119,8 @@ public class ShopController {
try {
ipAndShopService.bindShop(principal.getName(), shopRequestDto);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
logger.error("fail to bind shop", e);
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -135,7 +136,7 @@ public class ShopController {
try {
ipAndShopService.unBindShop(principal.getName(), shopRequestDto);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -151,7 +152,7 @@ public class ShopController {
try {
shopService.transferShop(principal.getName(), shopRequestDto.getShopId(), shopRequestDto.getToGroup());
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -167,7 +168,7 @@ public class ShopController {
try {
shopService.assignShops(principal.getName(), shopRequestDto.getShopIds(), shopRequestDto.getToUsers());
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -177,7 +178,7 @@ public class ShopController {
return resultDto;
}
@RequestMapping(value = "/list",method = RequestMethod.POST)
@RequestMapping(value = "/list", method = RequestMethod.POST)
public ResultDto getShopList(Principal principal, @RequestBody ShopRequestDto shopRequestDto) {
ResultDto resultDto = new ResultDto();
try {
......@@ -185,7 +186,7 @@ public class ShopController {
shopRequestDto.getAmount(), shopRequestDto.getFilter());
resultDto.setData(shopDtos);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -203,7 +204,7 @@ public class ShopController {
List<String> subUsers = shopService.getShopUsers(principal.getName(), shopRequestDto.getShopId());
resultDto.setData(subUsers);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -220,7 +221,7 @@ public class ShopController {
List<String> subUsers = shopService.getBatchShopUsers(principal.getName(), shopRequestDto.getShopIds());
resultDto.setData(subUsers);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -237,7 +238,7 @@ public class ShopController {
ShopResultDto shopDto = shopService.queryShop(principal.getName(), shopRequestDto.getShopId());
resultDto.setData(shopDto);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......
......@@ -72,7 +72,7 @@ public class IpAndShopServiceImpl implements IpAndShopService {
try {
ipResourceRepository.addShopId(ipResource.getId(), shopId);
} catch (Exception e) {
logger.error("fail to bind shop and ip", e.getMessage());
logger.error("fail to bind shop and ip", e);
throw new ClientRequestException(BrowserErrorCode.UNKNOWN);
}
}
......
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