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

[feat] 모델 화제성 조회 api #26

Merged
merged 1 commit into from
Mar 6, 2024
Merged

[feat] 모델 화제성 조회 api #26

merged 1 commit into from
Mar 6, 2024

Conversation

sominyun
Copy link
Member

@sominyun sominyun commented Mar 5, 2024

🗃 Issue

🔥 Task

  • 모델 이름으로 화제성을 조회 api
  • 현재 "김희애"로 조회할 수 있음
  • url 기디가 사진 다 넣으면 db에 넣을 예정

{
"code": 200,
"message": "김희애 모델 화제성 조회에 성공했습니다.",
"data": {
"modelPopularityId": 1,
"modelId": 1,
"scoreUrl": null,
"aiComment": "최근 화제성에서는 다소 약한 모습을 보여주고 있지만 3040 남녀 모두에게 높은 인지도를 갖고 있고 앞으로 2개의 주연 활동을 앞두고 있어 더 큰 화제성을 갖을 것으로 예상됩니다.",
"genders": [
{
"genderId": 1,
"gender": "MALE"
},
{
"genderId": 2,
"gender": "FEMALE"
}
],
"ages": [
{
"ageId": 1,
"ageType": "THIRTY"
},
{
"ageId": 2,
"ageType": "FORTY"
},
{
"ageId": 3,
"ageType": "FIFTY"
}
],
"snsUrl": null,
"searchUrl": null,
"brandScoreUrl": null,
"modelScheduledWorks": [
{
"modelScheduledWorkId": 1,
"imageUrl": null,
"year": 2024,
"category": "방영 예정 영화",
"title": "돌풍",
"isMainActor": true,
"genre": "공포"
},
{
"modelScheduledWorkId": 2,
"imageUrl": null,
"year": 2024,
"category": "방영 예정 영화",
"title": "보통의 가족",
"isMainActor": true,
"genre": "공포"
}
]
},
"success": true
}

📄 Reference

  • None

@sominyun sominyun requested review from j2noo and lsm-del March 5, 2024 17:43
Copy link
Contributor

@j2noo j2noo left a comment

Choose a reason for hiding this comment

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

고생했어!! 개발 속도가 진짜 빠르다,.. 덕분에 코드 보면서 배울 수 있어서 좋다

package com.backend.soullive_a.dto.response.model.popularity;

public record ModelScheduledWorkResponse(
Long modelScheduledWorkId,
Copy link
Contributor

Choose a reason for hiding this comment

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

저는 dto에서 id를 전부 다 뺐는데, 있는게 좋을까요?

Copy link
Member Author

@sominyun sominyun Mar 6, 2024

Choose a reason for hiding this comment

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

세개 리뷰가 다 같은 내용이라 한번에 쓰자면 프론트에서는 사실 쓰는 값은 아니지만, 값을 잘 받아온건지 확인하는 용도로 쓰는 거라 편한대로 하는게 좋을것같아요. 저는 모든 dto에 id를 넣는편입니다..!

Copy link
Member Author

@sominyun sominyun Mar 6, 2024

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);
Copy link
Contributor

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에서 해주는건가?

Copy link
Member Author

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');
Copy link
Contributor

@j2noo j2noo Mar 6, 2024

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)

이런식으로 줄이면 좋을 것 같아!

Copy link
Member Author

Choose a reason for hiding this comment

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

근데 만약에 이렇게 하면 예를 들어 우리 모델을 15명 넣으면 줄이 오른쪽으로 계속 늘어나는 건가?

@j2noo j2noo merged commit 2fe61bb into develop Mar 6, 2024
1 check passed
@lsm-del lsm-del deleted the feature/#24-S3 branch March 8, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

화제성 조회 api 구현
3 participants