-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into hot-flx/#439
- Loading branch information
Showing
29 changed files
with
358 additions
and
95 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
backend/src/main/java/com/festago/application/EntryCodeManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.festago.application; | ||
|
||
import com.festago.domain.EntryCode; | ||
import com.festago.domain.EntryCodeExtractor; | ||
import com.festago.domain.EntryCodePayload; | ||
import com.festago.domain.EntryCodeProvider; | ||
import java.util.Date; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class EntryCodeManager { | ||
|
||
private static final int MILLISECOND_FACTOR = 1_000; | ||
private static final int DEFAULT_PERIOD = 30; | ||
private static final int DEFAULT_OFFSET = 10; | ||
|
||
private final EntryCodeProvider entryCodeProvider; | ||
private final EntryCodeExtractor entryCodeExtractor; | ||
|
||
public EntryCodeManager(EntryCodeProvider entryCodeProvider, EntryCodeExtractor entryCodeExtractor) { | ||
this.entryCodeProvider = entryCodeProvider; | ||
this.entryCodeExtractor = entryCodeExtractor; | ||
} | ||
|
||
public EntryCode provide(EntryCodePayload entryCodePayload, long currentTimeMillis) { | ||
Date expiredAt = new Date(currentTimeMillis + (DEFAULT_PERIOD + DEFAULT_OFFSET) * MILLISECOND_FACTOR); | ||
String code = entryCodeProvider.provide(entryCodePayload, expiredAt); | ||
return new EntryCode(code, DEFAULT_PERIOD, DEFAULT_OFFSET); | ||
} | ||
|
||
public EntryCodePayload extract(String code) { | ||
return entryCodeExtractor.extract(code); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package com.festago.auth.dto; | ||
|
||
import com.festago.auth.domain.SocialType; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
public record LoginRequest(SocialType socialType, String accessToken) { | ||
public record LoginRequest( | ||
@NotNull(message = "socialType μ null μΌ μ μμ΅λλ€.") SocialType socialType, | ||
@NotNull(message = "acessToken μ null μΌ μ μμ΅λλ€.") String accessToken) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.