-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from CodingWasabi/refactoring/api
🌪️[REF]-#22-변수명 및 API 변경 관련 리팩토링
- Loading branch information
Showing
11 changed files
with
63 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/com/codingwasabi/trti/domain/city/model/Location.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.codingwasabi.trti.domain.city.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum Location { | ||
SEOUL("서울특별시", "37.75768", "128.87375"), | ||
BUSAN("부산광역시", "33.34889", "126.28097"), | ||
JEJU("제주시", "33.43144", "126.87424"), | ||
GWANGJU("광주광역시", "36.34831", "127.39059"), | ||
DAEGU("대구광역시", "35.00525", "127.64877"), | ||
ULSAN("울산광역시", "35.59360", "129.35200"), | ||
DAEJEON("대전광역시", "35.19401", "128.10196"), | ||
INCHEON("인천광역시", "37.43779", "126.97586"); | ||
|
||
private String name; | ||
private String latitude; | ||
private String longitude; | ||
|
||
public static Location parseName(String korName) { | ||
for (Location location : Location.values()) { | ||
if (location.toString().equals(korName)) { | ||
return location; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("[ERROR] 잘못된 도시 이름이 입력되었습니다."); | ||
} | ||
|
||
public String toString() { | ||
return name; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/codingwasabi/trti/domain/city/repository/CityRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.codingwasabi.trti.domain.city.repository; | ||
|
||
import com.codingwasabi.trti.domain.city.model.Location; | ||
import com.codingwasabi.trti.domain.city.model.City; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface CityRepository extends JpaRepository<City, Long> { | ||
Optional<City> findByCity(Location city2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
src/main/java/com/codingwasabi/trti/domain/location/model/City.java
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/java/com/codingwasabi/trti/domain/location/repository/LocationRepository.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters