Skip to content

Commit

Permalink
[refactor] 패키지 구조 세분화
Browse files Browse the repository at this point in the history
  • Loading branch information
syyling committed May 25, 2024
1 parent cf85a6c commit 14554d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 117 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mookive.mookive_backend.movie.infra;
package com.mookive.mookive_backend.movie.infra.component;


import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mookive.mookive_backend.movie.infra;
package com.mookive.mookive_backend.movie.infra.config;

import com.mookive.mookive_backend.movie.infra.component.KoficComponent;
import com.mookive.mookive_backend.movie.infra.component.TmdbComponent;
import com.mookive.mookive_backend.movie.infra.component.TmdbSearchComponent;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -36,4 +39,17 @@ public TmdbComponent tmdbService() {
return factory.createClient(TmdbComponent.class);

}

@Bean
public TmdbSearchComponent tmdbSearchService() {
RestClient restClient = RestClient.builder()
.baseUrl("https://api.themoviedb.org/3/search/movie")
.defaultHeader("Authorization", token)
.defaultHeader("accept", "application/json")
.build();
RestClientAdapter adapter = RestClientAdapter.create(restClient);
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(adapter).build();
return factory.createClient(TmdbSearchComponent.class);

}
}

0 comments on commit 14554d9

Please sign in to comment.