Skip to content

Commit

Permalink
fix: adminDong -> legalDong 변수명 변경 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
gahyuun committed Jan 22, 2025
1 parent 5e1a4c4 commit 92bc377
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ public void createGuidedSpot(final Long spotId, final Long memberId) {
}

public String createMemberArea(final Double latitude, final Double longitude, final Long memberId) {
String adminDong = naverMapsAdapter.getReverseGeoCodingResult(latitude, longitude);
String legalDong = naverMapsAdapter.getReverseGeoCodingResult(latitude, longitude);

verifiedAreaRepository.save(
VerifiedAreaEntity.builder()
.name(adminDong)
.name(legalDong)
.memberId(memberId)
.verifiedDate(Collections.singletonList(LocalDate.now()))
.build()
);

return adminDong;
return legalDong;
}

// TODO: 최근 길 안내 장소 지우는 스케줄러 추가
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void createReview(final long spotId, final int acornCount) {
Member member = memberMapper.toDomain(memberEntity);
Spot spot = spotMapper.toDomain(spotEntity);

boolean isLocal = isVerifiedArea(member.getId(), spot.getAdminDong());
boolean isLocal = isVerifiedArea(member.getId(), spot.getLegalDong());

member.useAcorn(acornCount);
spot.addAcorn(acornCount, isLocal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class SpotService {
// 메서드 설명: 위치 정보가 없는 Spot들의 위치 정보를 업데이트한다.
@Transactional
public void updateNullCoordinatesForSpots() {
List<SpotEntity> spotEntityList = spotRepository.findAllByLatitudeIsNullOrLongitudeIsNullOrGeomIsNullOrAdminDongIsNull();
List<SpotEntity> spotEntityList = spotRepository.findAllByLatitudeIsNullOrLongitudeIsNullOrGeomIsNullOrLegalDongIsNull();

if (spotEntityList.isEmpty()) {
log.info("위치 정보가 비어 있는 Spot 데이터가 없습니다.");
Expand Down Expand Up @@ -104,7 +104,7 @@ private void updateSpotCoordinate(final Spot spot) {
Double.parseDouble(geoCodingResponse.longitude())
);
spot.updateGeom();
spot.updateAdminDong(
spot.updateLegalDong(
naverMapsAdapter.getReverseGeoCodingResult(spot.getLatitude(), spot.getLongitude())
);
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/acon/server/spot/domain/entity/Spot.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Spot {
private Double latitude;
private Double longitude;
private Point geom;
private String adminDong;
private String legalDong;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;

Expand All @@ -44,7 +44,7 @@ public Spot(
Double latitude,
Double longitude,
Point geom,
String adminDong,
String legalDong,
LocalDateTime createdAt,
LocalDateTime updatedAt
) {
Expand All @@ -59,7 +59,7 @@ public Spot(
this.latitude = latitude;
this.longitude = longitude;
this.geom = geom;
this.adminDong = adminDong;
this.legalDong = legalDong;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
Expand Down Expand Up @@ -100,9 +100,9 @@ public void updateGeom() {
}
}

public void updateAdminDong(String adminDong) {
public void updateLegalDong(String legalDong) {
if (latitude != null && longitude != null) {
this.adminDong = adminDong;
this.legalDong = legalDong;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public class SpotEntity extends BaseTimeEntity {
@Column(name = "geom", columnDefinition = "geometry(Point, 4326)")
private Point geom;

@Column(name = "admin_dong")
private String adminDong;
@Column(name = "legal_dong")
private String legalDong;

@Builder
public SpotEntity(
Expand All @@ -78,7 +78,7 @@ public SpotEntity(
Double latitude,
Double longitude,
Point geom,
String adminDong
String legalDong
) {
this.id = id;
this.name = name;
Expand All @@ -92,6 +92,6 @@ public SpotEntity(
this.latitude = latitude;
this.longitude = longitude;
this.geom = geom;
this.adminDong = adminDong;
this.legalDong = legalDong;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface SpotRepository extends JpaRepository<SpotEntity, Long> {

List<SpotEntity> findTop10ByNameContainsIgnoreCase(String keyword);

List<SpotEntity> findAllByLatitudeIsNullOrLongitudeIsNullOrGeomIsNullOrAdminDongIsNull();
List<SpotEntity> findAllByLatitudeIsNullOrLongitudeIsNullOrGeomIsNullOrLegalDongIsNull();

default SpotEntity findByIdOrElseThrow(Long id) {
return findById(id).orElseThrow(
Expand Down

0 comments on commit 92bc377

Please sign in to comment.