-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
방 추가 상태 기능 구현 #43
방 추가 상태 기능 구현 #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많았어
@@ -17,121 +17,118 @@ class StatusTest { | |||
|
|||
private static final ZoneId TIME_ZONE = ZoneId.of("UTC"); | |||
private static final Clock roomCreatedTime = Clock.fixed(Instant.parse("2024-01-01T00:00:00.000000Z"), TIME_ZONE); | |||
private static final Clock dayIntroEndTime = Clock.fixed(Instant.parse("2024-01-01T00:00:02.000000Z"), TIME_ZONE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Getter
@RequiredArgsConstructor
public abstract class Status {
protected final Timestamp startTime;
protected final Timestamp endTime;
}
생각해보면 프론트에서 2024-01-01T00:00:02.000000Z
이런 날짜가 필요한게아닌거같아서 Timestamp 말고 long 형식에
unix timestamp 사용하면 계산하기도 편할거같은데 어떻게 생각?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 잘모르는 거긴한데 한번 공부해보고 올께
@@ -7,9 +7,9 @@ | |||
|
|||
public class EndStatus extends Status { | |||
|
|||
public static final Long UNIT = 60000L; | |||
public static final Long UNIT = 59999L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네이밍 1M 이나 1MINUTE 이 보기편할꺼같은데 어떰
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단위로 생각해서 UNIT으로 하긴 했는데 시간을 의미하는게 들어가는게 좋긴하겠네 근데 1M이나 1MINUTE으로 안한건 뭔가 그 상태에서 쓰이는 단위시간의 의미로 넣은거라 단위의 의미가 들어갔음 좋겠는데;;;
@@ -23,7 +23,8 @@ public String create( | |||
while (rooms.containsKey(code)) { | |||
code = CodeGenerator.generate(); | |||
} | |||
rooms.put(code, Room.create(roomInfo, Clock.systemDefaultZone())); | |||
final Long now = Clock.systemUTC().millis(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API 바뀌는거라 프론트랑 이야기 해야할거같긴한데
이게 밀리세컨드 기준으로 사용하냐 초단위로 사용하냐에따라서 길이가 달라져서 초단위로 사용할꺼면
Instant.now().getEpochSecond()
이거 써야하긴한데 일단 OK
#42
순서
WAIT (600초)
DAY_INTRO (3초)
NOTICE (3초)
DAY (플레이어 * 20초)
VOTE (10초)
VOTE_RESULT (3초) | END (60초)
NIGHT_INTOR (3초)
NIGHT (40초)
WAIT (600초) | END (60초)
로 구현함