parent
aa4b271bd7
commit
d996830162
|
@ -80,14 +80,17 @@ public class ConstValue {
|
|||
*/
|
||||
public enum DisposeDeviceType {
|
||||
/**
|
||||
* Dptech umc dispose device type.
|
||||
* The Dptech umc.
|
||||
*/
|
||||
DPTECH_UMC(0, "迪普UMC管理平台"),
|
||||
/**
|
||||
* Haohan platform dispose device type.
|
||||
* The Haohan platform.
|
||||
*/
|
||||
HAOHAN_PLATFORM(1, "浩瀚处置设备"),
|
||||
|
||||
/**
|
||||
* Virtual dispose dispose device type.
|
||||
*/
|
||||
VIRTUAL_DISPOSE(999, "虚拟处置设备");
|
||||
|
||||
private final int code;
|
||||
|
@ -120,7 +123,7 @@ public class ConstValue {
|
|||
/**
|
||||
* The type User account status.
|
||||
*/
|
||||
public class UserAccountStatus {
|
||||
public static class UserAccountStatus {
|
||||
/**
|
||||
* The constant NORMAL.
|
||||
*/
|
||||
|
@ -136,19 +139,19 @@ public class ConstValue {
|
|||
*/
|
||||
public enum DeviceCapacity {
|
||||
/**
|
||||
* Cleanup device capacity.
|
||||
* The Cleanup.
|
||||
*/
|
||||
CLEANUP(0, "清洗能力"),
|
||||
/**
|
||||
* Hidepend device capacity.
|
||||
* The Hidepend.
|
||||
*/
|
||||
HIDEPEND(1, "高防能力"),
|
||||
/**
|
||||
* Blackhool device capacity.
|
||||
* The Blackhool.
|
||||
*/
|
||||
BLACKHOOL(2, "黑洞能力"),
|
||||
/**
|
||||
* Detecive device capacity.
|
||||
* The Detecive.
|
||||
*/
|
||||
DETECIVE(3, "检测能力");
|
||||
|
||||
|
@ -184,11 +187,11 @@ public class ConstValue {
|
|||
*/
|
||||
public enum IPAddrType {
|
||||
/**
|
||||
* Ipv 4 type ip addr type.
|
||||
* The Ipv 4 type.
|
||||
*/
|
||||
IPV4_TYPE,
|
||||
/**
|
||||
* Ipv 6 type ip addr type.
|
||||
* The Ipv 6 type.
|
||||
*/
|
||||
IPV6_TYPE;
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ public class UserAccountCacheManagerImpl implements UserAccountCacheManager {
|
|||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
private static final Random randomGen = new Random(System.currentTimeMillis());
|
||||
|
||||
private final ConcurrentHashMap<String, UserAccountCache> userAccountCache = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
|
@ -253,7 +255,7 @@ public class UserAccountCacheManagerImpl implements UserAccountCacheManager {
|
|||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); // 此处的sha代表sha1
|
||||
|
||||
String tokenKey = username +
|
||||
Convert.toStr(new Random(System.currentTimeMillis()).nextInt()) +
|
||||
Convert.toStr(randomGen.nextInt()) +
|
||||
Convert.toStr(System.currentTimeMillis());
|
||||
// 调用digest方法,进行加密操作
|
||||
byte[] cipherBytes = messageDigest.digest(tokenKey.getBytes());
|
||||
|
|
|
@ -4,12 +4,14 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
|||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The type Dispose capacity.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
|
Loading…
Reference in New Issue