Commit 68cd8519 authored by lee_mingzhu's avatar lee_mingzhu

查询不到数据时返回成功。

parent 4193c4db
...@@ -248,7 +248,7 @@ public class UserCenterController { ...@@ -248,7 +248,7 @@ public class UserCenterController {
List<Contact> contacts = JSONObject.parseObject(contactJson, new TypeReference<List<Contact>>() {}); List<Contact> contacts = JSONObject.parseObject(contactJson, new TypeReference<List<Contact>>() {});
Timestamp now = new Timestamp(System.currentTimeMillis()); Timestamp now = new Timestamp(System.currentTimeMillis());
if (CollectionUtils.isEmpty(contacts)) { if (CollectionUtils.isEmpty(contacts)) {
return JsonResult.buildErrorStateResult(null, null); return JsonResult.buildErrorStateResult("参数转换错误", null);
} }
if(null != userContact && userContact.size() > 0) { if(null != userContact && userContact.size() > 0) {
for(int i = 0; i < contacts.size(); i ++) { for(int i = 0; i < contacts.size(); i ++) {
...@@ -283,7 +283,7 @@ public class UserCenterController { ...@@ -283,7 +283,7 @@ public class UserCenterController {
Long districtCode, String district) { Long districtCode, String district) {
LOGGER.info("保存用户地址信息, phoneNo:{}, province:{}, provinceCode:{}, city:{}, cityCode:{}", phoneNo, province, provinceCode, city, cityCode); LOGGER.info("保存用户地址信息, phoneNo:{}, province:{}, provinceCode:{}, city:{}, cityCode:{}", phoneNo, province, provinceCode, city, cityCode);
if (StringUtils.isEmpty(phoneNo) || provinceCode == null || cityCode == null) { if (StringUtils.isEmpty(phoneNo) || provinceCode == null || cityCode == null) {
return JsonResult.buildErrorStateResult(null, null); return JsonResult.buildErrorStateResult("参数错误", null);
} }
Long userId = queryUserId(phoneNo); Long userId = queryUserId(phoneNo);
if(null == userId || userId == 0L) { if(null == userId || userId == 0L) {
...@@ -328,9 +328,6 @@ public class UserCenterController { ...@@ -328,9 +328,6 @@ public class UserCenterController {
return JsonResult.buildErrorStateResult("该用户不存在", null); return JsonResult.buildErrorStateResult("该用户不存在", null);
} }
Address address = addressService.findByUserId(userId); Address address = addressService.findByUserId(userId);
if (address == null) {
return JsonResult.buildErrorStateResult(null, null);
}
return JsonResult.buildSuccessResult(null, address); return JsonResult.buildSuccessResult(null, address);
} }
...@@ -350,9 +347,6 @@ public class UserCenterController { ...@@ -350,9 +347,6 @@ public class UserCenterController {
return JsonResult.buildErrorStateResult("该用户不存在", null); return JsonResult.buildErrorStateResult("该用户不存在", null);
} }
List<Contact> contacts = contactService.findByUserId(userId); List<Contact> contacts = contactService.findByUserId(userId);
if(null == contacts || contacts.size() == 0) {
return JsonResult.buildErrorStateResult(null, Collections.emptyList());
}
return JsonResult.buildSuccessResult(null, contacts); return JsonResult.buildSuccessResult(null, contacts);
} }
......
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