|
|
@@ -5,6 +5,8 @@ import lombok.Getter;
|
|
|
import lombok.Setter;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Locale;
|
|
|
|
|
|
/**
|
|
|
* @author reghao
|
|
|
@@ -15,11 +17,12 @@ import java.io.Serializable;
|
|
|
public class AccountInfo implements Serializable {
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
- private int userId;
|
|
|
+ private long userId;
|
|
|
private String userIdStr;
|
|
|
private String username;
|
|
|
private String avatarUrl;
|
|
|
private String msgCount;
|
|
|
+ private List<String> roles;
|
|
|
|
|
|
public AccountInfo(User user) {
|
|
|
this.userId = user.getId();
|
|
|
@@ -27,6 +30,9 @@ public class AccountInfo implements Serializable {
|
|
|
this.username = user.getUsername();
|
|
|
this.avatarUrl = user.getAvatarUrl();
|
|
|
this.msgCount = "0";
|
|
|
+ this.roles = user.getRole().stream()
|
|
|
+ .map(role -> role.replace("ROLE_", "").toLowerCase(Locale.ROOT))
|
|
|
+ .toList();
|
|
|
}
|
|
|
|
|
|
public void setMsgCount(String msgCount) {
|