Skip to content

Commit

Permalink
[feat] - 나의 식물 조회 API 생성
Browse files Browse the repository at this point in the history
- 브랜치 분리 못함..
  • Loading branch information
abi-hong committed Sep 13, 2022
1 parent d889ff2 commit db6796e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.plantity.server.domain.myPlant;

import com.plantity.server.domain.plantlog.Log;
import com.plantity.server.domain.plantlog.PlantLog;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
public class MyPlantResponseDto {

private String plantName;
private String filePath;
private Long userId;
private PlantLog plantLog;

private MyPlantResponseDto(MyPlant myPlant) {
this.plantName = myPlant.getPlantName();
this.filePath = myPlant.getFilePath();
this.userId = myPlant.getUserIdx();
}

public static MyPlantResponseDto from(MyPlant myPlant) {
return new MyPlantResponseDto(myPlant);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.plantity.server.dto.res.myplant;


import com.plantity.server.constants.SuccessCode;
import com.plantity.server.domain.myPlant.MyPlantResponseDto;
import com.plantity.server.dto.BaseResponse;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.http.ResponseEntity;

@Getter
@NoArgsConstructor
public class MyPlantResponse extends BaseResponse {

private MyPlantResponseDto data;

private MyPlantResponse(Boolean success, String msg, MyPlantResponseDto data) {
super(success, msg);
this.data = data;
}


}

0 comments on commit db6796e

Please sign in to comment.