diff --git a/backend/src/main/java/com/petshop/backend/dto/store/StoreRequest.java b/backend/src/main/java/com/petshop/backend/dto/store/StoreRequest.java index d6b5fc12..5bb68613 100644 --- a/backend/src/main/java/com/petshop/backend/dto/store/StoreRequest.java +++ b/backend/src/main/java/com/petshop/backend/dto/store/StoreRequest.java @@ -18,6 +18,8 @@ public class StoreRequest { @Email(message = "Email must be valid") private String email; + private String imageUrl; + public String getStoreName() { return storeName; } @@ -50,6 +52,14 @@ public class StoreRequest { this.email = email; } + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -58,12 +68,13 @@ public class StoreRequest { return Objects.equals(storeName, that.storeName) && Objects.equals(address, that.address) && Objects.equals(phone, that.phone) && - Objects.equals(email, that.email); + Objects.equals(email, that.email) && + Objects.equals(imageUrl, that.imageUrl); } @Override public int hashCode() { - return Objects.hash(storeName, address, phone, email); + return Objects.hash(storeName, address, phone, email, imageUrl); } @Override @@ -73,6 +84,7 @@ public class StoreRequest { ", address='" + address + '\'' + ", phone='" + phone + '\'' + ", email='" + email + '\'' + + ", imageUrl='" + imageUrl + '\'' + '}'; } } diff --git a/backend/src/main/java/com/petshop/backend/dto/store/StoreResponse.java b/backend/src/main/java/com/petshop/backend/dto/store/StoreResponse.java index e6fd563e..bf5cafd2 100644 --- a/backend/src/main/java/com/petshop/backend/dto/store/StoreResponse.java +++ b/backend/src/main/java/com/petshop/backend/dto/store/StoreResponse.java @@ -9,17 +9,19 @@ public class StoreResponse { private String address; private String phone; private String email; + private String imageUrl; private LocalDateTime createdAt; public StoreResponse() { } - public StoreResponse(Long storeId, String storeName, String address, String phone, String email, LocalDateTime createdAt) { + public StoreResponse(Long storeId, String storeName, String address, String phone, String email, String imageUrl, LocalDateTime createdAt) { this.storeId = storeId; this.storeName = storeName; this.address = address; this.phone = phone; this.email = email; + this.imageUrl = imageUrl; this.createdAt = createdAt; } @@ -63,6 +65,14 @@ public class StoreResponse { this.email = email; } + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + public LocalDateTime getCreatedAt() { return createdAt; } diff --git a/backend/src/main/java/com/petshop/backend/entity/StoreLocation.java b/backend/src/main/java/com/petshop/backend/entity/StoreLocation.java index 8c6a9c76..1f79a830 100644 --- a/backend/src/main/java/com/petshop/backend/entity/StoreLocation.java +++ b/backend/src/main/java/com/petshop/backend/entity/StoreLocation.java @@ -28,6 +28,9 @@ public class StoreLocation { @Column(nullable = false, length = 100) private String email; + @Column(length = 500) + private String imageUrl; + @CreationTimestamp @Column(name = "created_at", updatable = false) private LocalDateTime createdAt; @@ -89,6 +92,14 @@ public class StoreLocation { this.email = email; } + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + public LocalDateTime getCreatedAt() { return createdAt; } diff --git a/backend/src/main/java/com/petshop/backend/service/StoreService.java b/backend/src/main/java/com/petshop/backend/service/StoreService.java index 5d2c9ce3..ff9b6581 100644 --- a/backend/src/main/java/com/petshop/backend/service/StoreService.java +++ b/backend/src/main/java/com/petshop/backend/service/StoreService.java @@ -43,6 +43,7 @@ public class StoreService { store.setAddress(request.getAddress()); store.setPhone(request.getPhone()); store.setEmail(request.getEmail()); + store.setImageUrl(request.getImageUrl()); store = storeRepository.save(store); return mapToResponse(store); @@ -57,6 +58,7 @@ public class StoreService { store.setAddress(request.getAddress()); store.setPhone(request.getPhone()); store.setEmail(request.getEmail()); + store.setImageUrl(request.getImageUrl()); store = storeRepository.save(store); return mapToResponse(store); @@ -82,6 +84,7 @@ public class StoreService { store.getAddress(), store.getPhone(), store.getEmail(), + store.getImageUrl(), store.getCreatedAt() ); }