Skip to content

Commit

Permalink
[feat] 수요조사 추가질문 테이블 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yj-leez committed Jan 11, 2024
1 parent c53e76a commit c556043
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/main/java/wowmarket/wow_server/domain/DemandAnswer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package wowmarket.wow_server.domain;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class DemandAnswer {

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

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "demand_question_id")
private DemandQuestion demandQuestion;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "demand_order_id")
private DemandOrder demandOrder;

private String answer;
}
3 changes: 3 additions & 0 deletions src/main/java/wowmarket/wow_server/domain/DemandProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public class DemandProject extends BaseEntity{
@Column(columnDefinition = "integer default 0", nullable = false)
private int likeCnt;

@Column(columnDefinition = "tinyint(0) default 1")
private boolean sellToAll; // 0-> 소속 대학 학생, 1-> 전체 학생

public void setUser(User user){ this.user = user;}
public void setCategory(Category category){
this.category = category;
Expand Down
27 changes: 27 additions & 0 deletions src/main/java/wowmarket/wow_server/domain/DemandQuestion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package wowmarket.wow_server.domain;

import jakarta.persistence.*;
import lombok.*;

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

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "demand_project_id")
@Setter
private DemandProject demandProject;

@Column(nullable = false)
private String question;

@Column(columnDefinition="tinyint(0) default 0")
private boolean essential;
}

0 comments on commit c556043

Please sign in to comment.