Skip to content

Commit

Permalink
Merge pull request #128 from Team-Tiki/feat/#121-teams
Browse files Browse the repository at this point in the history
[FEAT] 팀 삭제 및 스웨거 설정 수정
  • Loading branch information
Chan531 authored Jul 24, 2024
2 parents 5e8edf0 + 4736710 commit 063bbb4
Show file tree
Hide file tree
Showing 21 changed files with 464 additions and 351 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ out/
.vscode/

application-secret.yml
application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,75 +5,71 @@
import com.tiki.server.auth.dto.response.ReissueGetResponse;
import com.tiki.server.common.dto.ErrorResponse;
import com.tiki.server.common.dto.SuccessResponse;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;

public interface AuthControllerDocs {

@Operation(
summary = "로그인",
description = "로그인을 진행한다.",
responses = {
@ApiResponse(
responseCode = "200",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "400",
description = "일치하지 않은 비밀번호",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "404",
description = "유효하지 않은 회원",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<SuccessResponse<SignInGetResponse>> login(
HttpServletResponse httpServletResponse,
@RequestBody LoginRequest request);
@Operation(
summary = "로그인",
description = "로그인을 진행한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "400",
description = "일치하지 않은 비밀번호",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "404",
description = "유효하지 않은 회원",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<SuccessResponse<SignInGetResponse>> login(
HttpServletResponse httpServletResponse,
@RequestBody LoginRequest request);

@Operation(
summary = "엑세스 토큰 재발급",
description = "엑세스 토큰 재발급 메서드입니다.",
responses = {
@ApiResponse(
responseCode = "201",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "401",
description = "유효하지 않은 키",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "401",
description = "인증되지 않은 사용자",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "404",
description = "유효하지 않은 회원",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<SuccessResponse<ReissueGetResponse>> reissue(HttpServletRequest request);
@Operation(
summary = "엑세스 토큰 재발급",
description = "엑세스 토큰 재발급 메서드입니다.",
responses = {
@ApiResponse(responseCode = "201", description = "성공"),
@ApiResponse(
responseCode = "401",
description = "유효하지 않은 키",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "401",
description = "인증되지 않은 사용자",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "404",
description = "유효하지 않은 회원",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<SuccessResponse<ReissueGetResponse>> reissue(HttpServletRequest request);

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ public void delete(Document document) {
public void deleteAllById(List<DocumentVO> documents) {
documents.forEach(documentVO -> documentRepository.deleteById(documentVO.documentId()));
}

public void deleteAll(List<Document> documents) {
documentRepository.deleteAll(documents);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ public List<DocumentVO> findAllByTimeBlockId(long timeBlockId) {
public List<Document> findAllByTeamIdAndAccessiblePosition(long teamId, Position accessiblePosition) {
return documentRepository.findAllByTeamIdAndAccessiblePosition(teamId, accessiblePosition);
}

public List<Document> findAllByTeamId(long teamId) {
return documentRepository.findAllByTeamId(teamId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ public interface DocumentControllerDocs {
summary = "전체 문서 조회",
description = "전체 문서를 조회한다.",
responses = {
@ApiResponse(
responseCode = "200",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "403",
description = "접근 권한 없음",
Expand Down Expand Up @@ -67,10 +64,7 @@ ResponseEntity<SuccessResponse<DocumentsGetResponse>> getAllDocuments(
summary = "문서 삭제",
description = "문서를 삭제한다.",
responses = {
@ApiResponse(
responseCode = "204",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "204", description = "성공"),
@ApiResponse(
responseCode = "403",
description = "접근 권한 없음",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public interface DocumentRepository extends JpaRepository<Document, Long> {
+ "where t.team.id = :teamId and t.accessiblePosition = :position order by d.createdAt asc")
List<Document> findAllByTeamIdAndAccessiblePosition(long teamId, Position position);

@Query("select d from Document d join d.timeBlock t where t.team.id = :teamId")
List<Document> findAllByTeamId(long teamId);

@Query("select d from Document d join fetch d.timeBlock where d.id = :documentId")
Document findByIdWithTimeBlock(long documentId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ public interface S3ControllerDocs {
summary = "Presigned Url 생성",
description = "s3로부터 Presigned Url을 생성한다.",
responses = {
@ApiResponse(
responseCode = "200",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
Expand All @@ -51,10 +48,7 @@ ResponseEntity<SuccessResponse<PreSignedUrlResponse>> getPreSignedUrl(
summary = "s3 파일 삭제",
description = "s3의 파일 삭제한다.",
responses = {
@ApiResponse(
responseCode = "200",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,99 +5,92 @@
import com.tiki.server.common.dto.SuccessResponse;
import com.tiki.server.mail.dto.request.CodeCheck;
import com.tiki.server.mail.dto.request.MailRequest;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;

@Tag(name = "mail", description = "메일 인증 API")
public interface MailControllerDocs {

@Operation(
summary = "회원가입 메일 전송",
description = "회원 가입을 진행한다.",
responses = {
@ApiResponse(
responseCode = "201",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "400",
description = "이메일 형식 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "409",
description = "이미 가입된 아이디",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<BaseResponse> sendSignUpMail(@RequestBody MailRequest mailRequest);
@Operation(
summary = "회원가입 메일 전송",
description = "회원 가입을 진행한다.",
responses = {
@ApiResponse(responseCode = "201", description = "성공"),
@ApiResponse(
responseCode = "400",
description = "이메일 형식 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "409",
description = "이미 가입된 아이디",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<BaseResponse> sendSignUpMail(@RequestBody MailRequest mailRequest);

@Operation(
summary = "비밀번호 재설정 메일 전송",
description = "비밀번호 재설정을 위한 이메일을 보낸다.",
responses = {
@ApiResponse(
responseCode = "201",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "400",
description = "이메일 형식 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "404",
description = "가입되지 않은 이메일",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<BaseResponse> sendChangingPasswordMail(@RequestBody MailRequest mailRequest);
@Operation(
summary = "비밀번호 재설정 메일 전송",
description = "비밀번호 재설정을 위한 이메일을 보낸다.",
responses = {
@ApiResponse(responseCode = "201", description = "성공"),
@ApiResponse(
responseCode = "400",
description = "이메일 형식 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "404",
description = "가입되지 않은 이메일",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<BaseResponse> sendChangingPasswordMail(@RequestBody MailRequest mailRequest);

@Operation(
summary = "메일 인증",
description = "인증번호 확인",
responses = {
@ApiResponse(
responseCode = "201",
description = "성공",
content = @Content(schema = @Schema(implementation = SuccessResponse.class))),
@ApiResponse(
responseCode = "400",
description = "이메일 형식 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "403",
description = "인증 값 불일치",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "404",
description = "인증 정보가 존재하지 않음",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<BaseResponse> checkCode(@RequestBody CodeCheck codeCheck);
@Operation(
summary = "메일 인증",
description = "인증번호 확인",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "400",
description = "이메일 형식 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "403",
description = "인증 값 불일치",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "404",
description = "인증 정보가 존재하지 않음",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
)
ResponseEntity<BaseResponse> checkCode(@RequestBody CodeCheck codeCheck);
}
Loading

0 comments on commit 063bbb4

Please sign in to comment.