Explorar o código

IdempotencyUtils.java

929386168@qq.com %!s(int64=3) %!d(string=hai) anos
pai
achega
1d9622a5e8

+ 23 - 0
boman-web-core/src/main/java/com/boman/web/core/utils/IdempotencyUtils.java

@@ -0,0 +1,23 @@
+package com.boman.web.core.utils;
+
+import com.boman.common.redis.RedisKey;
+
+import java.util.UUID;
+
+/**
+ * @author shiqian
+ * @date 2021年08月27日 10:22
+ **/
+public class IdempotencyUtils {
+
+    /**
+     * 功能描述: 拼接幂等性的key
+     *
+     * @param tableName tableName
+     * @param username  username
+     * @return java.lang.String (tableName:username:uuid)
+     */
+    public static String packKey(String tableName, String username) {
+        return tableName + ":" + username + ":" + UUID.randomUUID().toString();
+    }
+}