Skip to content

Commit

Permalink
[CHORE] 스웨거 이사
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Mar 12, 2024
1 parent 8618e8e commit 12af42e
Show file tree
Hide file tree
Showing 17 changed files with 138 additions and 26 deletions.
65 changes: 65 additions & 0 deletions smeem-api/src/main/java/com/smeem/api/diary/api/DiaryApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.smeem.api.diary.api;

import com.smeem.api.common.BaseResponse;
import com.smeem.api.diary.api.dto.request.DiaryCreateRequest;
import com.smeem.api.diary.api.dto.request.DiaryModifyRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.security.Principal;

public interface DiaryApi {

@Operation(
summary = "일기 생성",
responses = {
@ApiResponse(responseCode = "201", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> createDiary(Principal principal, @RequestBody DiaryCreateRequest request);

@Operation(
summary = "일기 상세 조회",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> getDiaryDetail(@PathVariable long diaryId);

@Operation(
summary = "일기 수정",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> modifyDiary(@PathVariable long diaryId, @RequestBody DiaryModifyRequest request);

@Operation(
summary = "일기 삭제",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> deleteDiary(@PathVariable long diaryId);

@Operation(
summary = "기간 내 일기 목록 조회",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> getDiaries(
Principal principal,
@RequestParam String start,
@RequestParam String end
);
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.smeem.api.diary.controller;
package com.smeem.api.diary.api;

import java.security.Principal;

import com.smeem.api.common.ApiResponseUtil;
import com.smeem.api.common.BaseResponse;
import com.smeem.api.diary.controller.dto.request.DiaryCreateRequest;
import com.smeem.api.diary.controller.dto.request.DiaryModifyRequest;
import com.smeem.api.diary.controller.dto.response.DiaryCreateResponse;
import com.smeem.api.diary.controller.dto.response.DiaryGetResponse;
import com.smeem.api.diary.controller.dto.response.DiaryListGetResponse;
import com.smeem.api.diary.api.dto.request.DiaryCreateRequest;
import com.smeem.api.diary.api.dto.request.DiaryModifyRequest;
import com.smeem.api.diary.api.dto.response.DiaryCreateResponse;
import com.smeem.api.diary.api.dto.response.DiaryGetResponse;
import com.smeem.api.diary.api.dto.response.DiaryListGetResponse;
import com.smeem.api.diary.service.DiaryQueryService;
import com.smeem.api.diary.service.DiaryCommandService;
import com.smeem.api.diary.service.dto.request.*;
Expand All @@ -33,7 +33,7 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v2/diaries")
public class DiaryController {
public class DiaryApiController implements DiaryApi {

private final DiaryCommandService diaryCommandService;
private final DiaryQueryService diaryQueryService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.diary.controller.dto.request;
package com.smeem.api.diary.api.dto.request;

import lombok.NonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.diary.controller.dto.request;
package com.smeem.api.diary.api.dto.request;

import lombok.NonNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.diary.controller.dto.response;
package com.smeem.api.diary.api.dto.response;

import com.smeem.api.badge.controller.dto.response.AcquiredBadgeResponse;
import com.smeem.api.diary.service.dto.response.DiaryCreateServiceResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.diary.controller.dto.response;
package com.smeem.api.diary.api.dto.response;

import com.smeem.api.diary.service.dto.response.DiaryGetServiceResponse;
import com.smeem.common.util.Util;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.diary.controller.dto.response;
package com.smeem.api.diary.api.dto.response;

import com.smeem.api.diary.service.dto.response.DiaryListGetServiceResponse;
import com.smeem.api.diary.service.dto.response.DiaryListGetServiceResponse.DiaryServiceResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.smeem.api.diary.service.dto.request;

import com.smeem.api.diary.controller.dto.request.DiaryCreateRequest;
import com.smeem.api.diary.api.dto.request.DiaryCreateRequest;
import lombok.Builder;

import static lombok.AccessLevel.PRIVATE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.smeem.api.diary.service.dto.request;

import com.smeem.api.diary.controller.dto.request.DiaryModifyRequest;
import com.smeem.api.diary.api.dto.request.DiaryModifyRequest;
import lombok.Builder;

import static lombok.AccessLevel.PRIVATE;
Expand Down
29 changes: 29 additions & 0 deletions smeem-api/src/main/java/com/smeem/api/goal/api/GoalApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.smeem.api.goal.api;

import com.smeem.api.common.BaseResponse;
import com.smeem.domain.goal.model.GoalType;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;

public interface GoalApi {

@Operation(
summary = "목표 전체 목록 조회",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> getAllGoals();

@Operation(
summary = "목표 상세 조회",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> getGoalByType(@PathVariable GoalType type);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.smeem.api.goal.controller;
package com.smeem.api.goal.api;

import com.smeem.api.common.ApiResponseUtil;
import com.smeem.api.common.BaseResponse;

import com.smeem.api.goal.controller.dto.response.GoalGetResponse;
import com.smeem.api.goal.controller.dto.response.GoalListGetResponse;
import com.smeem.api.goal.api.dto.response.GoalGetResponse;
import com.smeem.api.goal.api.dto.response.GoalListGetResponse;
import com.smeem.api.goal.service.dto.request.GoalGetServiceRequest;
import com.smeem.api.goal.service.GoalService;
import com.smeem.domain.goal.model.GoalType;
Expand All @@ -23,7 +23,7 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v2/goals")
public class GoalController {
public class GoalApiController implements GoalApi {

private final GoalService goalService;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.goal.controller.dto.response;
package com.smeem.api.goal.api.dto.response;

import com.smeem.api.goal.service.dto.response.GoalGetServiceResponse;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.goal.controller.dto.response;
package com.smeem.api.goal.api.dto.response;

import com.smeem.api.goal.service.dto.response.GoalListGetServiceResponse;
import com.smeem.api.goal.service.dto.response.GoalListGetServiceResponse.GoalServiceResponse;
Expand Down
18 changes: 18 additions & 0 deletions smeem-api/src/main/java/com/smeem/api/topic/api/TopicApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.smeem.api.topic.api;

import com.smeem.api.common.BaseResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.http.ResponseEntity;

public interface TopicApi {

@Operation(
summary = "랜덤 주제 조회",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
ResponseEntity<BaseResponse<?>> getTopicByRandom();
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.smeem.api.topic.controller;
package com.smeem.api.topic.api;

import com.smeem.api.common.ApiResponseUtil;
import com.smeem.api.common.BaseResponse;
import com.smeem.api.topic.controller.dto.response.RandomTopicGetResponse;
import com.smeem.api.topic.api.dto.response.RandomTopicGetResponse;
import com.smeem.api.topic.service.TopicService;
import lombok.val;
import org.springframework.http.ResponseEntity;
Expand All @@ -17,7 +17,7 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v2/topics")
public class TopicController {
public class TopicApiController implements TopicApi {

private final TopicService topicService;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.smeem.api.topic.controller.dto.response;
package com.smeem.api.topic.api.dto.response;

import com.smeem.api.topic.service.dto.response.RandomTopicGetServiceResponse;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//import com.smeem.api.common.ApiResponseUtil;
//import com.smeem.api.common.BaseResponse;
//import com.smeem.api.diary.controller.DiaryController;
//import com.smeem.api.diary.controller.dto.request.DiaryCreateRequest;
//import com.smeem.api.diary.controller.dto.request.DiaryModifyRequest;
//import com.smeem.api.diary.api.dto.request.DiaryCreateRequest;
//import com.smeem.api.diary.api.dto.request.DiaryModifyRequest;
//import com.smeem.api.diary.service.dto.response.DiaryCreateServiceResponse;
//import com.smeem.api.diary.service.dto.response.DiaryListGetServiceResponse;
//import com.smeem.api.diary.service.dto.response.DiaryGetServiceResponse;
Expand Down

0 comments on commit 12af42e

Please sign in to comment.