Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] 메인화면 채소 프로필 조회 + 스텝 개수 추가 #65

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분에 대해서는 컨벤션이 없어서 작성은 자유지만, 현재 스텝수과 전체 스텝수를 나타내는 step과 stepCount의 변수명이 클라이언트 개발자가 볼 때 헷갈릴 수 있으니 명세서에 명확히 적는 것이 좋을 것 같네요 :)

Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ public class SelectMyVeggieProfileResponse {
private String createdVeggie;
private int period;
private int step;
private int stepCount;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.modernfarmer.farmusspring.domain.myveggiegarden.entity.MyVeggie;
import com.modernfarmer.farmusspring.domain.myveggiegarden.util.DateManager;
import com.modernfarmer.farmusspring.domain.user.entity.User;
import com.modernfarmer.farmusspring.domain.veggieinfo.entity.VeggieInfo;
import com.modernfarmer.farmusspring.domain.veggieinfo.helper.VeggieInfoHelper;
import com.modernfarmer.farmusspring.domain.veggieinfo.vo.VeggieInfoVo;
import com.modernfarmer.farmusspring.global.response.BaseResponseDto;
Expand Down Expand Up @@ -56,14 +57,16 @@ public BaseResponseDto<Void> deleteMyVeggie(DeleteMyVeggieRequest deleteMyVeggie
@Transactional
public BaseResponseDto<SelectMyVeggieProfileResponse> selectMyVeggieProfile(Long myVeggieId) {
MyVeggie myVeggie = selectMyVeggieAndFarmClub(myVeggieId);
VeggieInfo veggieInfo = veggieInfoHelper.getVeggieInfoEntity(myVeggie.getVeggieInfoId());
return BaseResponseDto.of(SuccessCode.SUCCESS,
SelectMyVeggieProfileResponse.of(
myVeggie.getNickname(),
myVeggie.getVeggieName(),
myVeggie.getVeggieImage(),
DateManager.parsingDotDate(myVeggie.getBirth()),
DateManager.calculateDay(myVeggie.getBirth(), new Date()),
checkFarmClubAffiliation(myVeggie)
checkFarmClubAffiliation(myVeggie),
veggieInfo.getSteps().size()
));
}

Expand Down
Loading