-
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.
Merge pull request #4 from Modagbul/backend_main
로그인, 소모임 승인, 반려
- Loading branch information
Showing
112 changed files
with
3,433 additions
and
16 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 |
---|---|---|
@@ -1,4 +1,11 @@ | ||
FROM openjdk:17-jdk | ||
ARG JAR_FILE=./build/libs/dashboardback-0.0.1-SNAPSHOT.jar | ||
ARG JAR_FILE=./backend/build/libs/backend-0.0.1-SNAPSHOT.jar | ||
COPY ${JAR_FILE} app.jar | ||
ENTRYPOINT ["java","-jar","/app.jar"] | ||
|
||
# 문서를 이미지의 /static/docs 디렉토리에 복사 | ||
COPY ./backend/build/docs/asciidoc/*.html /static/docs/ | ||
|
||
# 애플리케이션 실행 시 -cp 옵션을 사용하여 /static/docs 디렉토리를 클래스패스에 추가 | ||
ENTRYPOINT ["java","-cp",".:/static/docs","-jar","/app.jar"] | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[[Admin-API]] | ||
= Admin API | ||
|
||
[[Admin-로그인]] | ||
== Admin 로그인 | ||
operation::admin-controller-test/sign_in[snippets='http-request,request-fields,http-response,response-fields'] |
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,61 @@ | ||
[[Overview-Response]] | ||
== ErrorCode | ||
|
||
|
||
=== Error Response DTO | ||
|=== | ||
| isSuccess(Boolean) | timeStamp(LocalDateTime) | errorCode(String) | message(String) | ||
|=== | ||
|
||
=== Common ErrorCode | ||
|=== | ||
| ErrorCode | Scope | Description | ||
|
||
| `400` | ||
| 전체 | ||
| 요청 형식 자체가 틀리거나 권한이 없음 | ||
|
||
| `403` | ||
| 전체 | ||
| 접근 권한이 존재하지 않음 (로그인 안한 경우) | ||
|
||
| `405` | ||
| 전체 | ||
| HTTP 메서드가 리소스에서 허용되지 않음 | ||
|
||
| `500` | ||
| 전체 | ||
| 서버오류 | ||
|
||
| `J0001` | ||
| 전체 | ||
| 예상치 못한 오류 | ||
|
||
| `J0002` | ||
| 전체 | ||
| 잘못된 JWT 서명 | ||
|
||
|`J0003` | ||
| 전체 | ||
| 만료된 토큰 | ||
|
||
| `J0004` | ||
| 전체 | ||
| 지원되지 않는 토큰 | ||
|
||
| `J0005` | ||
| 전체 | ||
| 접근이 거부됨 | ||
|
||
| `J0006` | ||
| 전체 | ||
| 토큰이 잘못됨 | ||
|
||
| `J0007` | ||
| 전체 | ||
| 추가 정보 입력 (닉네임) 안함 | ||
|
||
| `J0008` | ||
| 재발급 시 | ||
| 유효하지 않은 refresh Token | ||
|=== |
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,37 @@ | ||
[[Team-API]] | ||
= Team API | ||
|
||
[[Team-새로운-소모임-조회]] | ||
== Team 새로운 소모임 조회 | ||
operation::team-controller-test/get_team[snippets='http-request,query-parameters,http-response,response-fields'] | ||
|
||
== Team Category | ||
|=== | ||
| Category | Description | ||
|
||
| `SPORTS` | ||
| 스포츠/운동 | ||
|
||
| `HABIT` | ||
| 생활습관 개선 | ||
|
||
| `TEST` | ||
| 시험/취업준비 | ||
|
||
| `STUDY` | ||
| 스터디/공부 | ||
|
||
| `READING` | ||
| 독서 | ||
|
||
| `ETC` | ||
| 그외 자기계발 | ||
|=== | ||
|
||
[[Team-소모임-승인하기]] | ||
== Team 소모임 승인하기 | ||
operation::team-controller-test/approve_team[snippets='http-request,query-parameters,http-response,response-fields'] | ||
|
||
[[Team-소모임-반려하기]] | ||
== Team 소모임 반려하기 | ||
operation::team-controller-test/reject_team[snippets='http-request,query-parameters,http-response,response-fields'] |
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,14 @@ | ||
= Moing BO API Doc | ||
:doctype: book | ||
:icons: font | ||
:source-highlighter: highlightjs | ||
:toc: left | ||
:toclevels: 1 | ||
:sectlinks: | ||
|
||
include::Overview.adoc[] | ||
include::Admin-API.adoc[] | ||
include::Team-API.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
19 changes: 19 additions & 0 deletions
19
...rc/main/java/com/moing/bo/backend/domain/admin/application/dto/request/SignInRequest.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,19 @@ | ||
package com.moing.bo.backend.domain.admin.application.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
public class SignInRequest { | ||
@NotBlank(message="id 을 입력해주세요.") | ||
private String id; | ||
|
||
@NotBlank(message = "password 을 입력해주세요.") | ||
private String password; | ||
} |
19 changes: 19 additions & 0 deletions
19
...rc/main/java/com/moing/bo/backend/domain/admin/application/dto/request/SignUpRequest.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,19 @@ | ||
package com.moing.bo.backend.domain.admin.application.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
public class SignUpRequest { | ||
@NotBlank(message="id 을 입력해주세요.") | ||
private String id; | ||
|
||
@NotBlank(message = "password 을 입력해주세요.") | ||
private String password; | ||
} |
11 changes: 11 additions & 0 deletions
11
...main/java/com/moing/bo/backend/domain/admin/application/dto/response/CheckIdResponse.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,11 @@ | ||
package com.moing.bo.backend.domain.admin.application.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
public record CheckIdResponse( | ||
Boolean isDuplicated | ||
) { | ||
} |
15 changes: 15 additions & 0 deletions
15
.../main/java/com/moing/bo/backend/domain/admin/application/dto/response/SignInResponse.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,15 @@ | ||
package com.moing.bo.backend.domain.admin.application.dto.response; | ||
|
||
import com.moing.bo.backend.global.response.TokenInfoResponse; | ||
|
||
public record SignInResponse( | ||
String accessToken, | ||
String refreshToken | ||
) { | ||
public static SignInResponse from(TokenInfoResponse tokenInfoResponse) { | ||
return new SignInResponse( | ||
tokenInfoResponse.getAccessToken(), | ||
tokenInfoResponse.getRefreshToken() | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
backend/src/main/java/com/moing/bo/backend/domain/admin/application/mapper/AdminMapper.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,22 @@ | ||
package com.moing.bo.backend.domain.admin.application.mapper; | ||
|
||
import com.moing.bo.backend.domain.admin.application.dto.request.SignUpRequest; | ||
import com.moing.bo.backend.domain.admin.domain.constant.Role; | ||
import com.moing.bo.backend.domain.admin.domain.entity.Admin; | ||
import com.moing.bo.backend.domain.team.domain.constant.ApprovalStatus; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class AdminMapper { | ||
|
||
public Admin toAdmin(SignUpRequest signUpRequest) { | ||
return Admin.builder() | ||
.loginId(signUpRequest.getId()) | ||
.password(signUpRequest.getPassword()) | ||
.role(Role.ADMIN) | ||
.approvedStatus(ApprovalStatus.NO_CONFIRMATION) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.