jar 파일 다운로드
Download jmapper-core JAR 1.6.0 ➔ With all dependencies!
com.googlecode.jmapper-framework jmapper-core 1.6.0 compile group: 'com.googlecode.jmapper-framework', name: 'jmapper-core', version: '1.6.0' //Thanks for using https://jar-download.com libraryDependencies += "com.googlecode.jmapper-framework" % "jmapper-c
jar-download.com
auth-jwt-0.0.1-SNAPSHOT.jar
drive.google.com
내 컴퓨터에서 새로운 폴더 생성 후 해당 경로에 다운로드 받은 jar 파일을 이동
다운 받은 파일 경로로 이동후 터미널로 또는 Git bash 로 자바 파일 실행하기
** java 명령어로 실행하기 위해서는 환경변수 설정이 되어 있어야 합니다. **
아래 명령어를 실행해 주세요
java -jar auth-jwt-0.0.1-SHAPSHOT.jar
: 스프링 가상 서버가 실행 됩니다.
터미널을 끄면 가상 서버가 종료 되기 때문에 실행 시킨 상태에서 작업을 진행해야 합니다.
오픈되어 있는 url로 웹브라우저에 주소를 요청합니다.
브라우저에서 해당 URL 을 입력해주세요
- user 데이터 (GET)
{
"code": 1,
"msg": "목록보기완료",
"data": [
{
"id": 2,
"username": "cos",
"password": "1234",
"email": "cos@nate.com",
"created": "2021-07-10T07:56:50.198496",
"updated": "2021-07-10T07:56:50.198496"
},
{
"id": 1,
"username": "ssar",
"password": "1234",
"email": "ssar@nate.com",
"created": "2021-07-10T07:56:50.18751",
"updated": "2021-07-10T07:56:50.18751"
}
]
}
- post 데이터 (GET)
요청 주소 (POST)
- http://localhost:8080/login
요청 파라미터
- application/json
{
"username":"devnote1",
"password":"1234"
}
응답 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "success",
"data": {
"id": 3,
"username": "getinthere",
"password": "1234",
"email": "getinthere@nate.com",
"created": [
2021,
7,
10,
7,
45,
15,
764705000
],
"updated": [
2021,
7,
10,
7,
45,
15,
764705000
]
}
}
postman을 설치하는 이유는 웹브라우저에서는 Get 요청만 해볼 수 있기 때문이다.
GET, POST, DELETE, PUT 4가지 요청을 다 해보기 위해서 설치 및 실행 합니다.
API 문서
1. 공통코드
code : 1 통신 정상
code : -1 통신 실패
2. 회원가입
요청 주소 (POST)
- http://localhost:8080/join
요청 파라미터
- application/json
{
"username":"devnote1",
"password":"1234",
"email":"devnote1@nate.com"
}
응답 바디
- application/json
{
"code": 1,
"msg": "회원가입완료",
"data": {
"id": 3,
"username": "getinthere",
"password": null,
"email": "getinthere@nate.com",
"created": "2021-07-10T07:45:15.764705",
"updated": "2021-07-10T07:45:15.764705"
}
}
3. 로그인
요청 주소 (POST)
- http://localhost:8080/login
요청 파라미터
- application/json
{
"username":"devnote1",
"password":"1234"
}
응답 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "success",
"data": {
"id": 3,
"username": "getinthere",
"password": "1234",
"email": "getinthere@nate.com",
"created": [
2021,
7,
10,
7,
45,
15,
764705000
],
"updated": [
2021,
7,
10,
7,
45,
15,
764705000
]
}
}
4. 회원정보수정
요청 주소 (PUT)
- http://localhost:8080/user/3
요청 헤더 (응답 받은 값을 postmain 에 셋팅해야 합니다)
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
요청 파라미터
- application/json
{
"password":"5678",
"email":"devnote1@gmail.com"
}
응답 바디
- application/json
{
"code": 1,
"msg": "회원정보수정완료",
"data": {
"id": 3,
"username": "getinthere",
"password": "5678",
"email": "getinthere@gmail.com",
"created": "2021-07-10T07:45:15.764705",
"updated": "2021-07-10T07:50:13.7016973"
}
}
5. 회원정보 한건보기
요청 주소 (GET)
- http://localhost:8080/user/3
요청 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "회원정보확인완료",
"data": {
"id": 3,
"username": "devnote1",
"password": "1234",
"email": "devnote1@gmail.com",
"created": "2021-07-10T08:06:24.483245",
"updated": "2021-07-10T08:06:24.483245"
}
}
6. 게시글 목록보기
요청 주소 (GET)
- http://localhost:8080/post
요청 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "목록보기완료",
"data": [
{
"id": 5,
"title": "제목5",
"content": "내용5",
"user": {
"id": 2,
"username": "cos",
"password": "1234",
"email": "cos@nate.com",
"created": "2021-07-10T08:05:49.039117",
"updated": "2021-07-10T08:05:49.039117"
},
"created": "2021-07-10T08:05:49.069037",
"updated": "2021-07-10T08:05:49.069037"
},
{
"id": 4,
"title": "제목4",
"content": "내용4",
"user": {
"id": 2,
"username": "cos",
"password": "1234",
"email": "cos@nate.com",
"created": "2021-07-10T08:05:49.039117",
"updated": "2021-07-10T08:05:49.039117"
},
"created": "2021-07-10T08:05:49.068049",
"updated": "2021-07-10T08:05:49.068049"
},
{
"id": 3,
"title": "제목3",
"content": "내용3",
"user": {
"id": 1,
"username": "ssar",
"password": "1234",
"email": "ssar@nate.com",
"created": "2021-07-10T08:05:49.0082",
"updated": "2021-07-10T08:05:49.0082"
},
"created": "2021-07-10T08:05:49.062057",
"updated": "2021-07-10T08:05:49.062057"
},
{
"id": 2,
"title": "제목2",
"content": "내용2",
"user": {
"id": 1,
"username": "ssar",
"password": "1234",
"email": "ssar@nate.com",
"created": "2021-07-10T08:05:49.0082",
"updated": "2021-07-10T08:05:49.0082"
},
"created": "2021-07-10T08:05:49.060063",
"updated": "2021-07-10T08:05:49.060063"
},
{
"id": 1,
"title": "제목1",
"content": "내용1",
"user": {
"id": 1,
"username": "ssar",
"password": "1234",
"email": "ssar@nate.com",
"created": "2021-07-10T08:05:49.0082",
"updated": "2021-07-10T08:05:49.0082"
},
"created": "2021-07-10T08:05:49.057069",
"updated": "2021-07-10T08:05:49.057069"
}
]
}
7. 게시글 한건보기
요청 주소 (GET)
- http://localhost:8080/post/1
요청 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "상세보기완료",
"data": {
"id": 1,
"title": "제목1",
"content": "내용1",
"user": {
"id": 1,
"username": "ssar",
"password": "1234",
"email": "ssar@nate.com",
"created": "2021-07-10T08:05:49.0082",
"updated": "2021-07-10T08:05:49.0082"
},
"created": "2021-07-10T08:05:49.057069",
"updated": "2021-07-10T08:05:49.057069"
}
}
8. 게시글 쓰기
요청 주소 (POST)
- http://localhost:8080/post
요청 바디
- application/json
{
"title":"제목6",
"content":"내용6"
}
요청 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "글쓰기완료",
"data": {
"id": 6,
"title": "제목6",
"content": "내용6",
"user": {
"id": 3,
"username": "getinthere",
"password": "1234",
"email": "getinthere@nate.com",
"created": "2021-07-10T08:06:24.483245",
"updated": "2021-07-10T08:06:24.483245"
},
"created": "2021-07-10T08:11:05.5290593",
"updated": "2021-07-10T08:11:05.5290593"
}
}
9. 게시글 수정하기
요청 주소 (PUT)
- http://localhost:8080/post/6
요청 바디
- application/json
{
"title":"제목변경",
"content":"내용변경"
}
요청 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "수정하기완료",
"data": {
"id": 6,
"title": "제목변경",
"content": "내용변경",
"user": {
"id": 3,
"username": "getinthere",
"password": "1234",
"email": "getinthere@nate.com",
"created": "2021-07-10T08:06:24.483245",
"updated": "2021-07-10T08:06:24.483245"
},
"created": "2021-07-10T08:11:05.529059",
"updated": "2021-07-10T08:11:52.9494383"
}
}
10. 게시글 삭제하기
요청 주소 (DELETE)
- http://localhost:8080/post/6
요청 헤더
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJjb3PthqDtgbAiLCJpZCI6MywiZXhwIjoxNjI1ODc0Mzk1fQ.u_pUd7mwmE0KWWV_o7QDPkGg7Nyo_avYOwYwI5ZdIWluMltXfECQyYq9nVPzXGFZz89mOYLmYMazeYgfZwgVMw
응답 바디
- application/json
{
"code": 1,
"msg": "삭제하기완료",
"data": null
}
'Spring boot > Spring boot 활용 개념' 카테고리의 다른 글
스프링 JWT 적용 (0) | 2024.12.11 |
---|---|
서비스의 인증과 권한 부여 (0) | 2024.12.11 |
OAuth 2.0 이란 (Open Authorization) (0) | 2024.08.17 |
Server To Server 개념을 알아보자. (0) | 2024.08.17 |