-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/main/java/io/devlabs/keytree/domains/company/domain/Admin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.devlabs.keytree.domains.company.domain; | ||
|
||
import io.devlabs.keytree.commons.jpa.BaseTimeEntity; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.*; | ||
import org.hibernate.annotations.Comment; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Getter | ||
@Builder | ||
public class Admin extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Comment("관리자 아이디") | ||
private Long id; | ||
|
||
@Column | ||
@NotNull | ||
@Comment("이름") | ||
private String name; | ||
|
||
@Column | ||
@NotNull | ||
@Comment("이메일") | ||
private String email; | ||
|
||
@Column | ||
@NotNull | ||
@Comment("비밀번호") | ||
private String password; | ||
|
||
@Column | ||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
@Comment("관리자 권한") | ||
private UserRole userRole; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/io/devlabs/keytree/domains/company/domain/AdminRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.devlabs.keytree.domains.company.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface AdminRepository extends JpaRepository<Admin, Long> { | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/io/devlabs/keytree/domains/company/domain/Company.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.devlabs.keytree.domains.company.domain; | ||
|
||
import io.devlabs.keytree.commons.jpa.BaseTimeEntity; | ||
import jakarta.persistence.*; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.*; | ||
import org.hibernate.annotations.Comment; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Getter | ||
@Builder | ||
public class Company extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Comment("기업 아이디") | ||
private Long id; | ||
|
||
@Column | ||
@NotNull | ||
@Comment("기업 이름") | ||
private String name; | ||
|
||
@Column | ||
@NotNull | ||
@Comment("기업 연락처") | ||
private String phone; | ||
|
||
@Column | ||
@Comment("기업 주소") | ||
private String address; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/io/devlabs/keytree/domains/company/domain/CompanyRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.devlabs.keytree.domains.company.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface CompanyRepository extends JpaRepository<Company, Long> { | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/devlabs/keytree/domains/company/domain/UserRole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.devlabs.keytree.domains.company.domain; | ||
|
||
public enum UserRole { | ||
MASTER("MASTER"), | ||
ADMIN("ADMIN"), | ||
USER("USER"); | ||
|
||
private final String name; | ||
|
||
UserRole(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |