-
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 및 스웨거 설명 추가 #35
Conversation
modelproduct가 productModel인가요? |
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.
수고하셨습니다~!! 드디어 끝이보인다
//package com.backend.soullive_a.dto.response; | ||
// | ||
//import com.backend.soullive_a.entity.model.Model; | ||
//import jakarta.persistence.Column; | ||
//import jakarta.persistence.FetchType; | ||
//import jakarta.persistence.JoinColumn; | ||
//import jakarta.persistence.ManyToOne; | ||
//import lombok.Builder; | ||
// | ||
//@Builder | ||
//public record ModelImageKeywordResponse( | ||
// String keyord | ||
//// Model model //필요한가? | ||
//) { | ||
//} |
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.
클래스 지워도 됩니다!
.code(200) | ||
.message("모델 적합도 조회에 성공했습니다.") | ||
.isSuccess(true) | ||
.data(modelFitnessService.getModelFitness(new ModelFitnessRequest(modelName, productId))) |
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.
.data(modelFitnessService.getModelFitness(new ModelFitnessRequest(modelName, productId))) | |
.data(modelFitnessService.getModelFitness(String modelName, Long productId)) |
혹시 ModelFitnessRequest를 쓰는 이유가 있을까요..? 두개만 받는거면 그냥 인자로 넣어주면 service에서 getModelName 같은거 안해도 되니까 이렇게 하는게 코드가 좋을것같아요~
그리고 RequestDto를 쓰고 싶으면
public BaseResponse<ModelFitnessResponse> getModelFitness( @RequestBody ModelFitness modelFitenessRequest )
이런식으로 쓰면 좋을것같아요
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.
오 requestbody에 dto가 되는줄 몰랏어요 대박 ,, ,, 지금 시간이 없어서 오늘 밤에 수정할게요 이거는
|
||
@Override | ||
@Transactional | ||
public ModelResponse getModel(String modelName,Long productId) { | ||
System.out.println(modelName); | ||
Model model = modelRepository.findByModelName(modelName) | ||
.orElseThrow(() -> new NotFoundUserException()); | ||
|
||
System.out.println(model.getModelName()+productId); |
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.
그리고 출력 값 혹시 필요하면 저희 slf4j 사용하니깐 @slf4j 사용해서 log 찍는거 추천드립니다.
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.
디버깅한다고 만들어 놓은건데 안지웠어요 지울게욤
if (productModel.getModel().getId() == 1) { | ||
aiComment = "김희애의 우아하고 고급스러운 이미지와 함께 가족적인 이미지가 어우러져 lg 시그니처 브랜드의 프리미엄적인 이미지와 고품질 제품에 잘 어울릴 것이라고 판단 됩니다."; | ||
} |
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.
if (productModel.getModel().getId() == 1) { | |
aiComment = "김희애의 우아하고 고급스러운 이미지와 함께 가족적인 이미지가 어우러져 lg 시그니처 브랜드의 프리미엄적인 이미지와 고품질 제품에 잘 어울릴 것이라고 판단 됩니다."; | |
} | |
if (productModel.getModel().getId() == 1) { | |
aiComment = "김희애의 우아하고 고급스러운 이미지와 함께 가족적인 이미지가 어우러져 lg 시그니처 브랜드의 프리미엄적인 이미지와 고품질 제품에 잘 어울릴 것이라고 판단 됩니다."; | |
scoreUrl="https://soullive-bucket.s3.ap-northeast-2.amazonaws.com/hanjimin_modelFitness_score.png"; | |
} |
scoreUrl이랑 aiComment를 합치면 좋을 것 같아 보여요!
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/resources/data.sql
Outdated
-- 모델 적합도 | ||
-- INSERT INTO soullive.model_fitness (model_fitenss_id, product_model_id, ai_comment, score_url) | ||
-- VALUES | ||
-- (1, 1, '김희애의 우아하고 고급스러운 이미지와 함께 가족적인 이미지가 어우러져 lg 시그니처 브랜드의 프리미엄적인 이미지와 고품질 제품에 잘 어울릴 것이라고 판단 됩니다.', 'image.png'); |
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.
넵
|
||
public interface ModelFitnessRepository extends JpaRepository<ModelFitness, Long> { | ||
|
||
// public ModelFitness findById |
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.
지워용
|
||
@Override | ||
@Transactional | ||
public ModelResponse getModel(String modelName,Long productId) { | ||
System.out.println(modelName); | ||
Model model = modelRepository.findByModelName(modelName) | ||
.orElseThrow(() -> new NotFoundUserException()); | ||
|
||
System.out.println(model.getModelName()+productId); |
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.
그리고 출력 값 혹시 필요하면 저희 slf4j 사용하니깐 @slf4j 사용해서 log 찍는거 추천드립니다.
🗃 Issue
🔥 Task
Model
조회 시ModelProduct
가 생성되고,ModelProduct
생성 시ModelFitness
row가 추가되게 했습니다.기업은 LG 하나밖에 없고 텍스트와 점수이미지는 사람 당 하나의 이미지로 들어갈 예정입니다.
📄 Reference