Skip to content

Commit c1a8d4f

Browse files
authored
fix: 컬럼 postDate로 변경 (#119)
1 parent 1214d71 commit c1a8d4f

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

src/main/java/org/myteam/server/inquiry/repository/InquiryQueryRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ private OrderSpecifier<?> getOrderSpecifier(InquiryOrderType orderType, QInquiry
6565
if (orderType == InquiryOrderType.ANSWERED) {
6666
return inquiryAnswer.answeredAt.desc().nullsLast();
6767
}
68-
return inquiry.createdAt.desc();
68+
return inquiry.createdAt.asc();
6969
}
7070
}

src/main/java/org/myteam/server/news/news/domain/News.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public class News extends Base {
3434

3535
private String thumbImg;
3636

37-
private LocalDateTime postTime;
37+
private LocalDateTime postDate;
3838

3939
@Builder
40-
public News(Long id, NewsCategory category, String title, String thumbImg, LocalDateTime postTime) {
40+
public News(Long id, NewsCategory category, String title, String thumbImg, LocalDateTime postDate) {
4141
this.id = id;
4242
this.category = category;
4343
this.title = title;
4444
this.thumbImg = thumbImg;
45-
this.postTime = postTime;
45+
this.postDate = postDate;
4646
}
4747
}

src/main/java/org/myteam/server/news/news/dto/repository/NewsDto.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ public class NewsDto {
1414
private NewsCategory category;
1515
private String title;
1616
private String thumbImg;
17-
private LocalDateTime postTime;
17+
private LocalDateTime postDate;
1818

19-
public NewsDto(Long id, NewsCategory category, String title, String thumbImg, LocalDateTime postTime) {
19+
public NewsDto(Long id, NewsCategory category, String title, String thumbImg, LocalDateTime postDate) {
2020
this.id = id;
2121
this.category = category;
2222
this.title = title;
2323
this.thumbImg = thumbImg;
24-
this.postTime = postTime;
24+
this.postDate = postDate;
2525
}
2626
}

src/main/java/org/myteam/server/news/news/dto/service/response/NewsResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ public class NewsResponse {
2828

2929
private int viewCount;
3030

31-
private LocalDateTime postTime;
31+
private LocalDateTime postDate;
3232

3333
@Builder
3434
public NewsResponse(Long id, NewsCategory category, String title, String thumbImg, int recommendCount,
3535
int commentCount,
36-
int viewCount, LocalDateTime postTime) {
36+
int viewCount, LocalDateTime postDate) {
3737
this.id = id;
3838
this.category = category;
3939
this.title = title;
4040
this.thumbImg = thumbImg;
4141
this.recommendCount = recommendCount;
4242
this.commentCount = commentCount;
4343
this.viewCount = viewCount;
44-
this.postTime = postTime;
44+
this.postDate = postDate;
4545
}
4646

4747

@@ -60,7 +60,7 @@ public static NewsResponse createResponse(News news, NewsCount newsCount) {
6060
.category(news.getCategory())
6161
.title(news.getTitle())
6262
.thumbImg(news.getThumbImg())
63-
.postTime(news.getPostTime())
63+
.postDate(news.getPostDate())
6464
.recommendCount(newsCount.getRecommendCount())
6565
.commentCount(newsCount.getCommentCount())
6666
.viewCount(newsCount.getViewCount())

src/main/java/org/myteam/server/news/news/repository/NewsQueryRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public Page<NewsDto> getNewsList(NewsServiceRequest newsServiceRequest) {
3939
news.category,
4040
news.title,
4141
news.thumbImg,
42-
news.postTime
42+
news.postDate
4343
))
4444
.from(news)
4545
.join(newsCount).on(newsCount.news.id.eq(news.id))

src/main/resources/application-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spring:
1616
hibernate:
1717
naming:
1818
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
19-
ddl-auto: create-drop
19+
ddl-auto: none
2020
# create 기존테이블을 삭제하고 다시 생성
2121
# create-drop 기존테이블을 삭제하고 다시생성. 종료 시점에 테이블삭제
2222
# update 변경된 스키마 적용 (운영 DB 에서 사용X)
@@ -47,4 +47,4 @@ minio:
4747
access-key: ${MINIO_ACCESS_KEY}
4848
secret-key: ${MINIO_SECRET_KEY}
4949
region: ${MINIO_REGION}
50-
bucket: ${MINIO_BUCKET}
50+
bucket: ${MINIO_BUCKET}

src/test/java/org/myteam/server/IntegrationTestSupport.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.myteam.server.member.domain.MemberStatus;
1111
import org.myteam.server.member.domain.MemberType;
1212
import org.myteam.server.member.entity.Member;
13+
import org.myteam.server.member.repository.MemberActivityRepository;
1314
import org.myteam.server.member.repository.MemberJpaRepository;
1415
import org.myteam.server.member.service.SecurityReadService;
1516
import org.myteam.server.news.news.domain.News;
@@ -34,6 +35,7 @@
3435
import org.testcontainers.containers.MinIOContainer;
3536
import org.testcontainers.containers.MySQLContainer;
3637

38+
import software.amazon.awssdk.services.s3.S3Client;
3739
import software.amazon.awssdk.services.s3.presigner.S3Presigner;
3840

3941
@ActiveProfiles("test")
@@ -51,6 +53,8 @@ public abstract class IntegrationTestSupport {
5153
@Autowired
5254
protected MemberJpaRepository memberJpaRepository;
5355
@Autowired
56+
protected MemberActivityRepository memberActivityRepository;
57+
@Autowired
5458
protected NewsCountMemberRepository newsCountMemberRepository;
5559
@Autowired
5660
protected InquiryRepository inquiryRepository;
@@ -60,6 +64,8 @@ public abstract class IntegrationTestSupport {
6064
protected S3ConfigLocal s3ConfigLocal;
6165
@MockBean
6266
protected S3Presigner s3Presigner;
67+
@MockBean
68+
protected S3Client s3Client;
6369

6470
@AfterEach
6571
void tearDown() {
@@ -69,6 +75,7 @@ void tearDown() {
6975
newsCountMemberRepository.deleteAllInBatch();
7076
newsCountRepository.deleteAllInBatch();
7177
newsRepository.deleteAllInBatch();
78+
memberActivityRepository.deleteAllInBatch();
7279
memberJpaRepository.deleteAllInBatch();
7380
}
7481

0 commit comments

Comments
 (0)