-
Notifications
You must be signed in to change notification settings - Fork 1
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
[feat] 모델 화제성 조회 api #26
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.
고생했어!! 개발 속도가 진짜 빠르다,.. 덕분에 코드 보면서 배울 수 있어서 좋다
src/main/java/com/backend/soullive_a/dto/response/model/popularity/ModelPopularAgeResponse.java
Show resolved
Hide resolved
src/main/java/com/backend/soullive_a/dto/response/model/popularity/ModelPopularityResponse.java
Show resolved
Hide resolved
package com.backend.soullive_a.dto.response.model.popularity; | ||
|
||
public record ModelScheduledWorkResponse( | ||
Long modelScheduledWorkId, |
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.
저는 dto에서 id를 전부 다 뺐는데, 있는게 좋을까요?
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.
세개 리뷰가 다 같은 내용이라 한번에 쓰자면 프론트에서는 사실 쓰는 값은 아니지만, 값을 잘 받아온건지 확인하는 용도로 쓰는 거라 편한대로 하는게 좋을것같아요. 저는 모든 dto에 id를 넣는편입니다..!
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 interface ModelPopularAgeRepository extends JpaRepository<ModelPopularAge, Long> { | ||
|
||
List<ModelPopularAge> findAllByModelPopularityModelModelName(String name); |
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.
ModelPopularityModelModelName 이게 상당히 어렵네.
ModelPopularity 필드의 model필드의 modelname를 가져오는거야?
그렇다면 엔티티끼리 join하는건 jpa에서 해주는건가?
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.
맞아요 jpa가 알아서 찾아주는거
INSERT INTO soullive.model_popular_gender (gender_id, model_popularity_id, gender_type) values ('2','1','FEMALE'); | ||
INSERT INTO soullive.model_popular_age (age_id, model_popularity_id,age_type) values (1,1,'THIRTY'); | ||
INSERT INTO soullive.model_popular_age (age_id, model_popularity_id,age_type) values (2,1,'FORTY'); |
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.
같은 테이블에 삽입할 때는
insert into tbl ()
values (1,name)
(2,name)
이런식으로 줄이면 좋을 것 같아!
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.
근데 만약에 이렇게 하면 예를 들어 우리 모델을 15명 넣으면 줄이 오른쪽으로 계속 늘어나는 건가?
🗃 Issue
🔥 Task
📄 Reference