From bc8fe21c849ed2b8d26f0ef67650588c667416cb Mon Sep 17 00:00:00 2001 From: tkv00 Date: Wed, 19 Nov 2025 17:22:15 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat=20:=20=EC=B5=9C=EA=B7=BC=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EB=90=9C=20=ED=95=98=EC=9D=B4=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=98=81=EC=83=81=20=EC=A1=B0=ED=9A=8C=20=EC=BB=A8?= =?UTF-8?q?=ED=8A=B8=EB=A1=A4=EB=9F=AC=20=EA=B5=AC=ED=98=84=20#240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../highlight/controller/HighlightQueryController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java b/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java index af481997..47c51374 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java @@ -54,4 +54,11 @@ public ResponseEntity> fetchCalendar( UUID memberId=SecurityUtils.getCurrentMemberId(); return ResponseEntity.ok(ApiResponse.ok(manager.fetchCalendar(year,month,memberId))); } + + @GetMapping("/latest") + public ResponseEntity> latestCreatedHighlights( + @RequestParam(value = "jobId") UUID jobId + ){ + return ResponseEntity.ok(ApiResponse.ok(manager.fetchLatestCreated(jobId))); + } } From 50da4c8fd0f4ca3fed88b6209e088d82d428f937 Mon Sep 17 00:00:00 2001 From: tkv00 Date: Wed, 19 Nov 2025 17:25:03 +0900 Subject: [PATCH 2/6] =?UTF-8?q?refact=20:=20HighlightEntity=20job=5Fid=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80=20#241?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shootpointer/domain/highlight/entity/HighlightEntity.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java b/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java index 1d1e7e8a..5bef3820 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java @@ -53,6 +53,9 @@ public class HighlightEntity extends BaseEntity { @Column(name = "video_created_at") private LocalDateTime videoCreatedAt; + @Column(name = "job_id",columnDefinition = "uuid") + private UUID jobId; + /* =========== [ 도메인-행위 ] ============== */ From fdf0af09452581f566b756a92447f46875720bf2 Mon Sep 17 00:00:00 2001 From: tkv00 Date: Wed, 19 Nov 2025 17:29:54 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat=20:=20jobId=20=EA=B0=92=EC=9D=84=20?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=ED=95=98=EC=97=AC=20=ED=95=98=EC=9D=B4?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=ED=8A=B8=20=EC=98=81=EC=83=81=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20=EC=BF=BC=EB=A6=AC=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20#240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/HighlightQueryRepository.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/repository/HighlightQueryRepository.java b/src/main/java/com/midas/shootpointer/domain/highlight/repository/HighlightQueryRepository.java index c274194b..62496f1a 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/repository/HighlightQueryRepository.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/repository/HighlightQueryRepository.java @@ -104,6 +104,18 @@ SELECT EXISTS( h.videoCreatedAt ASC """ ) List fetchFlatHighlights(LocalDateTime startDate,LocalDateTime endDate,UUID memberId); + + + @Query(value = """ + SELECT * + FROM + highlight AS h + INNER JOIN + member AS m ON h.member_id = :memberId + WHERE + h.job_id = :jobId + """,nativeQuery = true) + List fetchHighlightsByJobId(UUID jobId,UUID memberId); /** * =========================== *

