| |
---|
| | import com.fasterxml.jackson.annotation.JsonProperty; |
---|
| | import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
---|
| | import org.ntlab.acanthus_server.models.Gallery; |
---|
| | |
---|
| | import java.time.Duration; |
---|
| | import java.time.LocalDateTime; |
---|
| | import java.util.Calendar; |
---|
| | import java.util.Date; |
---|
| | import java.util.HashMap; |
---|
| | import java.util.UUID; |
---|
| | |
---|
| | @JsonInclude(JsonInclude.Include.NON_NULL) |
---|
| |
---|
| | @JsonIgnore |
---|
| | private String password; |
---|
| | @JsonIgnore |
---|
| | private boolean isDummy; |
---|
| | @JsonIgnore |
---|
| | private LocalDateTime lastAccess; |
---|
| | |
---|
| | |
---|
| | //----------------------------------------------------------------- |
---|
| | //コンストラクト |
---|
| | public Account() { |
---|
| |
---|
| | public String getToken() { |
---|
| | return (this.token); |
---|
| | } |
---|
| | |
---|
| | public boolean isCollectToken(String token){ |
---|
| | int timeoutThreshold = 1; |
---|
| | |
---|
| | var nowDateTime = LocalDateTime.now(); |
---|
| | if(lastAccess==null) lastAccess = nowDateTime; |
---|
| | |
---|
| | var duration = Duration.between(nowDateTime,lastAccess); |
---|
| | if(duration.toHours()>timeoutThreshold) return false; |
---|
| | |
---|
| | return token.equals(this.token); |
---|
| | } |
---|
| | |
---|
| | public HashMap<Integer, Work> getWorkHashMap() { |
---|
| | return this.workHashMap; |
---|
| | } |
---|
| | |
---|
| |
---|
| | this.name = "dummy"; |
---|
| | this.email = "d@dummy.com"; |
---|
| | this.password = "nittalab"; |
---|
| | this.token = "abc"; |
---|
| | this.lastAccess = LocalDateTime.of(2019, 12, 31, 0, 0, 0); |
---|
| | } |
---|
| | //----------------------------------------------------------------- |
---|
| | } |
---|
| | |
---|
| | |
No description provided.
確認しました.
f397931
intomaster
fromkuraoka_token
on 26 May 2021kuraoka_token
branch on 26 May 2021