Refactor uuid to id in message handling & processing. (#6)

This commit is contained in:
windyboy
2024-08-14 14:29:24 +08:00
committed by GitHub
parent 8538153cfe
commit bafbbf470c
7 changed files with 33 additions and 28 deletions
+13
View File
@@ -0,0 +1,13 @@
package utils
import "github.com/google/uuid"
func GetUuid(uuidString string) uuid.UUID {
log := GetSugaredLogger()
result, err := uuid.Parse(uuidString)
if err != nil {
log.Warnf("invalid uuid: %s", uuidString)
return uuid.New()
}
return result
}