랜드 소유권 변경 예외 처리 추가
This commit is contained in:
@@ -441,6 +441,7 @@ public class LandService {
|
||||
public LandResponse postLandOwnerChanges(LandRequest landRequest){
|
||||
String guid = landRequest.getUserGuid();
|
||||
String nickname = dynamodbUserService.getGuidByName(guid);
|
||||
int landId = landRequest.getLandId();
|
||||
if(nickname.isEmpty() || !nickname.equals(landRequest.getUserName())){
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
@@ -448,7 +449,7 @@ public class LandService {
|
||||
.build();
|
||||
}
|
||||
|
||||
int chk = landMapper.getPossibleLandOwnerChanges(landRequest.getLandId());
|
||||
int chk = landMapper.getPossibleLandOwnerChanges(landId);
|
||||
if(chk > 0){
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
@@ -456,6 +457,14 @@ public class LandService {
|
||||
.build();
|
||||
}
|
||||
|
||||
LandAttrib landInfo = dynamodbLandService.getLandInfo(landId);
|
||||
if(!landInfo.getOwnerUserGuid().isEmpty()){
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_LAND_OWNER_DUPLICATION.toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
landRequest.setCreateBy(CommonUtils.getAdmin().getId());
|
||||
boolean is_reserve = landRequest.isReserve();
|
||||
if(!is_reserve){
|
||||
|
||||
Reference in New Issue
Block a user