Skip to content

Commit

Permalink
jackson 新的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Oct 7, 2024
1 parent 8217ed8 commit 284f96c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
19 changes: 19 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,25 @@
<artifactId>methanol</artifactId>
<version>1.7.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jsr310 -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.18.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jdk8 -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.18.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-guava -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
<version>2.18.0</version>
</dependency>

</dependencies>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class AnalyseService {
@Scheduled(fixedDelayString = "${analyse.overdownload.interval}")
public void cronUntrustedIPAddresses() {
var list = ipMerger.merge(banHistoryRepository
.generateUntrustedIPAddresses(TimeUtil.toUTC(System.currentTimeMillis() - untrustedIpAddressGenerateOffset), new Timestamp(System.currentTimeMillis()), untrustedIpAddressGenerateThreshold)
.generateUntrustedIPAddresses(TimeUtil.toUTC(System.currentTimeMillis() - untrustedIpAddressGenerateOffset), OffsetDateTime.now(), untrustedIpAddressGenerateThreshold)
.stream()
.map(IPUtil::toString)
.collect(Collectors.toList()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.springframework.web.util.UriComponentsBuilder;

import java.io.IOException;
import java.sql.Timestamp;
import java.time.OffsetDateTime;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -127,15 +127,15 @@ private void userLogin(GithubUserProfile profile, String emailSelected) {
} else {
user = new User();
user.setEmail(emailSelected);
user.setRegisterAt(new Timestamp(System.currentTimeMillis()));
user.setRegisterAt(OffsetDateTime.now());
user.setRandomGroup(ThreadLocalRandom.current().nextInt(9));
}
user.setGithubLogin(profile.getLogin());
user.setGithubUserId(profile.getId());
user.setAvatar(profile.getAvatarUrl());
user.setNickname(profile.getName() == null ? profile.getLogin() : profile.getName());
user.setLastSeenAt(new Timestamp(System.currentTimeMillis()));
user.setLastAccessAt(new Timestamp(System.currentTimeMillis()));
user.setLastSeenAt(OffsetDateTime.now());
user.setLastAccessAt(OffsetDateTime.now());
user.setBanned(false);
user = userService.saveUser(user);
if (user.getId() <= 0) {
Expand Down

0 comments on commit 284f96c

Please sign in to comment.