Skip to content

Commit

Permalink
feat : ai 피드백 조회 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
SIWON990327 authored Nov 23, 2024
1 parent 5b1d6c0 commit c610cbc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.groom.orbit.common.exception.CommonException;
import com.groom.orbit.common.exception.ErrorCode;
import com.groom.orbit.member.app.dto.response.GetMemberAiFeedbackResponseDto;
import com.groom.orbit.member.app.dto.response.GetMemberProfileResponseDto;
import com.groom.orbit.member.dao.jpa.MemberRepository;
import com.groom.orbit.member.dao.jpa.entity.Member;
Expand Down Expand Up @@ -36,4 +37,11 @@ public GetMemberProfileResponseDto getMemberProfile(Long memberId) {
.nickname(member.getNickname())
.build();
}

public GetMemberAiFeedbackResponseDto getMemberAiFeedback(Long memberId) {

Member member = findMember(memberId);

return GetMemberAiFeedbackResponseDto.fromMember(member);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.groom.orbit.member.app.dto.response;

import com.groom.orbit.member.dao.jpa.entity.Member;

public record GetMemberAiFeedbackResponseDto(String aiFeedback) {

public static GetMemberAiFeedbackResponseDto fromMember(Member member) {
return new GetMemberAiFeedbackResponseDto(member.getAiFeedback());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.groom.orbit.common.annotation.AuthMember;
import com.groom.orbit.common.dto.ResponseDto;
import com.groom.orbit.member.app.MemberQueryService;
import com.groom.orbit.member.app.dto.response.GetMemberAiFeedbackResponseDto;
import com.groom.orbit.member.app.dto.response.GetMemberProfileResponseDto;

import lombok.RequiredArgsConstructor;
Expand All @@ -22,4 +23,10 @@ public class MemberQueryController {
public ResponseDto<GetMemberProfileResponseDto> getMemberProfile(@AuthMember Long memberId) {
return ResponseDto.ok(memberQueryService.getMemberProfile(memberId));
}

@GetMapping("/ai")
public ResponseDto<GetMemberAiFeedbackResponseDto> getMemberAiFeedback(
@AuthMember Long memberId) {
return ResponseDto.ok(memberQueryService.getMemberAiFeedback(memberId));
}
}

0 comments on commit c610cbc

Please sign in to comment.