Skip to content

Commit

Permalink
refactor: 과제 제출 결과와 실패 사유를 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 committed Aug 6, 2024
1 parent 9f999bc commit 660a7e9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public class AssignmentHistory extends BaseEntity {
private Long contentLength;

@Enumerated(EnumType.STRING)
private AssignmentSubmissionStatus status;
private AssignmentSubmissionStatus submissionStatus;

@Enumerated(EnumType.STRING)
private SubmissionFailureType submissionFailureType;

@Builder(access = AccessLevel.PRIVATE)
private AssignmentHistory(
Expand All @@ -52,29 +55,24 @@ private AssignmentHistory(
String submissionLink,
String commitHash,
Long contentLength,
AssignmentSubmissionStatus status) {
AssignmentSubmissionStatus submissionStatus) {
this.studyDetail = studyDetail;
this.member = member;
this.submissionLink = submissionLink;
this.commitHash = commitHash;
this.contentLength = contentLength;
this.status = status;
this.submissionStatus = submissionStatus;
}

public static AssignmentHistory create(
StudyDetail studyDetail,
Member member,
String submissionLink,
String commitHash,
Long contentLength,
AssignmentSubmissionStatus status) {
StudyDetail studyDetail, Member member, String submissionLink, String commitHash, Long contentLength) {
return AssignmentHistory.builder()
.studyDetail(studyDetail)
.member(member)
.submissionLink(submissionLink)
.commitHash(commitHash)
.contentLength(contentLength)
.status(status)
.submissionStatus(AssignmentSubmissionStatus.PENDING)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
@Getter
@RequiredArgsConstructor
public enum AssignmentSubmissionStatus {
NOT_SUBMITTED("미제출"),
WORD_COUNT_INSUFFICIENT("글자수 부족"),
LOCATION_UNIDENTIFIABLE("위치 확인불가"),
SUCCESS("제출 성공");
PENDING("제출 전"),
FAILURE("제출 실패"),
SUCCESS("제출 성공"),
CANCELLED("과제 휴강");

private final String value;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.gdschongik.gdsc.domain.study.domain;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum SubmissionFailureType {
NOT_SUBMITTED("미제출"),
WORD_COUNT_INSUFFICIENT("글자수 부족"),
LOCATION_UNIDENTIFIABLE("위치 확인불가");

private final String value;
}

0 comments on commit 660a7e9

Please sign in to comment.