Skip to content

Commit

Permalink
[refac] reaname response dto
Browse files Browse the repository at this point in the history
  • Loading branch information
kgy1008 committed Jul 16, 2024
1 parent 245c8ad commit 759192e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ private static boolean isLiked(final Long id, final Heart heart) {
public void validateDuplicatedStore(final StoreValidationCommand command) {
storeFinder.findByLatitudeAndLongitude(command.latitude(), command.longitude())
.ifPresent(store -> findUniversityStore(command.universityId(), store));

}

private void findUniversityStore(final Long universityId, final Store store) {
if (universityStoreFinder.findByUniversityIdAndStore(universityId, store)) {
throw new ConflictException(StoreErrorCode.STORE_ALREADY_REGISTERED, new StoreDuplicateValidationResponse(store.getId()));
throw new ConflictException(StoreErrorCode.STORE_ALREADY_REGISTERED, new StoreDuplicateErrorResponse(store.getId()));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hankki.hankkiserver.api.store.service.response;

public record StoreDuplicateValidationResponse(
public record StoreDuplicateErrorResponse(
Long storeId
) {
}

0 comments on commit 759192e

Please sign in to comment.