Skip to content

Commit bf97db4

Browse files
authored
feat: News 소식지 도메인 추가 (#302)
* feat: News 소식지 도메인 추가 BaseEntity를 상속한 이유는 이후에 유저도 소식지를 쓸 수 있게 되면 필요할 것이라 추정되기에 * chore: import 수정 * feat: 뉴스 테이블 생성 Flyway 스키마 추가 * chore: Flyway 파일 포매팅
1 parent 75d5d24 commit bf97db4

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

README.md

-40 Bytes

개발 환경

  • Java 17
  • 개발 환경 docker compose 실행
    • docker compose -f docker-compose.local.yml up -d
    • ./local_compose_up.sh

컨벤션

⚠️ 주의 !
이 컨벤션은 2024년 7월 지원까지의 코드에 해당합니다.
이후의 규칙은 자유롭게 만들어가주세요.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.example.solidconnection.news.domain;
2+
3+
import com.example.solidconnection.entity.common.BaseEntity;
4+
import jakarta.persistence.Column;
5+
import jakarta.persistence.Entity;
6+
import jakarta.persistence.GeneratedValue;
7+
import jakarta.persistence.GenerationType;
8+
import jakarta.persistence.Id;
9+
import lombok.EqualsAndHashCode;
10+
import lombok.Getter;
11+
import lombok.NoArgsConstructor;
12+
13+
@Getter
14+
@Entity
15+
@NoArgsConstructor
16+
@EqualsAndHashCode
17+
public class News extends BaseEntity {
18+
19+
@Id
20+
@GeneratedValue(strategy = GenerationType.IDENTITY)
21+
private Long id;
22+
23+
private String title;
24+
25+
private String description;
26+
27+
@Column(length = 500)
28+
private String thumbnailUrl;
29+
30+
@Column(length = 500)
31+
private String url;
32+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CREATE TABLE news (
2+
created_at datetime(6),
3+
id bigint not null auto_increment,
4+
updated_at datetime(6),
5+
thumbnail_url varchar(500),
6+
url varchar(500),
7+
description varchar(255),
8+
title varchar(255),
9+
primary key (id)
10+
)

0 commit comments

Comments
 (0)