Skip to content

Commit

Permalink
Merge branch 'entity' of https://github.com/FOR-GRAD/For-Grad-Server
Browse files Browse the repository at this point in the history
…into entity
  • Loading branch information
dlguszoo committed Jan 17, 2024
2 parents 08deec6 + 2f5e535 commit 99978cb
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/main/java/umc/forgrad/domain/Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package umc.forgrad.domain;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import umc.forgrad.domain.common.BaseEntity;
import umc.forgrad.domain.enums.Category;

import java.time.LocalDate;

@Builder
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Getter
public class Activity extends BaseEntity {

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


private String title;

private String content;

private String prize;

@NotNull
private LocalDate startDate;

@NotNull
private LocalDate endDate;

@Enumerated(EnumType.STRING)
private Category category; //CERTIFICATIONS, COMPETITIONS, VOLUNTEERS, AWARDS;


}
31 changes: 31 additions & 0 deletions src/main/java/umc/forgrad/domain/ActivityFile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package umc.forgrad.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Getter
public class ActivityFile {

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


@NotNull
private String fileUrl;

private String fileName;


}
6 changes: 6 additions & 0 deletions src/main/java/umc/forgrad/domain/enums/Category.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package umc.forgrad.domain.enums;

public enum Category {

CERTIFICATIONS, COMPETITIONS, VOLUNTEERS, AWARDS;
}

0 comments on commit 99978cb

Please sign in to comment.