@@ -28,6 +28,15 @@ public class BoardController {
28
28
private final BoardService boardService ;
29
29
private final ResponseService responseService ;
30
30
31
+ @ ApiImplicitParams ({
32
+ @ ApiImplicitParam (name = "X-AUTH-TOKEN" , value = "로그인 성공 후 access_token" , required = true , dataType = "String" , paramType = "header" )
33
+ })
34
+ @ ApiOperation (value = "게시판 생성" , notes = "신규 게시판을 생성한다." )
35
+ @ PostMapping (value = "/{boardName}" )
36
+ public SingleResult <Board > createBoard (@ PathVariable String boardName ) {
37
+ return responseService .getSingleResult (boardService .insertBoard (boardName ));
38
+ }
39
+
31
40
@ ApiOperation (value = "게시판 정보 조회" , notes = "게시판 정보를 조회한다." )
32
41
@ GetMapping (value = "/{boardName}" )
33
42
public SingleResult <Board > boardInfo (@ PathVariable String boardName ) {
@@ -44,7 +53,7 @@ public ListResult<Post> posts(@PathVariable String boardName) {
44
53
@ ApiImplicitParam (name = "X-AUTH-TOKEN" , value = "로그인 성공 후 access_token" , required = true , dataType = "String" , paramType = "header" )
45
54
})
46
55
@ ApiOperation (value = "게시글 작성" , notes = "게시글을 작성한다." )
47
- @ PostMapping (value = "/{boardName}" )
56
+ @ PostMapping (value = "/{boardName}/post " )
48
57
public SingleResult <Post > post (@ PathVariable String boardName , @ Valid @ ModelAttribute ParamsPost post ) {
49
58
Authentication authentication = SecurityContextHolder .getContext ().getAuthentication ();
50
59
String uid = authentication .getName ();
0 commit comments