Skip to content

Commit

Permalink
Feat : 알림 도메인 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
MINJU-KIMmm committed Sep 21, 2022
1 parent fb3eaf9 commit 9047fde
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/main/java/com/steady/steadyback/domain/Alarm.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.steady.steadyback.domain;

import com.sun.istack.NotNull;
import lombok.Builder;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Entity
@NoArgsConstructor
@Table(name = "alarm")
public class Alarm {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@NotNull
@ManyToOne
@JoinColumn(name = "user_id")
private User user;

@NotNull
@Column(name = "read_flag")
private Boolean readFlag;

@NotNull
@Column(length = 100)
private String message;

@NotNull
@Column
private Integer type;

@Builder
public Alarm(User user, Boolean readFlag, String message, Integer type) {
this.user = user;
this.readFlag = readFlag;
this.message = message;
this.type = type;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.steady.steadyback.domain;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface AlarmRepository extends JpaRepository<Alarm, Long> {
}

0 comments on commit 9047fde

Please sign in to comment.