Skip to content

Commit

Permalink
Merge pull request #30 from Career-Festival/feature/record
Browse files Browse the repository at this point in the history
[Refactor] 강연/세미나 기록장 리팩토링
  • Loading branch information
oznchex authored Jan 18, 2024
2 parents f6de147 + eddf08c commit d905ae4
Show file tree
Hide file tree
Showing 35 changed files with 239 additions and 319 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import careerfestival.career.comments.dto.CommentRequestDto;
import careerfestival.career.comments.dto.CommentResponseDto;
import careerfestival.career.domain.Comment;
import careerfestival.career.domain.mapping.Comment;
import careerfestival.career.domain.Event;
import careerfestival.career.domain.User;
import careerfestival.career.repository.CommentRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package careerfestival.career.comments.dto;

import careerfestival.career.domain.Comment;
import careerfestival.career.domain.mapping.Comment;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package careerfestival.career.comments.dto;

import careerfestival.career.domain.Comment;
import careerfestival.career.domain.mapping.Comment;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand Down
33 changes: 0 additions & 33 deletions src/main/java/careerfestival/career/domain/Category.java

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/java/careerfestival/career/domain/Comment.java

This file was deleted.

33 changes: 14 additions & 19 deletions src/main/java/careerfestival/career/domain/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@


import careerfestival.career.domain.common.BaseEntity;
import careerfestival.career.domain.mapping.EventImage;
import careerfestival.career.domain.mapping.EventKeyword;
import careerfestival.career.domain.mapping.Participate;
import careerfestival.career.domain.enums.Category;
import careerfestival.career.domain.mapping.*;
import jakarta.persistence.*;
import lombok.*;

Expand All @@ -25,8 +24,6 @@ public class Event extends BaseEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;



// 모집 시작일 & 모집 종료일
@Column(nullable = false, name = "recruitment_start")
private LocalDateTime recruitmentStart;
Expand All @@ -46,32 +43,35 @@ public class Event extends BaseEntity {
private LocalDateTime eventStart;
@Column(nullable = false, name = "event_end")
private LocalDateTime eventEnd;
@Column(nullable = false, length = 300, name = "link")
@Column(length = 300, name = "link")
private String link;
@Column(nullable = false, length = 200, name = "event_content")
private String eventContent;

// 행사 정보이미지 들어가야함

@Column(nullable = false, length = 40, name = "event_cost")
private String eventCost;

//행사 주소
@Column(nullable = false, length = 40, name ="address")
private String address;
@Column(nullable = false, length = 40, name ="spec_address")
private String specAddress;



//checkpoint 주최자랑 연결?
//회원 id 연결 주최자와
@Column(nullable = false, length = 20, name = "manager_name")
private String managerName;
@Column(nullable = false, length = 20, name = "manager_email")
@Column(length = 20, name = "manager_email")
private String managerEmail;
@Column(columnDefinition = "INT")
@Column(columnDefinition = "INT DEFAULT 0")
private int hits;


@ManyToOne(fetch = FetchType.LAZY)
@Enumerated(EnumType.STRING)
private Category category;

@Column(length = 300, name = "event_etc_detail")
private String eventEtcDetail;

@ManyToOne(fetch = FetchType.LAZY)
private Region region;

Expand All @@ -81,9 +81,6 @@ public class Event extends BaseEntity {
@OneToMany(mappedBy = "event", cascade = CascadeType.ALL)
private List<EventImage> eventImg = new ArrayList<>();

@OneToMany(mappedBy = "event", cascade = CascadeType.ALL)
private List<EventKeyword> eventKeyword = new ArrayList<>();

@OneToMany(mappedBy = "event", cascade = CascadeType.ALL)
private List<Comment> comment = new ArrayList<>();

Expand All @@ -92,6 +89,4 @@ public class Event extends BaseEntity {

@OneToMany(mappedBy = "event", cascade = CascadeType.ALL)
private List<Participate> participate = new ArrayList<>();


}
17 changes: 0 additions & 17 deletions src/main/java/careerfestival/career/domain/Gender.java

This file was deleted.

28 changes: 0 additions & 28 deletions src/main/java/careerfestival/career/domain/Host.java

This file was deleted.

16 changes: 7 additions & 9 deletions src/main/java/careerfestival/career/domain/Record.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package careerfestival.career.domain;

import careerfestival.career.domain.common.BaseEntity;
import careerfestival.career.domain.enums.Category;
import careerfestival.career.domain.enums.KeywordName;
import jakarta.persistence.*;
import lombok.*;

import java.time.LocalDateTime;
import careerfestival.career.domain.mapping.RecordKeyword;
import java.util.ArrayList;
import java.time.LocalDate;
import java.util.List;

@Entity
Expand All @@ -23,20 +23,18 @@ public class Record extends BaseEntity {
@Column(nullable = false, length = 20, name = "event_name")
private String eventName;
@Column(nullable = false, name = "event_date")
private LocalDateTime eventDate;

private LocalDate eventDate;
@Column(nullable = false, length = 300, name = "event_description")
private String eventDescription;
@Column(length = 300, name = "networking_name")
private String networkingName;
@Column(length = 300, name = "networking_contact")
private String networkingContact;
@Column(length = 300, name = "record_etc_detail")
private String recordEtcDetail;

@OneToMany(mappedBy = "record", cascade = CascadeType.ALL)
private List<RecordKeyword> recordKeywords = new ArrayList<>();

@ManyToOne(fetch = FetchType.LAZY)
private Category category;
private List<KeywordName> keywordName;

@ManyToOne(fetch = FetchType.LAZY)
private User user;
Expand Down
58 changes: 34 additions & 24 deletions src/main/java/careerfestival/career/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import careerfestival.career.domain.enums.Gender;
import careerfestival.career.domain.enums.Role;
import careerfestival.career.domain.enums.UserStatus;
import careerfestival.career.domain.mapping.Comment;
import careerfestival.career.domain.mapping.Follow;
import careerfestival.career.domain.mapping.Participate;
import careerfestival.career.domain.mapping.RecordKeyword;
import careerfestival.career.domain.mapping.UserKeyword;
import careerfestival.career.domain.mapping.Wish;
import jakarta.persistence.*;
import lombok.*;

Expand All @@ -21,54 +22,63 @@
@Builder
public class User extends BaseEntity {

// 회원가입 1 화면
// 회원가입 1, 2 화면
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false, length = 300, name = "email")
private String email;

@Column(nullable = false, length = 300, name = "password")
private String password;

@Column(nullable = false, length = 20, name = "name")
private String name;

@Column(nullable = false, length = 200, name = "phone_number")
private String phoneNumber;

// status와 inacticedate는 회원 탈퇴, 게시글 삭제 시 필요 기능
@Enumerated(EnumType.STRING)
@Column(columnDefinition = "VARCHAR(15) DEFAULT 'ACTIVE'")
private UserStatus status;
@Column(nullable = false, length = 300, name = "password")
private String password;

private Timestamp inactiveDate;
// status와 inactivedate는 회원 탈퇴, 게시글 삭제 시 필요 기능
@Enumerated(EnumType.STRING)
@Column(columnDefinition = "VARCHAR(15) DEFAULT 'ACTIVE'")
private UserStatus userStatus;
@Column(nullable = false, length = 300, name = "email")
private String email;

// 회원가입 2 화면
@Enumerated(EnumType.STRING)
private Role role;

// 전화번호는 회원가입 3 화면에서 저장되는 값이기 때문에 nullable이면 insert 과정에서 오류 발생 -> null 허용으로 수정함
@Column(length = 200, name = "phone_number")
private String phoneNumber;

// 회원가입 3 화면 (대략 6가지)
@Enumerated(EnumType.STRING)
private Gender gender;

@Column(columnDefinition = "INT")
private int age;

/*
------------관심 지역 들어갈 자리----------------
*/

// 소속(회사/기관/학교명)
@Column(length = 20, name = "company")
private String company;

// 부서 및 학과
@Column(length = 20, name = "department")
private String department;

// 직급
@Column(length = 20, name = "position")
private String position;

/*
----------위에는 회원가입에 직접 사용되는 값들----------------
*/


private Timestamp inactiveDate;

// status와 inactivedate는 회원 탈퇴, 게시글 삭제 시 필요 기능
@Enumerated(EnumType.STRING)
@Column(columnDefinition = "VARCHAR(15) DEFAULT 'ACTIVE'")
private UserStatus userStatus;

@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<Comment> comment = new ArrayList<>();
Expand All @@ -77,7 +87,7 @@ public class User extends BaseEntity {
private List<Event> event = new ArrayList<>();

@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<UserKeyword> userKeyWord = new ArrayList<>();
private List<Record> record = new ArrayList<>();

@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<Wish> wish = new ArrayList<>();
Expand All @@ -86,7 +96,7 @@ public class User extends BaseEntity {
private List<Participate> participate = new ArrayList<>();

@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<Host> host = new ArrayList<>();
private List<Comment.Organizer> organizer = new ArrayList<>();

@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<Follow> follow = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package careerfestival.career.domain.enums;

public enum Category {
강연세미나, 학술대회,
전시박람회, 기타
}
Loading

0 comments on commit d905ae4

Please sign in to comment.