add storeLocation imageUrl
This commit is contained in:
@@ -18,6 +18,8 @@ public class StoreRequest {
|
|||||||
@Email(message = "Email must be valid")
|
@Email(message = "Email must be valid")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
private String imageUrl;
|
||||||
|
|
||||||
public String getStoreName() {
|
public String getStoreName() {
|
||||||
return storeName;
|
return storeName;
|
||||||
}
|
}
|
||||||
@@ -50,6 +52,14 @@ public class StoreRequest {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getImageUrl() {
|
||||||
|
return imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageUrl(String imageUrl) {
|
||||||
|
this.imageUrl = imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
@@ -58,12 +68,13 @@ public class StoreRequest {
|
|||||||
return Objects.equals(storeName, that.storeName) &&
|
return Objects.equals(storeName, that.storeName) &&
|
||||||
Objects.equals(address, that.address) &&
|
Objects.equals(address, that.address) &&
|
||||||
Objects.equals(phone, that.phone) &&
|
Objects.equals(phone, that.phone) &&
|
||||||
Objects.equals(email, that.email);
|
Objects.equals(email, that.email) &&
|
||||||
|
Objects.equals(imageUrl, that.imageUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(storeName, address, phone, email);
|
return Objects.hash(storeName, address, phone, email, imageUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,6 +84,7 @@ public class StoreRequest {
|
|||||||
", address='" + address + '\'' +
|
", address='" + address + '\'' +
|
||||||
", phone='" + phone + '\'' +
|
", phone='" + phone + '\'' +
|
||||||
", email='" + email + '\'' +
|
", email='" + email + '\'' +
|
||||||
|
", imageUrl='" + imageUrl + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,19 @@ public class StoreResponse {
|
|||||||
private String address;
|
private String address;
|
||||||
private String phone;
|
private String phone;
|
||||||
private String email;
|
private String email;
|
||||||
|
private String imageUrl;
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
public StoreResponse() {
|
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.storeId = storeId;
|
||||||
this.storeName = storeName;
|
this.storeName = storeName;
|
||||||
this.address = address;
|
this.address = address;
|
||||||
this.phone = phone;
|
this.phone = phone;
|
||||||
this.email = email;
|
this.email = email;
|
||||||
|
this.imageUrl = imageUrl;
|
||||||
this.createdAt = createdAt;
|
this.createdAt = createdAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +65,14 @@ public class StoreResponse {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getImageUrl() {
|
||||||
|
return imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageUrl(String imageUrl) {
|
||||||
|
this.imageUrl = imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public LocalDateTime getCreatedAt() {
|
public LocalDateTime getCreatedAt() {
|
||||||
return createdAt;
|
return createdAt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ public class StoreLocation {
|
|||||||
@Column(nullable = false, length = 100)
|
@Column(nullable = false, length = 100)
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
@Column(length = 500)
|
||||||
|
private String imageUrl;
|
||||||
|
|
||||||
@CreationTimestamp
|
@CreationTimestamp
|
||||||
@Column(name = "created_at", updatable = false)
|
@Column(name = "created_at", updatable = false)
|
||||||
private LocalDateTime createdAt;
|
private LocalDateTime createdAt;
|
||||||
@@ -89,6 +92,14 @@ public class StoreLocation {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getImageUrl() {
|
||||||
|
return imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImageUrl(String imageUrl) {
|
||||||
|
this.imageUrl = imageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public LocalDateTime getCreatedAt() {
|
public LocalDateTime getCreatedAt() {
|
||||||
return createdAt;
|
return createdAt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class StoreService {
|
|||||||
store.setAddress(request.getAddress());
|
store.setAddress(request.getAddress());
|
||||||
store.setPhone(request.getPhone());
|
store.setPhone(request.getPhone());
|
||||||
store.setEmail(request.getEmail());
|
store.setEmail(request.getEmail());
|
||||||
|
store.setImageUrl(request.getImageUrl());
|
||||||
|
|
||||||
store = storeRepository.save(store);
|
store = storeRepository.save(store);
|
||||||
return mapToResponse(store);
|
return mapToResponse(store);
|
||||||
@@ -57,6 +58,7 @@ public class StoreService {
|
|||||||
store.setAddress(request.getAddress());
|
store.setAddress(request.getAddress());
|
||||||
store.setPhone(request.getPhone());
|
store.setPhone(request.getPhone());
|
||||||
store.setEmail(request.getEmail());
|
store.setEmail(request.getEmail());
|
||||||
|
store.setImageUrl(request.getImageUrl());
|
||||||
|
|
||||||
store = storeRepository.save(store);
|
store = storeRepository.save(store);
|
||||||
return mapToResponse(store);
|
return mapToResponse(store);
|
||||||
@@ -82,6 +84,7 @@ public class StoreService {
|
|||||||
store.getAddress(),
|
store.getAddress(),
|
||||||
store.getPhone(),
|
store.getPhone(),
|
||||||
store.getEmail(),
|
store.getEmail(),
|
||||||
|
store.getImageUrl(),
|
||||||
store.getCreatedAt()
|
store.getCreatedAt()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user