Skip to content

Commit

Permalink
#9 [Update] WebClient 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
JSoi committed Aug 1, 2022
1 parent da10a85 commit 6cbb970
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.mpnp.baechelin.api.service.LocationService;
import com.mpnp.baechelin.api.dto.LocationInfoDto;
import com.mpnp.baechelin.api.dto.LocationPartDto;
import com.mpnp.baechelin.api.service.LocationServiceRT;
import com.mpnp.baechelin.api.service.LocationServiceWC;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -18,7 +20,7 @@
@Slf4j
@ApiOperation(value = "카카오톡 API를 통해 정보를 얻는 컨트롤러")
public class LocationController {
private final LocationService locationService;
private final LocationServiceRT locationService;

@ApiOperation(value = "위도, 경도를 주소로 바꾸는 함수")
@GetMapping("/convert/geo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@

@Service
@Slf4j
@RequiredArgsConstructor
public class PublicApiService {
private final StoreRepository storeRepository;
private final LocationService locationService;
private final StoreImageService storeImageService;

public PublicApiService(StoreRepository storeRepository, LocationServiceRT locationService, StoreImageService storeImageService) {
this.storeRepository = storeRepository;
this.locationService = locationService;
this.storeImageService = storeImageService;
}

@Value("${public.api.v1.key}")
private String publicV1Key;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@

@Service
@Slf4j
@RequiredArgsConstructor
/**
* 공공 API V2 서비스 - V1과의 분리를 위해
*/
public class PublicApiServiceV2 {
private final StoreRepository storeRepository;
private final LocationService locationService;
private final StoreImageService storeImageService;

public PublicApiServiceV2(StoreRepository storeRepository, LocationServiceRT locationService, StoreImageService storeImageService) {
this.storeRepository = storeRepository;
this.locationService = locationService;
this.storeImageService = storeImageService;
}

@Value("${public.api.v2.key}")
private String publicV2Key;
@Value("${public.api.v2.key2}")
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/mpnp/baechelin/config/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

@Configuration
public class AppConfig {
@Bean
public LocationService locationService(){
return new LocationServiceRT();
// @Bean
// public LocationService locationService(){
// return new LocationServiceRT();
// return new LocationServiceWC(new HttpConfig());
}
// }

}

0 comments on commit 6cbb970

Please sign in to comment.