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

feat: 번쩍 관련 객체 정의 #508

Merged
merged 11 commits into from
Jan 15, 2025
mikekks marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package org.sopt.makers.crew.main.entity.lightning;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import org.hibernate.annotations.Type;
import org.sopt.makers.crew.main.entity.common.BaseTimeEntity;
import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO;

import io.hypersistence.utils.hibernate.type.json.JsonBinaryType;
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 jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "lightning")
public class Lightning extends BaseTimeEntity {
mikekks marked this conversation as resolved.
Show resolved Hide resolved
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;

@NotNull
mikekks marked this conversation as resolved.
Show resolved Hide resolved
@Column(name = "leaderUserId")
private Integer leaderUserId;
mikekks marked this conversation as resolved.
Show resolved Hide resolved

@NotNull
@Size(min = 1, max = 30)
@Column(name = "title")
private String title;
mikekks marked this conversation as resolved.
Show resolved Hide resolved

@Column(name = "desc", columnDefinition = "TEXT")
private String desc;

@Column(name = "activityStartDate")
@NotNull
private LocalDate activityStartDate;

@Column(name = "activityEndDate")
@NotNull
private LocalDateTime activityEndDate;

@Column(name = "lightningTime")
private LocalDateTime lightningTime;

@Column(name = "lightningPlaceType")
@NotNull
@Enumerated(EnumType.STRING)
private LightningPlaceType lightningPlaceType;

@Column(name = "lightningPlace")
@NotNull
private String lightningPlace;

@Column(name = "minimumCapacity")
private int minimumCapacity;

@Column(name = "maximumCapacity")
private int maximumCapacity;

@Column(name = "imageURL", columnDefinition = "jsonb")
@Type(JsonBinaryType.class)
private List<ImageUrlVO> imageURL;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.sopt.makers.crew.main.entity.lightning;

public enum LightningPlaceType {
OFFLINE,
ONLINE,
NOT_DECIDED
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.time.LocalDateTime;
import java.util.List;

import jakarta.validation.constraints.Size;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
Expand Down Expand Up @@ -78,6 +79,7 @@ public class Meeting extends BaseTimeEntity {
*/
@Column(name = "imageURL", columnDefinition = "jsonb")
@Type(JsonBinaryType.class)
@Size(min = 1, max = 6)
mikekks marked this conversation as resolved.
Show resolved Hide resolved
private List<ImageUrlVO> imageURL;

/**
Expand Down
47 changes: 47 additions & 0 deletions main/src/main/java/org/sopt/makers/crew/main/entity/tag/Tag.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.sopt.makers.crew.main.entity.tag;

import org.sopt.makers.crew.main.entity.common.BaseTimeEntity;

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 jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "tag")
public class Tag extends BaseTimeEntity {
mikekks marked this conversation as resolved.
Show resolved Hide resolved

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

/**
* @implSpec : 모임태그 or 번쩍태그 구분
* @implNote : 모임태그일 경우, lightningId == null
* @implNote : 번쩍태그일 경우, meetingId == null
* */
@Enumerated(EnumType.STRING)
@Column(name = "tagType")
@NotNull
private TagType tagType;

@Column(name = "meetingId")
private Integer meetingId;

@Column(name = "lightningId")
private Integer lightningId;

@NotNull
private String content;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.sopt.makers.crew.main.entity.tag;

public enum TagType {
mikekks marked this conversation as resolved.
Show resolved Hide resolved
MEETING,
LIGHTING
}
Loading