From e660e9e53b8724b58c498ed3378057297dbc85f9 Mon Sep 17 00:00:00 2001 From: tkv00 Date: Wed, 19 Nov 2025 17:33:18 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat=20:=20=EC=B5=9C=EA=B7=BC=20=ED=95=98?= =?UTF-8?q?=EC=9D=B4=EB=9D=BC=EC=9D=B4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EC=84=9C=EB=B9=84=EC=8A=A4=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20#240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shootpointer/domain/highlight/helper/HighlightUtil.java | 1 + .../domain/highlight/helper/HighlightUtilImpl.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtil.java b/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtil.java index d19b9341..2fa9e856 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtil.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtil.java @@ -24,4 +24,5 @@ public interface HighlightUtil { TreeMap> groupingHighlights(List flatHighlightList); List fetchFlatHighlightList(int year,int month,UUID memberId); DateTimeRange getMonthDateTimeRange(int year, int month); + List fetchLastestCreatedHighlights(UUID jobId,UUID memberId); } diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtilImpl.java b/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtilImpl.java index 4d3a1e8d..efe4862f 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtilImpl.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightUtilImpl.java @@ -163,5 +163,10 @@ public DateTimeRange getMonthDateTimeRange(int year, int month) { return new DateTimeRange(start,end); } + @Override + public List fetchLastestCreatedHighlights(UUID jobId, UUID memberId) { + return highlightQueryRepository.fetchHighlightsByJobId(jobId,memberId); + } + } From d90f97805099933ebe86947e5fad6ccec49cebfd Mon Sep 17 00:00:00 2001 From: tkv00 Date: Wed, 19 Nov 2025 17:39:14 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat=20:=20=EC=B5=9C=EA=B7=BC=20=ED=95=98?= =?UTF-8?q?=EC=9D=B4=EB=9D=BC=EC=9D=B4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20man?= =?UTF-8?q?ager=20=EB=B9=84=EC=A6=88=EB=8B=88=EC=8A=A4=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EA=B5=AC=ED=98=84=20#240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/highlight/business/HighlightManager.java | 8 ++++++++ .../highlight/controller/HighlightQueryController.java | 3 ++- .../domain/highlight/helper/HighlightHelperImpl.java | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java b/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java index 0f5475f8..073b74c9 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java @@ -114,4 +114,12 @@ public HighlightCalendarResponse fetchCalendar(int year, int month,UUID memberId return new HighlightCalendarResponse(year,month,daysResponses); } + + public List fetchLatestCreatedHighlights(UUID jobId,UUID memberId){ + List highlightList=highlightHelper.fetchLastestCreatedHighlights(jobId,memberId); + + return highlightList.stream() + .map(mapper::infoResponseToEntity) + .toList(); + } } diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java b/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java index 47c51374..5c60aa81 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java @@ -59,6 +59,7 @@ public ResponseEntity> fetchCalendar( public ResponseEntity> latestCreatedHighlights( @RequestParam(value = "jobId") UUID jobId ){ - return ResponseEntity.ok(ApiResponse.ok(manager.fetchLatestCreated(jobId))); + UUID memberId=SecurityUtils.getCurrentMemberId(); + return ResponseEntity.ok(ApiResponse.ok(manager.fetchLatestCreatedHighlights(jobId,memberId))); } } diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightHelperImpl.java b/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightHelperImpl.java index 2e413060..8922933c 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightHelperImpl.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/helper/HighlightHelperImpl.java @@ -67,6 +67,11 @@ public DateTimeRange getMonthDateTimeRange(int year, int month) { return highlightUtil.getMonthDateTimeRange(year,month); } + @Override + public List fetchLastestCreatedHighlights(UUID jobId, UUID memberId) { + return highlightUtil.fetchLastestCreatedHighlights(jobId,memberId); + } + @Override public boolean filesExist(String directory) { return highlightValidator.filesExist(directory); From 2954de6cec4a6034330380b24a55dd110ac5464a Mon Sep 17 00:00:00 2001 From: tkv00 Date: Wed, 19 Nov 2025 21:32:28 +0900 Subject: [PATCH 6/6] =?UTF-8?q?feat=20:=20=EC=B5=9C=EA=B7=BC=20=ED=95=98?= =?UTF-8?q?=EC=9D=B4=EB=9D=BC=EC=9D=B4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20man?= =?UTF-8?q?ager=20=EB=B9=84=EC=A6=88=EB=8B=88=EC=8A=A4=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95=EC=9C=BC=EB=A1=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=95=9C=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20#240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/highlight/business/HighlightManager.java | 9 ++++++++- .../highlight/controller/HighlightQueryController.java | 2 +- .../domain/highlight/dto/HighlightRequest.java | 3 +++ .../domain/highlight/entity/HighlightEntity.java | 5 +---- .../domain/highlight/mapper/HighlightFactory.java | 4 +++- .../domain/highlight/mapper/HighlightFactoryTest.java | 4 +++- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java b/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java index 073b74c9..ce61a103 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/business/HighlightManager.java @@ -61,7 +61,14 @@ public void saveHighlights(HighlightRequest request, UUID memberId) { /* * 2. 하이라이트 엔티티 생성 */ - List entities=factory.createHighlightEntities(request.getHighlightUrls(),request.getHighlightIdentifier(),member,backNumber,request.getCreatedAt()); + List entities=factory.createHighlightEntities( + request.getHighlightUrls(), + request.getHighlightIdentifier(), + member, + backNumber, + request.getCreatedAt(), + request.getJobId() + ); /* 3. DB 저장 diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java b/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java index 5c60aa81..c352ade2 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/controller/HighlightQueryController.java @@ -56,7 +56,7 @@ public ResponseEntity> fetchCalendar( } @GetMapping("/latest") - public ResponseEntity> latestCreatedHighlights( + public ResponseEntity>> latestCreatedHighlights( @RequestParam(value = "jobId") UUID jobId ){ UUID memberId=SecurityUtils.getCurrentMemberId(); diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/dto/HighlightRequest.java b/src/main/java/com/midas/shootpointer/domain/highlight/dto/HighlightRequest.java index ee432755..327ceb03 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/dto/HighlightRequest.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/dto/HighlightRequest.java @@ -1,6 +1,7 @@ package com.midas.shootpointer.domain.highlight.dto; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -27,4 +28,6 @@ public class HighlightRequest { @NotBlank(message = "하이라이트 생성 날짜는 필수입니다.") private LocalDateTime createdAt; + @NotNull(message = "하이라이트 JobId는 필수입니다.") + private UUID jobId; } diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java b/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java index 5bef3820..6557b6b3 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/entity/HighlightEntity.java @@ -4,10 +4,7 @@ import com.midas.shootpointer.domain.member.entity.Member; import com.midas.shootpointer.global.entity.BaseEntity; import jakarta.persistence.*; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; +import lombok.*; import lombok.extern.slf4j.Slf4j; import org.hibernate.annotations.UuidGenerator; diff --git a/src/main/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactory.java b/src/main/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactory.java index 95ddf587..ad8ea67e 100644 --- a/src/main/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactory.java +++ b/src/main/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactory.java @@ -21,7 +21,8 @@ public List createHighlightEntities(List highlig UUID key, Member member, BackNumberEntity backNumber, - LocalDateTime createAt + LocalDateTime createAt, + UUID jobId ){ return highlightInfos.stream() .map(info -> HighlightEntity.builder() @@ -32,6 +33,7 @@ public List createHighlightEntities(List highlig .threePointCount(info.threePointCount()) .backNumber(backNumber) .videoCreatedAt(createAt) + .jobId(jobId) .build()) .toList(); } diff --git a/src/test/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactoryTest.java b/src/test/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactoryTest.java index ee743ebe..701a4a94 100644 --- a/src/test/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactoryTest.java +++ b/src/test/java/com/midas/shootpointer/domain/highlight/mapper/HighlightFactoryTest.java @@ -49,8 +49,10 @@ void createHighlightEntities(){ .backNumber(BackNumber.of(10)) .build(); LocalDateTime now=LocalDateTime.now(); + UUID jobId=UUID.randomUUID(); + //when - List result=factory.createHighlightEntities(highlightInfos,highlightKey,member,backNumber,now); + List result=factory.createHighlightEntities(highlightInfos,highlightKey,member,backNumber,now,jobId); //then