Commit a309c49f authored by shiyu's avatar shiyu

checkIsMine,userId为空时返回false

parent a90373c5
......@@ -232,7 +232,7 @@ public class SelfPageServiceImpl implements SelfPageService {
Long itemUserId;
if (dto.getTargetUserId() != null) {
itemUserId = dto.getTargetUserId();
if (itemUserId.longValue() != dto.getUserId()) {
if (dto.getUserId() == null || itemUserId.longValue() != dto.getUserId()) {
map.put("isMine", false);
} else {
map.put("isMine", true);
......@@ -240,7 +240,7 @@ public class SelfPageServiceImpl implements SelfPageService {
} else {
CollectionShareRecord collectionShareRecord = collectionShareRecordDao.findById(dto.getShareRecordId());
itemUserId = collectionShareRecord.getItemUserId();
if (itemUserId.longValue() != dto.getUserId()) {
if (dto.getUserId() != null || itemUserId.longValue() != dto.getUserId()) {
map.put("isMine", false);
} else {
map.put("isMine", true);
......
......@@ -91,12 +91,6 @@ public class SelfPageController {
@PostMapping("/checkIsMine")
public Result checkIsMine(@RequestBody SelfPageRequestDto dto) {
logger.info("分销商查询自己购买的订单信息,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("userId", "用户id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return selfPageService.checkIsMine(dto);
}
......
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