1
1
package wooteco .prolog .article .ui ;
2
2
3
3
import lombok .RequiredArgsConstructor ;
4
+ import org .springframework .beans .factory .annotation .Value ;
4
5
import org .springframework .http .ResponseEntity ;
5
6
import org .springframework .web .bind .annotation .DeleteMapping ;
6
7
import org .springframework .web .bind .annotation .GetMapping ;
29
30
public class ArticleController {
30
31
31
32
private final ArticleService articleService ;
33
+ @ Value ("${slack.article.token}" )
34
+ private String slackToken ;
35
+
36
+ @ Value ("${slack.article.channel}" )
37
+ private String slackChannel ;
32
38
33
39
@ PostMapping
34
40
public ResponseEntity <Void > createArticles (@ RequestBody final ArticleRequest articleRequest ,
@@ -70,8 +76,8 @@ public ResponseEntity<Void> likeArticle(@PathVariable final Long id,
70
76
71
77
@ GetMapping
72
78
public ResponseEntity <List <ArticleResponse >> getFilteredArticles (@ AuthMemberPrincipal final LoginMember member ,
73
- @ RequestParam ("course" ) final ArticleFilterType course ,
74
- @ RequestParam ("onlyBookmarked" ) boolean onlyBookmarked ) {
79
+ @ RequestParam ("course" ) final ArticleFilterType course ,
80
+ @ RequestParam ("onlyBookmarked" ) boolean onlyBookmarked ) {
75
81
final List <ArticleResponse > articleResponses = articleService .getFilteredArticles (member , course , onlyBookmarked );
76
82
77
83
return ResponseEntity .ok (articleResponses );
@@ -89,4 +95,9 @@ public ResponseEntity<List<ArticleResponse>> fetchArticles(@RequestParam(require
89
95
List <ArticleResponse > articleResponses = articleService .fetchArticlesOf (username );
90
96
return ResponseEntity .ok ().body (articleResponses );
91
97
}
98
+
99
+ @ GetMapping ("/test" )
100
+ public ResponseEntity <String > test () {
101
+ return ResponseEntity .ok ().body ("result: " + slackChannel + " : " +slackToken );
102
+ }
92
103
}
0 commit comments