Skip to content

Commit

Permalink
[DEV-10] 지난 PR 피드백 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
wonjunYou committed Jul 25, 2024
1 parent 25d30c1 commit 39e94c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ddingdong.ddingdongBE.domain.activityreport.api;

import ddingdong.ddingdongBE.auth.PrincipalDetails;
import ddingdong.ddingdongBE.domain.activityreport.controller.dto.request.CreateActivityTermInfoRequest;
import ddingdong.ddingdongBE.domain.activityreport.controller.dto.response.ActivityReportTermInfoResponse;
import ddingdong.ddingdongBE.domain.activityreport.controller.dto.response.AllActivityReportResponse;
Expand All @@ -9,7 +8,6 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
Expand All @@ -29,16 +27,12 @@ public interface AdminActivityReportApi {
@GetMapping("/term")
@ResponseStatus(HttpStatus.OK)
@SecurityRequirement(name = "AccessToken")
List<ActivityReportTermInfoResponse> getActivityTermInfos(
@AuthenticationPrincipal PrincipalDetails principalDetails);
List<ActivityReportTermInfoResponse> getActivityTermInfos();

@Operation(summary = "활동 보고서 회차별 기간 설정 API")
@PostMapping("/term")
@ResponseStatus(HttpStatus.CREATED)
@SecurityRequirement(name = "AccessToken")
void createActivityTermInfo(
@AuthenticationPrincipal PrincipalDetails principalDetails,
@RequestBody CreateActivityTermInfoRequest request
);
void createActivityTermInfo(@RequestBody CreateActivityTermInfoRequest request);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ddingdong.ddingdongBE.domain.activityreport.controller;

import ddingdong.ddingdongBE.auth.PrincipalDetails;
import ddingdong.ddingdongBE.domain.activityreport.api.AdminActivityReportApi;
import ddingdong.ddingdongBE.domain.activityreport.controller.dto.request.CreateActivityTermInfoRequest;
import ddingdong.ddingdongBE.domain.activityreport.controller.dto.response.ActivityReportTermInfoResponse;
Expand All @@ -9,7 +8,6 @@
import ddingdong.ddingdongBE.domain.activityreport.service.ActivityReportTermInfoService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -26,16 +24,12 @@ public List<AllActivityReportResponse> getActivityReports() {
}

@Override
public List<ActivityReportTermInfoResponse> getActivityTermInfos(
@AuthenticationPrincipal PrincipalDetails principalDetails) {
public List<ActivityReportTermInfoResponse> getActivityTermInfos() {
return activityReportTermInfoService.getAll();
}

@Override
public void createActivityTermInfo(
@AuthenticationPrincipal PrincipalDetails principalDetails,
CreateActivityTermInfoRequest request
) {
public void createActivityTermInfo(CreateActivityTermInfoRequest request) {
activityReportTermInfoService.create(request.startDate(), request.totalTermCount());
}

Expand Down

0 comments on commit 39e94c7

Please sign in to comment.