mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
(feature)(auth)Add last_login field to User.
This commit is contained in:
@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@@ -22,26 +23,28 @@ public class User implements Serializable {
|
||||
|
||||
private Integer isAdmin;
|
||||
|
||||
private Timestamp lastLogin;
|
||||
|
||||
public static User get(Long id, String name, String displayName, String email,
|
||||
Integer isAdmin) {
|
||||
return new User(id, name, displayName, email, isAdmin);
|
||||
return new User(id, name, displayName, email, isAdmin, null);
|
||||
}
|
||||
|
||||
public static User get(Long id, String name) {
|
||||
return new User(id, name, name, name, 0);
|
||||
return new User(id, name, name, name, 0, null);
|
||||
}
|
||||
|
||||
public static User getDefaultUser() {
|
||||
return new User(1L, "admin", "admin", "admin@email", 1);
|
||||
return new User(1L, "admin", "admin", "admin@email", 1, null);
|
||||
}
|
||||
|
||||
public static User getVisitUser() {
|
||||
return new User(1L, "visit", "visit", "visit@email", 0);
|
||||
return new User(1L, "visit", "visit", "visit@email", 0, null);
|
||||
}
|
||||
|
||||
public static User getAppUser(int appId) {
|
||||
String name = String.format("app_%s", appId);
|
||||
return new User(1L, name, name, "", 1);
|
||||
return new User(1L, name, name, "", 1, null);
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
|
||||
Reference in New Issue
Block a user