Skip to content

Commit

Permalink
Fix[#143] 스웨거 추가 적용 (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
geniusYoo authored Jul 18, 2024
2 parents 52f496c + 52aa1cb commit 8baba7f
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
34 changes: 34 additions & 0 deletions jaksim/src/main/java/org/sopt/jaksim/category/api/CategoryApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,38 @@ ResponseEntity<BaseResponse<?>> retrieve(@RequestParam @DateTimeFormat(iso = Dat
description = "서버 내부 오류입니다.")})
ResponseEntity<BaseResponse<?>> getCategoriesByUserId();

@Operation(
summary = "카테고리 삭제 API",
description = "사용자가 생성한 카테고리를 삭제하는 API입니다.",
responses = {
@ApiResponse(
responseCode = "200",
description = "요청이 성공했습니다.",
content = @Content(schema = @Schema(implementation = BaseResponse.class))),
@ApiResponse(
responseCode = "400",
description = "잘못된 요청입니다.",
content = @Content),
@ApiResponse(
responseCode = "401",
description = "액세스 토큰이 만료되었습니다. 재발급 받아주세요.",
content = @Content),
@ApiResponse(
responseCode = "401",
description = "액세스 토큰의 값이 올바르지 않습니다.",
content = @Content),
@ApiResponse(
responseCode = "404",
description = "대상을 찾을 수 없습니다",
content = @Content),
@ApiResponse(
responseCode = "405",
description = "잘못된 HTTP method 요청입니다.",
content = @Content),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류입니다.")})
public ResponseEntity<BaseResponse<?>> delete(@PathVariable("categoryId") Long categoryId);


}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public ResponseEntity<BaseResponse<?>> getCategoriesByUserId() {
}

@DeleteMapping("/categories/{categoryId}")
@Override
public ResponseEntity<BaseResponse<?>> delete(@PathVariable("categoryId") Long categoryId) {
categoryService.isExist(categoryId);
categoryTaskFacade.deleteCategoryTaskAndTasks(categoryId);
Expand Down
36 changes: 36 additions & 0 deletions jaksim/src/main/java/org/sopt/jaksim/mset/api/MsetApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import org.sopt.jaksim.category.dto.CategoryMsetLinkResponse;
import org.sopt.jaksim.global.common.BaseResponse;
import org.sopt.jaksim.mset.dto.MsetOfTask;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Tag(name = "Mset 관련 API")
@SecurityRequirement(name = "Authorization")
public interface MsetApi {
Expand Down Expand Up @@ -47,4 +50,37 @@ public interface MsetApi {
description = "서버 내부 오류입니다.")})
ResponseEntity<BaseResponse<?>> getFromOtherCategory(@PathVariable("categoryId") Long categoryId);

@Operation(
summary = "특정 태스크의 모립세트 불러오기 API",
description = "특정 태스크의 모립세트를 불러오는 API입니다.",
responses = {
@ApiResponse(
responseCode = "200",
description = "요청이 성공했습니다.",
content = @Content(schema = @Schema(implementation = MsetOfTask.class))),
@ApiResponse(
responseCode = "400",
description = "잘못된 요청입니다.",
content = @Content),
@ApiResponse(
responseCode = "401",
description = "액세스 토큰이 만료되었습니다. 재발급 받아주세요.",
content = @Content),
@ApiResponse(
responseCode = "401",
description = "액세스 토큰의 값이 올바르지 않습니다.",
content = @Content),
@ApiResponse(
responseCode = "404",
description = "대상을 찾을 수 없습니다",
content = @Content),
@ApiResponse(
responseCode = "405",
description = "잘못된 HTTP method 요청입니다.",
content = @Content),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류입니다.")})
ResponseEntity<BaseResponse<?>> getFromOtherTask(@PathVariable("taskId") Long taskId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public ResponseEntity<BaseResponse<?>> getFromOtherCategory(@PathVariable("categ
}

@GetMapping("/mset/tasks/{taskId}")
@Override
public ResponseEntity<BaseResponse<?>> getFromOtherTask(@PathVariable("taskId") Long taskId) {
List<MsetOfTask> response = categoryMsetFacade.getFromCategory(categoryTaskFacade.getCategoryIdByCategoryTask(taskId));
return ApiResponseUtil.success(SuccessMessage.SUCCESS, response);
Expand Down

0 comments on commit 8baba7f

Please sign in to comment.