Commit 68cd8519 authored by lee_mingzhu's avatar lee_mingzhu

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

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