优化代码

pull/65/head
awenes 2023-10-05 14:27:51 +08:00
parent 1829742803
commit 485e0a34fa
4 changed files with 35 additions and 7 deletions

View File

@ -40,23 +40,23 @@ import lombok.NonNull;
public class Actor implements Serializable {
@Serial
private static final long serialVersionUID = -1144169992714000310L;
private static final long serialVersionUID = -1144169992714000310L;
/**
* ID
*/
@NonNull
private String id;
private String id;
/**
*
*/
@NonNull
private UserType type;
private UserType type;
/**
*
*/
private String authType;
private String authType;
}

View File

@ -64,6 +64,18 @@ public class AdministratorEntity extends LogicDeleteEntity<Long> {
@Column(name = "username_")
private String username;
/**
*
*/
@Column(name = "full_name")
private String fullName;
/**
*
*/
@Column(name = "nick_name")
private String nickName;
/**
*
*/

View File

@ -71,6 +71,10 @@ public class CurrentUserEndpoint {
result.setAccountId(userDetails.getId());
//用户名
result.setUsername(administrator.getUsername());
//姓名
result.setFullName(administrator.getFullName());
//昵称
result.setNickName(administrator.getNickName());
//头像
if (StringUtils.isEmpty(administrator.getAvatar())) {
result.setAvatar(bufferedImageToBase64(generateAvatarImg(administrator.getUsername())));
@ -105,6 +109,18 @@ public class CurrentUserEndpoint {
@Schema(description = "用户名")
private String username;
/**
*
*/
@Schema(description = "姓名")
private String fullName;
/**
*
*/
@Schema(description = "昵称")
private String nickName;
/**
*
*/

View File

@ -277,13 +277,13 @@ public interface UserConverter {
if (audit.getEventType().getCode().equals(PortalEventType.LOGIN_PORTAL.getCode())) {
result.setAppName(PORTAL.getDesc());
}
UserAgent userAgent=audit.getUserAgent();
GeoLocation geoLocation= audit.getGeoLocation();
UserAgent userAgent = audit.getUserAgent();
GeoLocation geoLocation = audit.getGeoLocation();
result.setEventTime(audit.getEventTime());
result.setClientIp(geoLocation.getIp());
result.setLocation(geoLocation.getCityName());
result.setBrowser(userAgent.getBrowser());
result.setPlatform(userAgent.getPlatform()+" "+userAgent.getPlatformVersion());
result.setPlatform(userAgent.getPlatform() + " " + userAgent.getPlatformVersion());
result.setEventStatus(audit.getEventStatus());
list.add(result);
});