- create board
This commit is contained in:
kimyonghwa
2019-09-17 17:34:13 +09:00
parent a51dce74ad
commit 4173fc1225
3 changed files with 18 additions and 1 deletions

View File

@@ -28,6 +28,15 @@ public class BoardController {
private final BoardService boardService;
private final ResponseService responseService;
@ApiImplicitParams({
@ApiImplicitParam(name = "X-AUTH-TOKEN", value = "로그인 성공 후 access_token", required = true, dataType = "String", paramType = "header")
})
@ApiOperation(value = "게시판 생성", notes = "신규 게시판을 생성한다.")
@PostMapping(value = "/{boardName}")
public SingleResult<Board> createBoard(@PathVariable String boardName) {
return responseService.getSingleResult(boardService.insertBoard(boardName));
}
@ApiOperation(value = "게시판 정보 조회", notes = "게시판 정보를 조회한다.")
@GetMapping(value = "/{boardName}")
public SingleResult<Board> boardInfo(@PathVariable String boardName) {
@@ -44,7 +53,7 @@ public class BoardController {
@ApiImplicitParam(name = "X-AUTH-TOKEN", value = "로그인 성공 후 access_token", required = true, dataType = "String", paramType = "header")
})
@ApiOperation(value = "게시글 작성", notes = "게시글을 작성한다.")
@PostMapping(value = "/{boardName}")
@PostMapping(value = "/{boardName}/post")
public SingleResult<Post> post(@PathVariable String boardName, @Valid @ModelAttribute ParamsPost post) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String uid = authentication.getName();