-
Notifications
You must be signed in to change notification settings - Fork 0
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
[TNT-217] feat: 트레이니 - 식단 등록 기능 구현 #57
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!!!~🔥🔥🔥🔥🔥🔥
수정할 거 반영 후 말해주세요!
@@ -153,8 +158,8 @@ public GetActiveTraineesResponse getActiveTrainees(Long memberId) { | |||
.toList(); | |||
|
|||
return new TraineeInfo(trainee.getId(), trainee.getMember().getName(), | |||
ptTrainerTrainee.getFinishedPtCount(), ptTrainerTrainee.getTotalPtCount(), trainee.getCautionNote(), | |||
ptGoals); | |||
trainee.getMember().getProfileImageUrl(), ptTrainerTrainee.getFinishedPtCount(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메모 부분은 추후에 넣어주어야 하니까 나중을 위해 위에다가 주석 하나 달아주세요!
ex) // Memo 추가 구현
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 반영하겠습니다 !
|
||
public static final int DIET_IMAGE_URL_LENGTH = 255; | ||
public static final int MEMO_LENGTH = 100; | ||
public static final int DIET_TYPE_LENGTH = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BREAKFAST
가 5를 넘습니다!
넉넉하게 20 정도 어떨까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다~ 반영하겠습니다 !
} | ||
|
||
private String validateDietImageUrl(String dietImageUrl) { | ||
if (dietImageUrl.length() > DIET_IMAGE_URL_LENGTH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isBlank()
가 빠진거 같아요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사진 없으면 디폴트를 ""
로 저장하고 싶은데 isBlank가 막더라구요 그래서 뺐습니다 !
@Column(name = "date", nullable = false) | ||
private LocalDate date; | ||
|
||
@Column(name = "time", nullable = false) | ||
private LocalTime time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
따로 받도록 구현하신 이유가 있을까요!?
시간과 날짜는 한번에 LocalDateTime
으로 받는건 어떨까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이것도 수정해서 반영하겠습니다 !
@Schema(description = "식사 날짜", example = "2025-01-01", nullable = true) | ||
@PastOrPresent(message = "식사 날짜는 현재거나 과거 날짜여야 합니다.") | ||
LocalDate date, | ||
|
||
@Schema(description = "식사 시간", example = "19:30", nullable = true) | ||
@PastOrPresent(message = "식사 시간은 현재거나 과거 시간이어야 합니다.") | ||
LocalTime time, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 Entity 쪽 참고 부탁드려요!
그리고 기획쪽에서 이전 날짜는 안되도록 하지는 않았던걸로 기억해서,,
한번 확인 부탁드립니다. 사용자가 이전 시간 날짜에 기록 못하는 것이 어색한거 같아요.
DietType dietType, | ||
|
||
@Schema(description = "메모", example = "아 배부르다.", nullable = false) | ||
@NotBlank(message = "메모는 필수입니다.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100자 이하로 받기 때문에
@Size(min = 1, max = 100, message = "메모는 100자 이하여야 합니다.")
추가 부탁드려요~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 반영하겠습니다 !
|
||
import com.tnt.domain.trainee.Diet; | ||
|
||
public interface DietRepository extends JpaRepository<Diet, Integer> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JpaRepository<Diet, Long>
으로 수정해야할 거 같아요!
|
||
@Operation(summary = "트레이니 식단 등록 API") | ||
@ResponseStatus(CREATED) | ||
@PostMapping(value = "/create-diet", consumes = MULTIPART_FORM_DATA_VALUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RESTful API 규칙에 더 따르자면 /diets
는 어떠신가요!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 까먹고 안 바꿔놨네요 수정하겠습니다 !
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
좋습니다 고생하셨어요!!!~~!
📋 Checklist
[APP2-77] feat: 회원 인증 Filter 구현
)🎟️ Issue
✅ Tasks
트레이니 식단 등록 API
""
가 리턴됩니다.이미지 회전되어서 저장되는 버그
🙋🏻 More