-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/spring rest docs hellomatia
- Loading branch information
Showing
10 changed files
with
633 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
= M-LOG API 문서 | ||
:doctype: book | ||
:icons: font | ||
:source-highlighter: highlightjs | ||
:toc: left | ||
:toclevels: 3 | ||
|
||
== 회원 | ||
|
||
=== 로그인 | ||
**Request** | ||
include::{snippets}/user/login/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/user/login/http-response.adoc[] | ||
|
||
=== 회원 가입 | ||
|
||
**Request** | ||
include::{snippets}/user/join/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/user/join/http-response.adoc[] | ||
|
||
=== 회원 수정 | ||
|
||
**Request** | ||
include::{snippets}/user/modify/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/user/modify/http-response.adoc[] | ||
|
||
=== 회원 삭제 | ||
|
||
**Request** | ||
include::{snippets}/user/delete/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/user/delete/http-response.adoc[] | ||
|
||
=== 회원 정보 조회 | ||
|
||
==== 1. JWT 토큰 기반 | ||
**Request** | ||
include::{snippets}/user/me/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/user/me/http-response.adoc[] | ||
|
||
--- | ||
|
||
==== 2. ID 기반 | ||
**Request** | ||
include::{snippets}/user/find/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/user/find/http-response.adoc[] | ||
|
||
== 여행 | ||
|
||
=== 여행 정보 저장 (JWT 기반) | ||
|
||
**Request** | ||
include::{snippets}/travel/save/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/travel/save/http-response.adoc[] | ||
|
||
=== 여행 정보 리스트 조회 (JWT 기반) | ||
|
||
**Request** | ||
include::{snippets}/travel/list/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/travel/list/http-response.adoc[] | ||
|
||
=== 여행 상세 정보 조회 | ||
|
||
**Request** | ||
include::{snippets}/travel/detail/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/travel/detail/http-response.adoc[] | ||
|
||
=== 여행 상세 사진 조회 | ||
|
||
**Request** | ||
include::{snippets}/travel/photos/http-request.adoc[] | ||
|
||
**Response** | ||
include::{snippets}/travel/photos/http-response.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/java/com/mlog/security/WithMockJwtAuthentication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.mlog.security; | ||
|
||
import org.springframework.security.test.context.support.WithSecurityContext; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@WithSecurityContext(factory = WithMockJwtAuthenticationSecurityContextFactory.class) | ||
public @interface WithMockJwtAuthentication { | ||
|
||
long id() default 1L; | ||
|
||
String name() default "tester"; | ||
|
||
String role() default "ROLE_USER"; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/java/com/mlog/security/WithMockJwtAuthenticationSecurityContextFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.mlog.security; | ||
|
||
import org.springframework.security.core.context.SecurityContext; | ||
import org.springframework.security.core.context.SecurityContextHolder; | ||
import org.springframework.security.test.context.support.WithSecurityContextFactory; | ||
|
||
import static org.springframework.security.core.authority.AuthorityUtils.createAuthorityList; | ||
|
||
public class WithMockJwtAuthenticationSecurityContextFactory implements WithSecurityContextFactory<WithMockJwtAuthentication> { | ||
|
||
@Override | ||
public SecurityContext createSecurityContext(WithMockJwtAuthentication annotation) { | ||
SecurityContext context = SecurityContextHolder.createEmptyContext(); | ||
JwtAuthenticationToken authentication = | ||
new JwtAuthenticationToken( | ||
new JwtAuthentication(annotation.id(), annotation.name()), | ||
null, | ||
createAuthorityList(annotation.role()) | ||
); | ||
context.setAuthentication(authentication); | ||
return context; | ||
} | ||
} |
Oops, something went wrong.