Skip to content

Commit

Permalink
docs: Swagger 설명 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
kimday0326 committed Jun 16, 2024
1 parent c1e7671 commit 2834133
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.khu.gitbox.auth.presentation.dto.AuthResponse;
import com.khu.gitbox.auth.presentation.dto.LoginRequest;
import com.khu.gitbox.common.response.ApiResponse;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
Expand All @@ -19,6 +20,7 @@ public class AuthController {

private final AuthService authService;

@Operation(summary = "로그인")
@PostMapping("/login")
public ResponseEntity<ApiResponse<AuthResponse>> login(@Valid @RequestBody LoginRequest request) {
AuthResponse authResponse = authService.login(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.khu.gitbox.domain.file.presentation.dto.request.FolderCreateRequest;
import com.khu.gitbox.domain.file.presentation.dto.request.FolderUpdateRequest;
import com.khu.gitbox.domain.file.presentation.dto.response.FolderDetailGetResponse;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
Expand All @@ -16,6 +17,7 @@ public class FolderController {

private final FolderService folderService;

@Operation(summary = "폴더 생성")
@PostMapping
public ApiResponse<Long> createFolder(
@PathVariable Long workspaceId,
Expand All @@ -24,6 +26,7 @@ public ApiResponse<Long> createFolder(
return ApiResponse.ok(folderId);
}

@Operation(summary = "폴더 상세 조회")
@GetMapping("/{folderId}")
public ApiResponse<FolderDetailGetResponse> getFolder(
@PathVariable Long workspaceId,
Expand All @@ -32,6 +35,7 @@ public ApiResponse<FolderDetailGetResponse> getFolder(
return ApiResponse.ok(folder);
}

@Operation(summary = "폴더 수정")
@PatchMapping("/{folderId}")
public ApiResponse<FolderDetailGetResponse> updateFolder(
@PathVariable Long workspaceId,
Expand All @@ -41,6 +45,7 @@ public ApiResponse<FolderDetailGetResponse> updateFolder(
return ApiResponse.ok(folder);
}

@Operation(summary = "폴더 삭제")
@DeleteMapping("/{folderId}")
public ApiResponse<Void> deleteFolder(
@PathVariable Long workspaceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.khu.gitbox.domain.member.presentation.dto.MemberDto;
import com.khu.gitbox.domain.member.presentation.dto.SignUpRequest;
import com.khu.gitbox.util.SecurityContextUtil;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
Expand All @@ -16,26 +17,30 @@ public class MemberController {

private final MemberService memberService;

@Operation(summary = "회원가입")
@PostMapping("/register")
public ApiResponse<Long> signUp(@Valid @RequestBody SignUpRequest request) {
Long id = memberService.signUp(request);
return ApiResponse.created(id);
}

@Operation(summary = "내 정보 조회")
@GetMapping(value = {"/my/info"})
public ApiResponse<MemberDto> myInfo() {
Long currentMemberId = SecurityContextUtil.getCurrentMemberId();
MemberDto memberDto = memberService.getMemberDetail(currentMemberId);
return ApiResponse.ok(memberDto);
}

@Operation(summary = "내 정보 수정")
@PatchMapping("/my/info")
public ApiResponse<Long> editMember(@RequestBody MemberDto memberDto) {
final Long currentMemberId = SecurityContextUtil.getCurrentMemberId();
Long responseId = memberService.editMember(memberDto, currentMemberId);
return ApiResponse.ok(responseId);
}

@Operation(summary = "회원 탈퇴")
@DeleteMapping("/my/info")
public ApiResponse<Void> deleteMember() {
final Long currentMemberId = SecurityContextUtil.getCurrentMemberId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ApiResponse<List<TrashFileResponse>> showTrashFiles(
}

@DeleteMapping("/{fileId}")
@Operation(summary = "파일 삭제하기")
@Operation(summary = "휴지통 파일 삭제하기")
public ApiResponse<Void> deleteFile(
@PathVariable("fileId") Long fileId,
@PathVariable("workspaceId") Long workspaceId) {
Expand All @@ -32,7 +32,7 @@ public ApiResponse<Void> deleteFile(
}

@PostMapping("/{fileId}")
@Operation(summary = "파일 복구하기")
@Operation(summary = "휴지통 파일 복구하기")
public ApiResponse<Void> restoreFile(
@PathVariable("fileId") Long fileId,
@PathVariable("workspaceId") Long workspaceId) {
Expand Down

0 comments on commit 2834133

Please sign in to comment.