-
Notifications
You must be signed in to change notification settings - Fork 1
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 #97 from UMC-TripPiece/refactor/92
[refactor] 여행기, 지도 검색 관련 api 코드 리팩토링 및 중복 코드 개선, 커스텀 어노테이션 생성
- Loading branch information
Showing
25 changed files
with
327 additions
and
218 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package umc.TripPiece.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.TripPiece.apiPayload.code.status.ErrorStatus; | ||
import umc.TripPiece.domain.TripPiece; | ||
import umc.TripPiece.repository.CityRepository; | ||
import umc.TripPiece.repository.MapRepository; | ||
import umc.TripPiece.repository.TravelRepository; | ||
import umc.TripPiece.repository.UserRepository; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@Configuration | ||
public class ValidatorConfig { | ||
@Bean | ||
public Map<Class<?>, JpaRepository<?, Long>> repositoryMap( | ||
UserRepository userRepository, | ||
CityRepository cityRepository, | ||
MapRepository mapRepository, | ||
TravelRepository travelRepository | ||
) { | ||
Map<Class<?>, JpaRepository<?, Long>> map = new HashMap<>(); | ||
map.put(umc.TripPiece.domain.User.class, userRepository); | ||
map.put(umc.TripPiece.domain.City.class, cityRepository); | ||
map.put(umc.TripPiece.domain.Map.class, mapRepository); | ||
map.put(umc.TripPiece.domain.Travel.class, travelRepository); | ||
return map; | ||
} | ||
|
||
@Bean | ||
public Map<Class<?>, ErrorStatus> errorStatusMap() { | ||
Map<Class<?>, ErrorStatus> map = new HashMap<>(); | ||
map.put(umc.TripPiece.domain.User.class, ErrorStatus.NOT_FOUND_USER); | ||
map.put(umc.TripPiece.domain.City.class, ErrorStatus.NOT_FOUND_CITY); | ||
map.put(umc.TripPiece.domain.Map.class, ErrorStatus.NOT_FOUND_MAP); | ||
map.put(umc.TripPiece.domain.Travel.class, ErrorStatus.NOT_FOUND_TRAVEL); | ||
return map; | ||
} | ||
} |
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 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
Oops, something went wrong.