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

[DEV-56] Vod Processing Job 생성 API 구현 #195

Merged
merged 32 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fcc2447
feat: VodProcessing Entity 정의
5uhwann Dec 2, 2024
1654763
feat: VodProcessingJobRepository 작성
5uhwann Dec 3, 2024
c812cb6
feat: VodProcessingJobService 구현
5uhwann Dec 3, 2024
1888173
feat: FacadeVodProcessingJobService - CreatePendingVodProcessingJob 구현
5uhwann Dec 4, 2024
4b54843
feat: VodProcessingJobController 구현
5uhwann Dec 4, 2024
c0223be
refactor: internal api 인증 생략
5uhwann Dec 4, 2024
9d8a634
chore: migration script 작성
5uhwann Dec 4, 2024
13489ce
Merge branch 'develop' into feat/DDING-56
5uhwann Dec 4, 2024
1a5fdc1
refactor: 도메인 서비스 네이밍 수정
5uhwann Dec 4, 2024
6bbfcce
refactor: jacoco 커버리지 측정 제외 패턴 추가
5uhwann Dec 4, 2024
3a4f0ac
refactor: VodProcessingJob 컬럼 수정
5uhwann Dec 7, 2024
664558f
refactor: presignedUrl - s3Key 생성 로직 수정
5uhwann Dec 7, 2024
04b1e0c
refactor: TODO 주석 작성
5uhwann Dec 7, 2024
27df89c
chore: migration script 수정
5uhwann Dec 7, 2024
8474a0b
refactor: VodProcessingJobController swagger 명세 제외
5uhwann Dec 7, 2024
dee57aa
refactor: jacoco 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
c2b9e04
refactor: jacoco 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
27ac98b
refactor: jacoco 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
6bef834
refactor: jacoco 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
a6cd14d
refactor: jacoco 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
b07a0cf
refactor: sonarcloud 측정 제외 패턴 수정
5uhwann Dec 7, 2024
d966e20
refactor: sonarcloud 측정 제외 패턴 수정
5uhwann Dec 7, 2024
507a8f5
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
e89aee7
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
e32445b
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
02c6ea1
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
59865e5
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
7595b8f
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
21fe8e5
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
c874a72
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
227efa9
refactor: sonarcloud 테스트 커버리지 측정 제외 패턴 수정
5uhwann Dec 7, 2024
01c039d
refactor: 코멘트 반영
5uhwann Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,28 +97,36 @@ sonar {
property "sonar.coverage.jacoco.xmlReportPaths", "${layout.buildDirectory}/reports/jacoco/test/jacocoTestReport.xml"
property "sonar.junit.reportPaths", "${layout.buildDirectory}/test-results/test"

property "sonar.exclusions", [
"**/ddingdong/ddingdongBE/common/**",
"**/ddingdong/ddingdongBE/*Request*",
"**/ddingdong/ddingdongBE/*Response*",
"**/ddingdong/ddingdongBE/*Command*",
"**/ddingdong/ddingdongBE/*Query*",
"**/ddingdong/ddingdongBE/*Dto*"
].join(',')
property "sonar.exclusions", """
**/ddingdong/ddingdongBE/common/**,
"""
}

property "sonar.coverage.exclusions", [
"**/ddingdong/ddingdongBE/common/**",
"**/ddingdong/ddingdongBE/**/**Request**",
"**/ddingdong/ddingdongBE/**/**Response**",
"**/ddingdong/ddingdongBE/**/**Command**",
"**/ddingdong/ddingdongBE/**/**Query**",
"**/ddingdong/ddingdongBE/**/**Dto**",
"**/ddingdong/ddingdongBE/**/**Controller**",
"**/ddingdong/ddingdongBE/**/General*Service.class"
].join(',')
}

jacocoTestReport {
dependsOn test
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"ddingdong/ddingdongBE/common/**",
"ddingdong/ddingdongBE/*Request*",
"ddingdong/ddingdongBE/*Response*",
"ddingdong/ddingdongBE/*Command*",
"ddingdong/ddingdongBE/*Query*",
"ddingdong/ddingdongBE/*Dto*"
"**/ddingdong/ddingdongBE/common/**",
"**/ddingdong/ddingdongBE/**/**Request**",
"**/ddingdong/ddingdongBE/**/**Response**",
"**/ddingdong/ddingdongBE/**/**Command**",
"**/ddingdong/ddingdongBE/**/**Query**",
"**/ddingdong/ddingdongBE/**/**Dto**",
"**/ddingdong/ddingdongBE/**/**Controller**",
"**/ddingdong/ddingdongBE/**/General*Service.class"
])
}))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public SecurityFilterChain filterChain(HttpSecurity http, JwtAuthService authSer
API_PREFIX + "/banners/**",
API_PREFIX + "/documents/**",
API_PREFIX + "/questions/**",
API_PREFIX + "/feeds/**")
API_PREFIX + "/feeds/**",
API_PREFIX + "/internal/**")
Comment on lines +49 to +50
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

