-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feature/#44/fix myplant detail
- Loading branch information
Showing
5 changed files
with
59 additions
and
11 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
29 changes: 29 additions & 0 deletions
29
server/src/main/java/com/plantity/server/domain/myPlant/MyPlantDetailRes.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,29 @@ | ||
package com.plantity.server.domain.myPlant; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class MyPlantDetailRes { | ||
|
||
private Long myPlantId; | ||
private String plantNickName; | ||
private String plantName; | ||
private String adaptDate; | ||
private String waterCycle; // 관수 설명 | ||
private String filePath; | ||
|
||
private MyPlantDetailRes(MyPlant myPlant){ | ||
this.myPlantId = myPlant.getMyPlantId(); | ||
this.plantNickName = myPlant.getPlantNickName(); | ||
this.plantName = myPlant.getPlantName(); | ||
this.adaptDate = myPlant.getPlantAdaptTime(); | ||
this.waterCycle = myPlant.getWatercycleSprngCodeNm(); | ||
this.filePath = myPlant.getFilePath(); | ||
} | ||
|
||
public static MyPlantDetailRes from(MyPlant myPlant){ | ||
return new MyPlantDetailRes(myPlant); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
server/src/main/java/com/plantity/server/repository/MyPlantRepository.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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.plantity.server.repository; | ||
|
||
import com.plantity.server.domain.myPlant.MyPlant; | ||
import com.plantity.server.domain.myPlant.MyPlantDetailRes; | ||
import com.plantity.server.domain.myPlant.MyPlantResponseDto; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface MyPlantRepository extends JpaRepository<MyPlant, Long> { | ||
List<MyPlantResponseDto> findAllByUserIdx(Long userId); | ||
MyPlantDetailRes findByMyPlantId(Long myPlantId); | ||
Boolean existsByMyPlantId(Long myPlantId); | ||
} |
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