登录日志功能完成

yun-zuoyi
wei.peng 6 years ago
parent 8f8339f514
commit c221d618ea

@ -639,4 +639,128 @@ public class CommonEnumUtil {
}
}
/**
*
* return "Windows";
* return "Mac";
* return "Unix";
* return "Android";
* return "IPhone";
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum LOG_LOGIN_PLATFORM {
WINDOWS(1, "Windows", "Windows 操作系统"),
MAC(2, "Mac", "Mac 操作系统"),
UNIX(3, "Unix", "Linux 操作系统"),
ANDROID(4, "Android", "Android 操作系统"),
IPHONE(5, "IPhone", "IPhone 操作系统");
private int value;
private String name;
private String description;
LOG_LOGIN_PLATFORM() {
}
LOG_LOGIN_PLATFORM(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].getName();
}
}
return tmp;
}
/**
* -1
* @param desc
* @return
*/
public static int descOf(String desc) {
int tmp = -1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum USER_LOGIN_STATUS {
LOGIN_SUCCESS(1, "登录成功", "登录成功"),
WRONG_PASSWORD(3, "密码错误", "Linux 密码错误"),
WRONG_USERNAME_OR_PASSWORD(2, "用户名或密码错误", "用户名或密码错误"),
USER_LOGIN_LOCKING(4, "账号已锁定", "账号已锁定"),
USER_INFO_NULL(5, "用户信息不存在", "用户信息不存在"),
SYSTEM_ERROR(6, "系统异常", "系统异常");
private int value;
private String name;
private String description;
USER_LOGIN_STATUS() {
}
USER_LOGIN_STATUS(int value, String name, String description) {
this.value = value;
this.name = name;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getName() {
return name;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].getName();
}
}
return tmp;
}
public static int descOf(String desc) {
int tmp = -1;
for (int i = 0; i < values().length; i++) {
if (values()[i].name.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
}

@ -11,6 +11,7 @@ import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.servlet.http.HttpServletRequest;
/**
* @Description :
@ -47,6 +48,10 @@ public class SysLogUserLogin extends BaseBean {
@Column(name="LOG_LOGIN_HOST")
@ApiParam(value ="登录IP" , access ="登录IP")
private String logLoginHost;
@Column(name="LOG_LOGIN_BROWSER")
@ApiParam(value ="登录浏览器" , access ="登录的浏览器")
private String logLoginBrowser;
@Column(name="LOG_LOGIN_DATE_TIME")
@ApiParam(value ="登录时间" , access ="登录时间")

Loading…
Cancel
Save