Skip to content

Commit

Permalink
[#221] rename: DTO 이름 변경 및 import문 최신화
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonyworld committed Oct 1, 2024
1 parent 2846432 commit 8c811e2
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/beat/admin/adapter/in/api/AdminApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.beat.admin.application.dto.response.CarouselFindAllResponse;
import com.beat.admin.application.dto.response.UserFindAllResponse;
import com.beat.admin.application.dto.request.CarouselProcessRequest;
import com.beat.admin.application.dto.response.CarouselProcessAllResponse;
import com.beat.admin.application.dto.request.CarouselHandleRequest;
import com.beat.admin.application.dto.response.CarouselHandleAllResponse;
import com.beat.global.auth.annotation.CurrentMember;
import com.beat.global.common.dto.ErrorResponse;
import com.beat.global.common.dto.SuccessResponse;
Expand Down Expand Up @@ -129,8 +129,8 @@ ResponseEntity<SuccessResponse<CarouselFindAllResponse>> readAllCarouselImages(
}
)
@PutMapping("/carousels")
ResponseEntity<SuccessResponse<CarouselProcessAllResponse>> processCarouselImages(
ResponseEntity<SuccessResponse<CarouselHandleAllResponse>> processCarouselImages(
@CurrentMember Long memberId,
@RequestBody CarouselProcessRequest request
@RequestBody CarouselHandleRequest request
);
}
10 changes: 5 additions & 5 deletions src/main/java/com/beat/admin/adapter/in/api/AdminController.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.beat.admin.adapter.in.api;

import com.beat.admin.application.dto.response.CarouselFindAllResponse;
import com.beat.admin.application.dto.request.CarouselProcessRequest;
import com.beat.admin.application.dto.response.CarouselProcessAllResponse;
import com.beat.admin.application.dto.request.CarouselHandleRequest;
import com.beat.admin.application.dto.response.CarouselHandleAllResponse;
import com.beat.admin.exception.AdminSuccessCode;
import com.beat.admin.application.dto.response.UserFindAllResponse;
import com.beat.admin.facade.AdminFacade;
Expand Down Expand Up @@ -69,10 +69,10 @@ public ResponseEntity<SuccessResponse<CarouselFindAllResponse>> readAllCarouselI

