Skip to content

Commit 33fb1de

Browse files
authored
Merge pull request #35 from prgrms-web-devcourse-final-project/feat/22-post
Feat/22 post : 포스트 기능 추가
2 parents 6d29d07 + d7f2c82 commit 33fb1de

File tree

22 files changed

+688
-6
lines changed

22 files changed

+688
-6
lines changed

backend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ out/
3939
### Custom ###
4040
db_dev.mv.db
4141
db_dev.trace.db
42+
src/main/resources/.env
4243
.env

backend/src/main/java/com/ai/lawyer/domain/community/controller/PostController.java

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.ai.lawyer.domain.poll.controller;
2+
3+
public class PollController {
4+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.ai.lawyer.domain.poll.dto;
2+
3+
import lombok.*;
4+
import java.time.LocalDateTime;
5+
6+
@Data
7+
@NoArgsConstructor
8+
@AllArgsConstructor
9+
@Builder(toBuilder = true)
10+
public class PollDto {
11+
private Long pollId;
12+
private Long postId;
13+
private String voteTitle;
14+
private PollStatus status;
15+
private LocalDateTime createdAt;
16+
private LocalDateTime closedAt;
17+
18+
public enum PollStatus {
19+
ONGOING, CLOSED
20+
}
21+
}
22+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.ai.lawyer.domain.poll.entity;
2+
3+
import com.ai.lawyer.domain.post.entity.Post;
4+
import jakarta.persistence.*;
5+
import lombok.*;
6+
7+
import java.time.LocalDateTime;
8+
9+
@Entity
10+
@Table(name = "poll")
11+
@Data
12+
@NoArgsConstructor
13+
@AllArgsConstructor
14+
@Builder
15+
public class Poll {
16+
17+
@Id
18+
@GeneratedValue(strategy = GenerationType.IDENTITY)
19+
@Column(name = "poll_id")
20+
private Long pollId;
21+
22+
@OneToOne(fetch = FetchType.LAZY)
23+
@JoinColumn(name = "post_id", nullable = true)
24+
private Post post;
25+
26+
@Column(length = 100, nullable = false, name = "vote_title")
27+
private String voteTitle;
28+
29+
@Enumerated(EnumType.STRING)
30+
@Column(length = 20, nullable = false, name = "status")
31+
private PollStatus status;
32+
33+
@Column(name = "created_at", nullable = false)
34+
private LocalDateTime createdAt;
35+
36+
@Column(name = "closed_at")
37+
private LocalDateTime closedAt;
38+
39+
// 투표 상태 Enum 타입
40+
public enum PollStatus {
41+
ONGOING, CLOSED
42+
}
43+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.ai.lawyer.domain.poll.entity;
2+
3+
public class PollOptions {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.ai.lawyer.domain.poll.entity;
2+
3+
public class PollStatics {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.ai.lawyer.domain.poll.entity;
2+
3+
public class PollVote {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.ai.lawyer.domain.poll.repository;
2+
3+
public class PollRepository {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.ai.lawyer.domain.poll.service;
2+
3+
public class PollService {
4+
}

0 commit comments

Comments
 (0)