Skip to content

Commit

Permalink
EC2 배포 시 서버 시간 UTC -> KST로 설정 (#145)
Browse files Browse the repository at this point in the history
* [style] : 코드 리포멧팅

* [feat] : 배포 서버 타임존 UTC -> KST로 수정

* [feat] : KST 변경에 따른 dto 타임존 변경

* [feat] : ci.yml으로 github action 서버 시간 수정
  • Loading branch information
hyun2371 authored Mar 22, 2024
1 parent 424e2be commit eb5c966
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ permissions:
jobs:
build:
runs-on: ubuntu-latest
env:
TZ: 'Asia/Seoul'
steps:
- uses: actions/checkout@v3

- name: Check the timezone
run: date

# 자바 버전 설정
- name: Set up JDK 17
uses: actions/setup-java@v3
Expand Down
9 changes: 9 additions & 0 deletions api/src/main/java/dev/handsup/HandsUpApplication.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package dev.handsup;

import java.util.TimeZone;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

import jakarta.annotation.PostConstruct;

@EnableJpaAuditing
@SpringBootApplication
public class HandsUpApplication {

@PostConstruct
public void started() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
}

public static void main(String[] args) {
// 타 모듈 yml 가져오기
System.setProperty("spring.config.name", "application, application-core");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public record RegisterAuctionRequest(
int initPrice,

@NotNull(message = "endDate 은 필수입니다.")
@JsonFormat(pattern = "yyyy-MM-dd") //localDate 형식으로 받음
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Seoul") //localDate 형식으로 받음
LocalDate endDate,

@NotBlank(message = "productStatus 은 필수입니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import dev.handsup.auction.domain.Auction;
import dev.handsup.auction.domain.auction_field.AuctionStatus;
import dev.handsup.bidding.domain.Bidding;
import dev.handsup.user.domain.User;

public interface AuctionRepository extends JpaRepository<Auction, Long> {
Expand Down

0 comments on commit eb5c966

Please sign in to comment.