Skip to content

Commit

Permalink
Merge pull request #16 from Kusitms-28th-Meetup-D/feature/15-user
Browse files Browse the repository at this point in the history
Feature/15 user
  • Loading branch information
emilywin825 authored Oct 30, 2023
2 parents 1715b3f + c7cc87b commit 626a23a
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 1 deletion.
30 changes: 30 additions & 0 deletions src/main/java/com/kusithm/meetupd/domain/grade/entity/Grade.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.kusithm.meetupd.domain.grade.entity;

import com.kusithm.meetupd.common.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;

import java.sql.Timestamp;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
@Entity(name = "GRADE")
public class Grade extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "grade_id")
private Long id;

@Column(name = "type", nullable = false)
private TYPE userType;

@Column(name = "buy_time", nullable = false)
private Timestamp buyTime;

@Column(name = "end_time", nullable = false)
private Timestamp endTime;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.kusithm.meetupd.domain.grade.entity;

public enum TYPE {

FREE, PAID
}
21 changes: 21 additions & 0 deletions src/main/java/com/kusithm/meetupd/domain/user/entity/Carrer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.kusithm.meetupd.domain.user.entity;

import com.kusithm.meetupd.common.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
@Entity(name = "USER_CARRER")
public class Carrer extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "carrer_id")
private Long id;

@Column(name = "carrer", nullable = false)
private String carrer;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.kusithm.meetupd.domain.user.entity;

public enum GENDER {
M,F,ETC
}
20 changes: 20 additions & 0 deletions src/main/java/com/kusithm/meetupd/domain/user/entity/Major.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.kusithm.meetupd.domain.user.entity;

import com.kusithm.meetupd.common.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
@Entity(name = "USER_MAJOR")
public class Major extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "major_id")
private Long id;

@Column(name = "major", nullable = false)
private String major;
}
20 changes: 20 additions & 0 deletions src/main/java/com/kusithm/meetupd/domain/user/entity/Skill.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.kusithm.meetupd.domain.user.entity;

import com.kusithm.meetupd.common.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
@Entity(name = "USER_SKILL")
public class Skill extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "skill_id")
private Long id;

@Column(name = "skill", nullable = false)
private String skill;
}
20 changes: 20 additions & 0 deletions src/main/java/com/kusithm/meetupd/domain/user/entity/Task.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.kusithm.meetupd.domain.user.entity;

import com.kusithm.meetupd.common.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
@Entity(name = "USER_TASK")
public class Task extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "task_id")
private Long id;

@Column(name = "task", nullable = false)
private String task;
}
11 changes: 10 additions & 1 deletion src/main/java/com/kusithm/meetupd/domain/user/entity/User.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package com.kusithm.meetupd.domain.user.entity;

import com.kusithm.meetupd.common.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;

import java.util.Date;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
@Builder
@Entity(name = "WANTEAM_USER")
public class User {
public class User extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand All @@ -30,6 +33,12 @@ public class User {
@Column(name = "profile_image", nullable = true)
private String profileImage;

@Column(name = "birth_day", nullable = false)
private Date birth_day;

@Column(name = "gender", nullable = false)
private GENDER gender;


public static User createUser(Long kakaoId, String username, Integer age, String email) {
User user = User.builder()
Expand Down

0 comments on commit 626a23a

Please sign in to comment.