refactor: remove resource uid

This commit is contained in:
johnnyjoy
2025-02-01 12:50:15 +08:00
parent 97d12db3d5
commit 0dcd0904e8
12 changed files with 180 additions and 412 deletions

View File

@@ -72,16 +72,13 @@ func ExtractMemoUIDFromName(name string) (string, error) {
return id, nil
}
// ExtractResourceIDFromName returns the resource ID from a resource name.
func ExtractResourceIDFromName(name string) (int32, error) {
// ExtractResourceUIDFromName returns the resource UID from a resource name.
func ExtractResourceUIDFromName(name string) (string, error) {
tokens, err := GetNameParentTokens(name, ResourceNamePrefix)
if err != nil {
return 0, err
}
id, err := util.ConvertStringToInt32(tokens[0])
if err != nil {
return 0, errors.Errorf("invalid resource ID %q", tokens[0])
return "", err
}
id := tokens[0]
return id, nil
}