Skip to content

Commit

Permalink
Merge pull request #62 from dongkyun0713/dongkyun
Browse files Browse the repository at this point in the history
level domain
  • Loading branch information
dongkyun0713 authored Feb 18, 2024
2 parents 18b235a + fe8f1ce commit 2ceaa3e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.example.titto_backend.level.domain;

import com.example.titto_backend.auth.domain.User;
import jakarta.persistence.*;

public class Experience {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@OneToOne(mappedBy = "experience")
private User user;

@Column(name = "total_experience")
private int totalExperience; // μ‚¬μš©μžμ˜ λˆ„μ  κ²½ν—˜μΉ˜

@Column(name = "current_experience")
private int currentExperience; // μ‚¬μš©μžμ˜ ν˜„μž¬ κ²½ν—˜μΉ˜

@Column(name = "required_experience")
private int requiredExperience;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.titto_backend.level.domain;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Entity
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class Level {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Enumerated(EnumType.STRING)
@Column(name = "level_type", unique = true)
private LevelType levelType;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example.titto_backend.level.domain;

public enum LevelType {
LEVEL1, LEVEL2, LEVEL3, LEVEL4, LEVEL5
}

0 comments on commit 2ceaa3e

Please sign in to comment.