내부 API 엔드포인트에 대한 보안 강화 필요

내부 API 엔드포인트(/internal/**)에 대한 무제한 접근 허용은 잠재적인 보안 위험을 초래할 수 있습니다. 내부 API는 일반적으로 더 엄격한 접근 제어가 필요합니다.

다음과 같은 보안 강화 방안을 고려해 주세요:

  1. IP 화이트리스트 적용
  2. API 키 인증 추가
  3. 내부 네트워크 접근 제한

예시 구현:

- API_PREFIX + "/internal/**")
+ API_PREFIX + "/internal/**").hasIpAddress("trusted-ip-range")

또는 커스텀 필터를 통한 API 키 검증:

@Component
public class InternalApiAuthFilter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest request, 
            HttpServletResponse response, 
            FilterChain filterChain) throws ServletException, IOException {
        if (request.getRequestURI().contains("/internal/")) {
            String apiKey = request.getHeader("X-API-Key");
            if (!isValidApiKey(apiKey)) {
                response.sendError(HttpStatus.UNAUTHORIZED.value());
                return;
            }
        }
        filterChain.doFilter(request, response);
    }
}

💡 Codebase verification

내부 API 엔드포인트 보안 검증 완료

내부 API 엔드포인트의 사용이 적절하게 제한되어 있습니다:

  • /server/internal/trigger/vod-processing-job 엔드포인트만 내부 API로 사용되고 있으며, @Hidden 어노테이션으로 문서화에서 제외되어 있습니다.
  • SecurityConfig에서 /internal/** 경로에 대한 접근 제어가 permitAll()로 설정되어 있어, 보안 강화가 필요할 수 있습니다.
🔗 Analysis chain

내부 API 엔드포인트 사용 현황 확인 필요

코드베이스 전체에서 내부 API 엔드포인트의 사용 패턴을 확인하여 일관된 보안 정책을 적용해야 합니다.


Let me gather more information about the internal endpoints and their security configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: 내부 API 엔드포인트 사용 패턴 확인

# 컨트롤러에서 내부 API 엔드포인트 매핑 검색
echo "컨트롤러의 내부 API 엔드포인트 매핑:"
rg -t java "@RequestMapping.*internal|@GetMapping.*internal|@PostMapping.*internal|@PutMapping.*internal|@DeleteMapping.*internal"

# 보안 관련 설정 파일 검색
echo "\n보안 설정 파일:"
fd -e java -e yml -e properties | rg -i "security|auth"

Length of output: 1221


Script:

#!/bin/bash
# Check SecurityConfig implementation for internal endpoints
echo "SecurityConfig implementation:"
ast-grep --pattern 'class SecurityConfig {
  $$$
}'

# Check for any internal API controllers
echo -e "\nInternal API Controllers:"
fd -e java | xargs rg "class.*Internal.*Controller"

# Check for any internal-related paths or constants
echo -e "\nInternal API path constants:"
rg -t java "internal" -C 2

Length of output: 1610

.permitAll()
.requestMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-resources/**")
.permitAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor
public class DocumentServiceImpl implements DocumentService {
public class GeneralDocumentService implements DocumentService {

private final DocumentRepository documentRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@
@Transactional(readOnly = true)
public class FacadeFeedService {

private final FeedService feedService;
private final GeneralFeedService generalFeedService;
private final FileInformationService fileInformationService;

public List<FeedListQuery> getAllByClubId(Long clubId) {
List<Feed> feeds = feedService.getAllByClubId(clubId);
List<Feed> feeds = generalFeedService.getAllByClubId(clubId);
return feeds.stream()
.map(FeedListQuery::from)
.toList();
}

public List<FeedListQuery> getNewestAll() {
List<Feed> feeds = feedService.getNewestAll();
List<Feed> feeds = generalFeedService.getNewestAll();
return feeds.stream()
.map(FeedListQuery::from)
.toList();
}

public FeedQuery getById(Long feedId) {
Feed feed = feedService.getById(feedId);
Feed feed = generalFeedService.getById(feedId);
ClubProfileQuery clubProfileQuery = extractClubInfo(feed.getClub());
return FeedQuery.of(feed, clubProfileQuery);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class FeedService {
public class GeneralFeedService {

private final FeedRepository feedRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor
public class FixZoneServiceImpl implements FixZoneService {
public class GeneralFixZoneService implements FixZoneService {

private final FixZoneRepository fixZoneRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@Transactional(readOnly = true)
public class FacadeAdminNoticeServiceImpl implements FacadeAdminNoticeService {

private final NoticeServiceImpl noticeService;
private final NoticeService noticeService;
private final FileMetaDataService fileMetaDataService;

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@Transactional(readOnly = true)
public class FacadeNoticeServiceImpl implements FacadeNoticeService {

private final NoticeServiceImpl noticeService;
private final NoticeService noticeService;
private final FileMetaDataService fileMetaDataService;
private final S3FileService s3FileService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class NoticeServiceImpl implements NoticeService {
public class GeneralNoticeService implements NoticeService {

public static final int NOTICE_COUNT_FOR_PAGE = 10;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package ddingdong.ddingdongBE.domain.vodprocessing.controller;

import ddingdong.ddingdongBE.domain.vodprocessing.controller.dto.request.CreatePendingVodProcessingJobRequest;
import ddingdong.ddingdongBE.domain.vodprocessing.service.FacadeVodProcessingJobService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@Hidden
@RestController("/server/internal/trigger/vod-processing-job")
5uhwann marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

url 매핑은 @RequestMapping에 해야 할 것 같습니다.
그리고 혹시 Api 인터페이스를 안만든 이유가 따로 있나요?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

해당 컨트롤러는 클라이언트에게 제공되는 API가 아니라 trigging을 위한 API 여서 따로 swagger 명세를 안하기 위해서 인터페이스를 명세하지 않았습니다.

@RequiredArgsConstructor
public class VodProcessingJobController {

private final FacadeVodProcessingJobService facadeVodProcessingJobService;

@PostMapping()
public void createPending(CreatePendingVodProcessingJobRequest request) {
facadeVodProcessingJobService.create(request.toCommand());
}
5uhwann marked this conversation as resolved.
Show resolved Hide resolved

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ddingdong.ddingdongBE.domain.vodprocessing.controller.dto.request;

import ddingdong.ddingdongBE.domain.vodprocessing.service.dto.command.CreatePendingVodProcessingJobCommand;

public record CreatePendingVodProcessingJobRequest(
String convertJobId,
String userId
) {
Comment on lines +5 to +8
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

요청 DTO에 유효성 검증이 필요합니다.

필드 유효성 검증을 위한 Jakarta Validation 어노테이션 추가가 필요합니다:

public record CreatePendingVodProcessingJobRequest(
        @NotBlank(message = "변환 작업 ID는 필수입니다")
        String convertJobId,
        
        @NotBlank(message = "사용자 ID는 필수입니다")
        String userId
) {


public CreatePendingVodProcessingJobCommand toCommand() {
return new CreatePendingVodProcessingJobCommand(convertJobId, userId);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ddingdong.ddingdongBE.domain.vodprocessing.entity;

public enum ConvertJobStatus {
PENDING
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package ddingdong.ddingdongBE.domain.vodprocessing.entity;

public enum VodNotificationStatus {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package ddingdong.ddingdongBE.domain.vodprocessing.entity;

import ddingdong.ddingdongBE.common.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToOne;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class VodProcessingJob extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "notification_id")
private VodProcessingNotification vodProcessingNotification;

@Column(nullable = false)
private String convertJobId;

@Column(nullable = false)
private String userId;

@Enumerated(EnumType.STRING)
private ConvertJobStatus convertJobStatus;
Comment on lines +32 to +39
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

상태 값 제약조건 추가 필요

convertJobStatus에 대한 기본값 설정이 누락되어 있습니다. 또한 userIdconvertJobId의 길이 제한도 추가하면 좋겠습니다.

@Column(nullable = false)
+@Size(max = 255)
private String convertJobId;

@Column(nullable = false)
+@Size(max = 255)
private String userId;

@Enumerated(EnumType.STRING)
+@Column(nullable = false)
+@Builder.Default
private ConvertJobStatus convertJobStatus = ConvertJobStatus.PENDING;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Column(nullable = false)
private String convertJobId;
@Column(nullable = false)
private String userId;
@Enumerated(EnumType.STRING)
private ConvertJobStatus convertJobStatus;
@Column(nullable = false)
@Size(max = 255)
private String convertJobId;
@Column(nullable = false)
@Size(max = 255)
private String userId;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
@Builder.Default
private ConvertJobStatus convertJobStatus = ConvertJobStatus.PENDING;


@Builder
private VodProcessingJob(Long id, VodProcessingNotification vodProcessingNotification, String convertJobId,
String userId, ConvertJobStatus convertJobStatus) {
this.id = id;
this.vodProcessingNotification = vodProcessingNotification;
this.convertJobId = convertJobId;
this.userId = userId;
this.convertJobStatus = convertJobStatus;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package ddingdong.ddingdongBE.domain.vodprocessing.entity;

import ddingdong.ddingdongBE.common.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class VodProcessingNotification extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private LocalDateTime expiredAt;

private LocalDateTime sentAt;

@Column(nullable = false)
private int retryCount;
5uhwann marked this conversation as resolved.
Show resolved Hide resolved

@Enumerated(EnumType.STRING)
@Column(name = "notification_status", nullable = false)
private VodNotificationStatus vodNotificationStatus;

}
5uhwann marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package ddingdong.ddingdongBE.domain.vodprocessing.repository;

import ddingdong.ddingdongBE.domain.vodprocessing.entity.VodProcessingJob;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface VodProcessingJobRepository extends JpaRepository<VodProcessingJob, Long> {

Optional<VodProcessingJob> findByConvertJobId(String convertJobId);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ddingdong.ddingdongBE.domain.vodprocessing.service;

import ddingdong.ddingdongBE.domain.vodprocessing.service.dto.command.CreatePendingVodProcessingJobCommand;

public interface FacadeVodProcessingJobService {

Long create(CreatePendingVodProcessingJobCommand command);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package ddingdong.ddingdongBE.domain.vodprocessing.service;

import ddingdong.ddingdongBE.domain.vodprocessing.service.dto.command.CreatePendingVodProcessingJobCommand;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true)
5uhwann marked this conversation as resolved.
Show resolved Hide resolved
@RequiredArgsConstructor
public class FacadeVodProcessingJobServiceImpl implements FacadeVodProcessingJobService {

private final VodProcessingJobService vodProcessingJobService;


@Override
public Long create(CreatePendingVodProcessingJobCommand command) {
return vodProcessingJobService.save(command.toPendingVodProcessingJob());
}
5uhwann marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package ddingdong.ddingdongBE.domain.vodprocessing.service;

import ddingdong.ddingdongBE.common.exception.PersistenceException.ResourceNotFound;
import ddingdong.ddingdongBE.domain.vodprocessing.entity.VodProcessingJob;
import ddingdong.ddingdongBE.domain.vodprocessing.repository.VodProcessingJobRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor
public class GeneralVodProcessingJobService implements VodProcessingJobService {

private final VodProcessingJobRepository vodProcessingJobRepository;

@Override
@Transactional
public Long save(VodProcessingJob vodProcessingJob) {
VodProcessingJob saveVodProcessingJob = vodProcessingJobRepository.save(vodProcessingJob);
return saveVodProcessingJob.getId();
}
5uhwann marked this conversation as resolved.
Show resolved Hide resolved

@Override
public VodProcessingJob getById(Long vodProcessingJobId) {
return vodProcessingJobRepository.findById(vodProcessingJobId)
.orElseThrow(() -> new ResourceNotFound(
"VodProcessingJob(vodProcessingJobId=" + vodProcessingJobId + ")를 찾을 수 없습니다."));
}

@Override
public VodProcessingJob getByConvertJobId(String convertJobId) {
return vodProcessingJobRepository.findByConvertJobId(convertJobId)
.orElseThrow(() -> new ResourceNotFound(
"VodProcessingJob(convertJobId=" + convertJobId + ")를 찾을 수 없습니다."));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package ddingdong.ddingdongBE.domain.vodprocessing.service;

import ddingdong.ddingdongBE.domain.vodprocessing.entity.VodProcessingJob;

public interface VodProcessingJobService {

Long save(VodProcessingJob vodProcessingJob);

VodProcessingJob getById(Long vodProcessingJobId);

VodProcessingJob getByConvertJobId(String convertJobId);

5uhwann marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ddingdong.ddingdongBE.domain.vodprocessing.service.dto.command;

import ddingdong.ddingdongBE.domain.vodprocessing.entity.ConvertJobStatus;
import ddingdong.ddingdongBE.domain.vodprocessing.entity.VodProcessingJob;

public record CreatePendingVodProcessingJobCommand(
String convertJobId,
String userId
) {

public VodProcessingJob toPendingVodProcessingJob() {
return VodProcessingJob.builder()
.convertJobId(convertJobId)
.userId(userId)
.convertJobStatus(ConvertJobStatus.PENDING)
.build();
}

}
Loading
Loading