File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
src/main/java/com/startingblock Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ dependencies {
28
28
implementation ' org.springframework.boot:spring-boot-starter-oauth2-client'
29
29
implementation ' org.springframework.boot:spring-boot-starter-web'
30
30
31
+ implementation ' com.fasterxml.jackson.core:jackson-databind'
32
+ implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
33
+
31
34
// mail
32
35
implementation ' org.springframework.boot:spring-boot-starter-mail'
33
36
implementation ' org.springframework.boot:spring-boot-starter-thymeleaf'
Original file line number Diff line number Diff line change @@ -14,13 +14,17 @@ public class RecommendAnnouncementRes {
14
14
15
15
private Long announcementId ;
16
16
private String department ;
17
+ private String detailUrl ;
18
+ private String keyword ;
17
19
private String title ;
18
20
19
21
public static List <RecommendAnnouncementRes > toDto (final List <Announcement > announcements ) {
20
22
return announcements .stream ()
21
23
.map (announcement -> RecommendAnnouncementRes .builder ()
22
24
.announcementId (announcement .getId ())
23
25
.department (announcement .getBizPrchDprtNm ())
26
+ .detailUrl (announcement .getDetailUrl ())
27
+ .keyword (announcement .getKeyword ().getKeyword ())
24
28
.title (announcement .getTitle ())
25
29
.build ())
26
30
.toList ();
Original file line number Diff line number Diff line change 1
1
package com .startingblock .global .config ;
2
2
3
+ import com .fasterxml .jackson .databind .ObjectMapper ;
3
4
import feign .Logger ;
4
5
import feign .codec .Encoder ;
5
6
import feign .form .FormEncoder ;
6
7
import lombok .Data ;
7
8
import lombok .Getter ;
9
+ import org .springframework .boot .autoconfigure .http .HttpMessageConverters ;
8
10
import org .springframework .boot .context .properties .ConfigurationProperties ;
9
11
import org .springframework .cloud .openfeign .EnableFeignClients ;
12
+ import org .springframework .cloud .openfeign .support .SpringEncoder ;
10
13
import org .springframework .context .annotation .Bean ;
11
14
import org .springframework .context .annotation .Configuration ;
15
+ import org .springframework .context .annotation .Primary ;
16
+ import org .springframework .http .converter .json .MappingJackson2HttpMessageConverter ;
12
17
13
18
14
19
@ Configuration
@@ -24,6 +29,12 @@ Logger.Level feignLoggerLevel() {
24
29
return Logger .Level .FULL ;
25
30
}
26
31
32
+ @ Bean
33
+ @ Primary
34
+ public Encoder feignEncoder (ObjectMapper objectMapper ) {
35
+ return new SpringEncoder (() -> new HttpMessageConverters (new MappingJackson2HttpMessageConverter (objectMapper )));
36
+ }
37
+
27
38
@ Bean
28
39
public Encoder feignFormEncoder () {
29
40
return new FormEncoder ();
You can’t perform that action at this time.
0 commit comments