refactor(kotlin): 重构 AES 工具类并优化 Base64 编解码方法
- 重构 AesUtils.kt,使用 Kotlin 标准库的 encode 和 decode 方法替代自定义实现- 删除 Java 版本的 Base64Utils 类,迁移到 Kotlin 实现 - 重命名 ByteUtil.kt 为 ByteUtils.kt,统一命名风格 - 删除 Java 版本的 CloneUtil 类和 Factory 类,使用 Kotlin 实现 - 新增 Kotlin 版本的 SpringBeanUtils 工具类
This commit is contained in:
@@ -16,10 +16,9 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile UUID.kt
|
||||
* LastUpdate 2025-09-12 16:57:52
|
||||
* LastUpdate 2025-09-14 19:55:47
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
package com.mingliqiye.utils.uuid
|
||||
|
||||
import com.github.f4b6a3.uuid.UuidCreator
|
||||
@@ -84,6 +83,16 @@ class UUID : Serializable {
|
||||
return UUID(uuid)
|
||||
}
|
||||
|
||||
/**
|
||||
* 从Java的UUID
|
||||
* @param uuid 字符串
|
||||
* @return UUID
|
||||
*/
|
||||
@JvmStatic
|
||||
fun of(uuid: JUUID): UUID {
|
||||
return UUID(uuid)
|
||||
}
|
||||
|
||||
/**
|
||||
* 从字节码转换到UUID
|
||||
* @param array 16字节
|
||||
@@ -93,6 +102,10 @@ class UUID : Serializable {
|
||||
fun of(array: ByteArray): UUID {
|
||||
return UUID(array)
|
||||
}
|
||||
|
||||
fun JUUID.toMlUUID(): UUID {
|
||||
return of(this)
|
||||
}
|
||||
}
|
||||
|
||||
internal constructor(msb: Long, lsb: Long) {
|
||||
@@ -108,10 +121,11 @@ class UUID : Serializable {
|
||||
this.uuid = JUUID(bb.getLong(), bb.getLong())
|
||||
}
|
||||
|
||||
internal constructor(uuid: String) {
|
||||
constructor(uuid: String) {
|
||||
this.uuid = JUUID.fromString(uuid)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取对应的字节码
|
||||
* @return 字节码
|
||||
@@ -242,3 +256,5 @@ class UUID : Serializable {
|
||||
return uuid.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user