REM:
1. 解决部分 CheckStyle 警告
This commit is contained in:
huangxin 2020-04-22 09:33:21 +08:00
parent aa4b271bd7
commit d996830162
3 changed files with 17 additions and 10 deletions

View File

@ -80,14 +80,17 @@ public class ConstValue {
*/ */
public enum DisposeDeviceType { public enum DisposeDeviceType {
/** /**
* Dptech umc dispose device type. * The Dptech umc.
*/ */
DPTECH_UMC(0, "迪普UMC管理平台"), DPTECH_UMC(0, "迪普UMC管理平台"),
/** /**
* Haohan platform dispose device type. * The Haohan platform.
*/ */
HAOHAN_PLATFORM(1, "浩瀚处置设备"), HAOHAN_PLATFORM(1, "浩瀚处置设备"),
/**
* Virtual dispose dispose device type.
*/
VIRTUAL_DISPOSE(999, "虚拟处置设备"); VIRTUAL_DISPOSE(999, "虚拟处置设备");
private final int code; private final int code;
@ -120,7 +123,7 @@ public class ConstValue {
/** /**
* The type User account status. * The type User account status.
*/ */
public class UserAccountStatus { public static class UserAccountStatus {
/** /**
* The constant NORMAL. * The constant NORMAL.
*/ */
@ -136,19 +139,19 @@ public class ConstValue {
*/ */
public enum DeviceCapacity { public enum DeviceCapacity {
/** /**
* Cleanup device capacity. * The Cleanup.
*/ */
CLEANUP(0, "清洗能力"), CLEANUP(0, "清洗能力"),
/** /**
* Hidepend device capacity. * The Hidepend.
*/ */
HIDEPEND(1, "高防能力"), HIDEPEND(1, "高防能力"),
/** /**
* Blackhool device capacity. * The Blackhool.
*/ */
BLACKHOOL(2, "黑洞能力"), BLACKHOOL(2, "黑洞能力"),
/** /**
* Detecive device capacity. * The Detecive.
*/ */
DETECIVE(3, "检测能力"); DETECIVE(3, "检测能力");
@ -184,11 +187,11 @@ public class ConstValue {
*/ */
public enum IPAddrType { public enum IPAddrType {
/** /**
* Ipv 4 type ip addr type. * The Ipv 4 type.
*/ */
IPV4_TYPE, IPV4_TYPE,
/** /**
* Ipv 6 type ip addr type. * The Ipv 6 type.
*/ */
IPV6_TYPE; IPV6_TYPE;

View File

@ -30,6 +30,8 @@ public class UserAccountCacheManagerImpl implements UserAccountCacheManager {
@Resource @Resource
private ObjectMapper objectMapper; private ObjectMapper objectMapper;
private static final Random randomGen = new Random(System.currentTimeMillis());
private final ConcurrentHashMap<String, UserAccountCache> userAccountCache = new ConcurrentHashMap<>(); 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 MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); // 此处的sha代表sha1
String tokenKey = username + String tokenKey = username +
Convert.toStr(new Random(System.currentTimeMillis()).nextInt()) + Convert.toStr(randomGen.nextInt()) +
Convert.toStr(System.currentTimeMillis()); Convert.toStr(System.currentTimeMillis());
// 调用digest方法进行加密操作 // 调用digest方法进行加密操作
byte[] cipherBytes = messageDigest.digest(tokenKey.getBytes()); byte[] cipherBytes = messageDigest.digest(tokenKey.getBytes());

View File

@ -4,12 +4,14 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
/** /**
* The type Dispose capacity. * The type Dispose capacity.
*/ */
@Getter
@Setter @Setter
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor