https://github.com/mottoslo/h99-Spring-Assignments/tree/main/assignment2/Spring_assignment_Lv2

 

GitHub - mottoslo/h99-Spring-Assignments: Spring week01-03 Assignments

Spring week01-03 Assignments. Contribute to mottoslo/h99-Spring-Assignments development by creating an account on GitHub.

github.com

 

 

https://imslo.tistory.com/62 의 업그레이드 버전

 

Spring Boot 간단한 게시판 만들어보기 // POSTMAN

POSTMAN은 View 없이도 API 동작을 실험해볼 수 있는 도구. JPA, h2(데이터베이스), Lombok 사용 디렉터리 생성 Controller // Repository // Service 디렉터리 만들어주기 + DB의 테이블 역할을 할 entity, + 클라이언

imslo.tistory.com

추가 기능 :

-회원가입

-로그인

-JWT인증

//회원가입페이지 요청// - 미구현
GET "api/user/register/"
==================================================================
// 회원 가입 요청//
POST "/user/register/"

Request : "userid" : "userid",
"username" : "name",
"password" : "Password",
"email" : "askdjf@naver.com"

Response : "가입 성공하였습니다" (임시)
==================================================================
//로그인페이지 요청// - 미구현
GET "user/login"

==================================================================
//로그인 요청//
POST "user/login"

Request : "userid" : "userid",
"password" : "password"

Response : Header => Authorization : Bearer <JWT>
redirect:/api/article
==================================================================
//전체 게시물 조회//

GET "api/article"

Request : -

Response : "createdAt" : "timestamp",
"modifiedAt" : "timestamp",
"id" : Long,
"title" : "title",
"content" : "content",
"author" : "author"
== List<ResponseDTO>

==================================================================
//게시물 등록 //

POST "api/article"

Request : Header => Authorization : Bearer <JWT>
Body =>
"title" : "title",
"content" : "content"

Response :
{ResponseDTO}

===================================================================
//특정 게시물 조회(by id)

GET "api/article/{id}"

Request : -

Response : {ResponseDTO}

===================================================================
// 게시물 수정 (by id)//

PUT "api/article/{id}"

Request : Header => Authorization : Bearer <JWT>
Body =>
"title" : "title",
"content" : "content",

Response : {ResponseDTO}

===================================================================
// 게시물 삭제 (by id)//
DELETE "api/article/{id}"

Request : Header => Authorization : Bearer <JWT>

Response : "success" : true

===================================================================





 
 

추가공부할것 : HttpServlet // JPA 엔티티 연관관계

'공부 > Spring' 카테고리의 다른 글

Spring Security  (0) 2023.04.25
ExceptionHandler // ResponseEntity // HTTP 상태 반환  (0) 2023.04.23
Auth // JWT  (0) 2023.04.19
Spring Boot 간단한 게시판 만들어보기 // POSTMAN  (0) 2023.04.18
Spring MVC 패턴 이해하기  (0) 2023.04.16

+ Recent posts