Skip to content

Commit

Permalink
FLASH-164 fix: solution의 problemId 타입 UUID로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoiWonYu committed Jul 16, 2024
1 parent db3ba8a commit da86f91
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import com.first.flash.climbing.solution.domain.dto.SolutionCreateRequestDto;
import com.first.flash.climbing.solution.domain.vo.SolutionDetail;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -23,18 +25,19 @@ public class Solution {
private Long id;
SolutionDetail solutionDetail;
private Long optionalWeight;
private Long problemId;
@Column(columnDefinition = "BINARY(16)")
private UUID problemId;

protected Solution(final String uploader, final String review, final String instagramId,
final String videoUrl, final Long problemId) {
final String videoUrl, final UUID problemId) {

this.solutionDetail = SolutionDetail.of(uploader, review, instagramId, videoUrl);
this.optionalWeight = DEFAULT_OPTIONAL_WEIGHT;
this.problemId = problemId;
}

public static Solution of(final SolutionCreateRequestDto createRequestDto,
final Long problemId) {
final UUID problemId) {

return new Solution(createRequestDto.uploader(), createRequestDto.review(),
createRequestDto.instagramId(), createRequestDto.videoUrl(), problemId);
Expand Down

0 comments on commit da86f91

Please sign in to comment.