-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from Team-odongdong/feature/patch/bathroomInfo
화장실 수정 구현
- Loading branch information
Showing
9 changed files
with
291 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/backend/src/main/java/com/graduate/odondong/domain/UpdatedBathroom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.graduate.odondong.domain; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
@Entity() | ||
@Data | ||
@NoArgsConstructor | ||
@Setter | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class UpdatedBathroom { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name="bathroom_id") | ||
private Bathroom bathroom; | ||
private Long userId; | ||
private String title; | ||
private Double latitude; | ||
private Double longitude; | ||
private String isLocked; | ||
private String address; | ||
private String addressDetail; | ||
private String imageUrl; | ||
private String operationTime; | ||
private Boolean isUnisex; | ||
private Boolean register; | ||
|
||
@CreatedDate | ||
@Column(updatable = false) | ||
private LocalDateTime created_at; | ||
@LastModifiedDate | ||
private LocalDateTime updated_at; | ||
|
||
@Builder | ||
public UpdatedBathroom(Long id, Long userId, Bathroom bathroom, String title, Double latitude, Double longitude, String isLocked, String address, String addressDetail, String imageUrl, String operationTime, Boolean isUnisex, Boolean register) { | ||
this.id = id; | ||
this.userId = userId; | ||
this.bathroom = bathroom; | ||
this.title = title; | ||
this.latitude = latitude; | ||
this.longitude = longitude; | ||
this.isLocked = isLocked; | ||
this.address = address; | ||
this.addressDetail = addressDetail; | ||
this.imageUrl = imageUrl; | ||
this.operationTime = operationTime; | ||
this.isUnisex = isUnisex; | ||
this.register = register; | ||
} | ||
|
||
|
||
} |
57 changes: 57 additions & 0 deletions
57
src/backend/src/main/java/com/graduate/odondong/dto/BathroomUpdateRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.graduate.odondong.dto; | ||
|
||
import com.graduate.odondong.domain.Bathroom; | ||
import com.graduate.odondong.domain.UpdatedBathroom; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
public class BathroomUpdateRequestDto { | ||
|
||
private Long bathroomId; | ||
private Long userId; | ||
private String title; | ||
private Double latitude; | ||
private Double longitude; | ||
private String isLocked; | ||
private String address; | ||
private String addressDetail; | ||
private String imageUrl; | ||
private String operationTime; | ||
private Boolean isUnisex; | ||
|
||
@Builder | ||
public BathroomUpdateRequestDto(Long bathroomId, Long userId, String title, Double latitude, Double longitude, String isLocked, String address, String addressDetail, String imageUrl,String operationTime, Boolean isUnisex) { | ||
this.bathroomId = bathroomId; | ||
this.userId = userId; | ||
this.title = title; | ||
this.latitude = latitude; | ||
this.longitude = longitude; | ||
this.isLocked = isLocked; | ||
this.address = address; | ||
this.addressDetail = addressDetail; | ||
this.imageUrl = imageUrl; | ||
this.operationTime = operationTime; | ||
this.isUnisex = isUnisex; | ||
} | ||
|
||
|
||
public UpdatedBathroom toUpdatedBathroom(Bathroom bathroom) { | ||
return UpdatedBathroom.builder() | ||
.title(title) | ||
.userId(userId) | ||
.bathroom(bathroom) | ||
.latitude(latitude) | ||
.longitude(longitude) | ||
.isLocked(isLocked) | ||
.address(address) | ||
.addressDetail(addressDetail) | ||
.register(false) | ||
.imageUrl(imageUrl) | ||
.operationTime(operationTime) | ||
.isUnisex(isUnisex) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/backend/src/main/java/com/graduate/odondong/repository/UpdatedBathroomRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.graduate.odondong.repository; | ||
|
||
import com.graduate.odondong.domain.UpdatedBathroom; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface UpdatedBathroomRepository extends JpaRepository<UpdatedBathroom, Long> { | ||
|
||
List<UpdatedBathroom> findUpdatedBathroomsByRegisterIsFalse(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.