@Override
@PutMapping("/carousels")
public ResponseEntity<SuccessResponse<CarouselProcessAllResponse>> processCarouselImages(
public ResponseEntity<SuccessResponse<CarouselHandleAllResponse>> processCarouselImages(
@CurrentMember Long memberId,
@RequestBody CarouselProcessRequest request) {
CarouselProcessAllResponse response = adminFacade.checkMemberAndProcessAllPromotionsSortedByCarouselNumber(memberId, request);
@RequestBody CarouselHandleRequest request) {
CarouselHandleAllResponse response = adminFacade.checkMemberAndProcessAllPromotionsSortedByCarouselNumber(memberId, request);
return ResponseEntity.status(HttpStatus.OK)
.body(SuccessResponse.of(AdminSuccessCode.UPDATE_ALL_CAROUSEL_PROMOTIONS_SUCCESS, response));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/beat/admin/application/AdminService.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.beat.admin.application;

import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionGenerateRequest;
import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionModifyRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionGenerateRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionModifyRequest;
import com.beat.admin.port.in.AdminUseCase;
import com.beat.domain.performance.domain.Performance;
import com.beat.domain.performance.port.in.PerformanceUseCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import com.beat.domain.promotion.domain.CarouselNumber;

public record CarouselProcessRequest(
public record CarouselHandleRequest(
List<PromotionHandleRequest> carousels
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.beat.admin.application.dto.request;

import static com.beat.admin.application.dto.request.CarouselProcessRequest.*;
import static com.beat.admin.application.dto.request.CarouselHandleRequest.*;

import com.beat.domain.promotion.domain.CarouselNumber;
import com.fasterxml.jackson.annotation.JsonSubTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

import com.beat.domain.promotion.domain.Promotion;

public record CarouselProcessAllResponse(
public record CarouselHandleAllResponse(
List<PromotionResponse> modifiedPromotions
) {

public static CarouselProcessAllResponse from(List<Promotion> promotions) {
public static CarouselHandleAllResponse from(List<Promotion> promotions) {
List<PromotionResponse> modifiedPromotions = promotions.stream()
.map(PromotionResponse::from)
.collect(Collectors.toList());
return new CarouselProcessAllResponse(modifiedPromotions);
return new CarouselHandleAllResponse(modifiedPromotions);
}

public record PromotionResponse(
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/com/beat/admin/facade/AdminFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import com.beat.admin.application.dto.request.PromotionHandleRequest;
import com.beat.admin.application.dto.response.CarouselFindAllResponse;
import com.beat.admin.application.dto.response.UserFindAllResponse;
import com.beat.admin.application.dto.request.CarouselProcessRequest;
import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionGenerateRequest;
import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionModifyRequest;
import com.beat.admin.application.dto.response.CarouselProcessAllResponse;
import com.beat.admin.application.dto.request.CarouselHandleRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionGenerateRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionModifyRequest;
import com.beat.admin.application.dto.response.CarouselHandleAllResponse;
import com.beat.admin.port.in.AdminUseCase;
import com.beat.domain.member.port.in.MemberUseCase;
import com.beat.domain.promotion.domain.CarouselNumber;
Expand Down Expand Up @@ -64,8 +64,8 @@ public CarouselFindAllResponse checkMemberAndFindAllPromotionsSortedByCarouselNu
return CarouselFindAllResponse.from(promotions);
}

public CarouselProcessAllResponse checkMemberAndProcessAllPromotionsSortedByCarouselNumber(Long memberId,
CarouselProcessRequest request) {
public CarouselHandleAllResponse checkMemberAndProcessAllPromotionsSortedByCarouselNumber(Long memberId,
CarouselHandleRequest request) {

memberUseCase.findMemberById(memberId);

Expand All @@ -85,10 +85,10 @@ public CarouselProcessAllResponse checkMemberAndProcessAllPromotionsSortedByCaro
List<Promotion> sortedPromotions = adminUsecase.processPromotionsAndSortByCarouselNumber(modifyRequests,
generateRequests, deleteCarouselNumbers, overlappingCarouselNumbers);

return CarouselProcessAllResponse.from(sortedPromotions);
return CarouselHandleAllResponse.from(sortedPromotions);
}

private void categorizePromotionRequests(CarouselProcessRequest request,
private void categorizePromotionRequests(CarouselHandleRequest request,
List<PromotionModifyRequest> modifyRequests, List<PromotionGenerateRequest> generateRequests,
Set<CarouselNumber> requestCarouselNumbers) {

Expand All @@ -111,15 +111,15 @@ private List<CarouselNumber> findDeleteCarouselNumbers(Set<CarouselNumber> reque
}

private List<CarouselNumber> findOverlappingCarouselNumbers(Set<CarouselNumber> requestCarouselNumbers,
List<CarouselNumber> allExistingCarouselNumbers, CarouselProcessRequest request) {
List<CarouselNumber> allExistingCarouselNumbers, CarouselHandleRequest request) {
return allExistingCarouselNumbers.stream()
.filter(requestCarouselNumbers::contains)
.filter(existingCarouselNumber -> {
Promotion existingPromotion = promotionUseCase.findPromotionByCarouselNumber(existingCarouselNumber);
return request.carousels()
.stream()
.filter(req -> req instanceof CarouselProcessRequest.PromotionModifyRequest)
.map(req -> (CarouselProcessRequest.PromotionModifyRequest)req)
.filter(req -> req instanceof CarouselHandleRequest.PromotionModifyRequest)
.map(req -> (CarouselHandleRequest.PromotionModifyRequest)req)
.noneMatch(req -> req.promotionId() != null && req.promotionId().equals(existingPromotion.getId()));
})
.toList();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/beat/admin/port/in/AdminUseCase.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.beat.admin.port.in;

import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionGenerateRequest;
import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionModifyRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionGenerateRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionModifyRequest;
import com.beat.domain.promotion.domain.CarouselNumber;
import com.beat.domain.promotion.domain.Promotion;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.beat.domain.promotion.application;

import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionModifyRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionModifyRequest;
import com.beat.domain.performance.domain.Performance;
import com.beat.domain.promotion.dao.PromotionRepository;
import com.beat.domain.promotion.domain.CarouselNumber;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.beat.domain.promotion.port.in;

import com.beat.admin.application.dto.request.CarouselProcessRequest.PromotionModifyRequest;
import com.beat.admin.application.dto.request.CarouselHandleRequest.PromotionModifyRequest;
import com.beat.domain.performance.domain.Performance;
import com.beat.domain.promotion.domain.CarouselNumber;
import com.beat.domain.promotion.domain.Promotion;
Expand Down

0 comments on commit 8c811e2

Please sign in to comment.