From 4151389fb92c3f1444d033c1eed0a76165799eea Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 13 六月 2024 00:37:37 +0800
Subject: [PATCH] 修改otherfature的数据格式

---
 pkg/floor.go |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/pkg/floor.go b/pkg/floor.go
index 591c115..379d22b 100644
--- a/pkg/floor.go
+++ b/pkg/floor.go
@@ -4,15 +4,14 @@
 	"fmt"
 	"strconv"
 	"strings"
-
-	"gat1400Exchange/pkg/snowflake"
 )
 
 // 鐢熸垚涓�涓寘鍚ゼ灞傜殑浜鸿劯id,瑙f瀽妤煎眰
-// 浣跨敤48浣嶆簮id, 鍏朵腑鍓�41浣嶆槸imageid, 涓嶅彲浠ヤ慨鏀�  +99 + 3浣嶆ゼ灞�(绗竴浣�0琛ㄧず姝�,1琛ㄧず璐�) + 2浣嶉殢鏈烘暟
+// 浣跨敤48浣嶆簮id, 鍏朵腑鍓�41浣嶆槸imageid, 涓嶅彲浠ヤ慨鏀� 41-43浣嶅~ 06 浠h〃鍥惧儚, +99 + 3浣嶆ゼ灞�(绗竴浣�0琛ㄧず姝�,1琛ㄧず璐�)
 func GenerateFaceIdContainFloor(srcId, floorStr string) string {
-	floorNum, _ := parseFloor(floorStr)
-	newId := srcId[0:41] + "99" + floorNum + snowflake.CreateRandomNumber(2)
+	floorNum, _ := ParseFloor(floorStr)
+	newId := srcId[0:43] + "99" + floorNum
+	//newId := srcId[0:43] + "99" + floorNum + snowflake.CreateRandomNumber(1)
 
 	return newId
 }
@@ -22,15 +21,15 @@
 		return "", fmt.Errorf("invalid id %s", srcId)
 	}
 
-	if srcId[41:43] != "99" {
-		return "", fmt.Errorf("invalid flag %s", srcId[41:43])
+	if srcId[43:45] != "99" {
+		return "", fmt.Errorf("invalid flag %s", srcId[43:45])
 	}
 
-	return restoreFloor(srcId[43:46])
+	return RestoreFloor(srcId[45:48])
 }
 
-// parseFloor parses the floor string and returns a three-character string
-func parseFloor(floor string) (string, error) {
+// ParseFloor parses the floor string and returns a three-character string
+func ParseFloor(floor string) (string, error) {
 	var sign string
 	var number string
 
@@ -54,8 +53,8 @@
 	return sign + formattedNumber, nil
 }
 
-// restoreFloor restores the three-character string back to the original floor string
-func restoreFloor(encoded string) (string, error) {
+// RestoreFloor restores the three-character string back to the original floor string
+func RestoreFloor(encoded string) (string, error) {
 	if len(encoded) != 3 {
 		return "", fmt.Errorf("encoded string must be 3 characters long")
 	}

--
Gitblit v1.8.0