aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service/UserServiceImpl.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-06 17:06:43 +0300
committerGravatar Vitaly Takmazov2023-01-07 04:04:26 +0300
commitc5e6a65323a7558ca0322ec810a9dff847968730 (patch)
tree037ff0ac5a2eb8224c3c5bc440484ffcef1cd0e9 /src/main/java/com/juick/service/UserServiceImpl.java
parent02e31496ee0ff099dd2a0fe0b1754acee6f2263a (diff)
Initial SQLite schema (work in progress)
Diffstat (limited to 'src/main/java/com/juick/service/UserServiceImpl.java')
-rw-r--r--src/main/java/com/juick/service/UserServiceImpl.java25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/main/java/com/juick/service/UserServiceImpl.java b/src/main/java/com/juick/service/UserServiceImpl.java
index b15a18e5..ab947bac 100644
--- a/src/main/java/com/juick/service/UserServiceImpl.java
+++ b/src/main/java/com/juick/service/UserServiceImpl.java
@@ -17,12 +17,7 @@
package com.juick.service;
-import com.juick.model.AnonymousUser;
-import com.juick.model.ApplicationStatus;
-import com.juick.model.AuthResponse;
-import com.juick.model.ExternalToken;
-import com.juick.model.Message;
-import com.juick.model.User;
+import com.juick.model.*;
import com.juick.util.UsernameTakenException;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.RandomStringUtils;
@@ -32,7 +27,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DataIntegrityViolationException;
-import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
@@ -43,17 +37,10 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Nonnull;
import java.net.URI;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Timestamp;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.UUID;
+import java.sql.*;
+import java.time.Instant;
+import java.time.ZoneOffset;
+import java.util.*;
/**
* Created by aalexeev on 11/13/16.
@@ -674,7 +661,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
@Override
public void updateLastSeen(User user) {
- getJdbcTemplate().update("UPDATE users SET last_seen=now() WHERE id=?", user.getUid());
+ getJdbcTemplate().update("UPDATE users SET last_seen=? WHERE id=?", Instant.now().atOffset(ZoneOffset.UTC), user.getUid());
}
@Override