fix: resource v1 definition

This commit is contained in:
Steven
2024-03-24 22:35:10 +08:00
parent be525fa3df
commit e703b4f70d
3 changed files with 7 additions and 5 deletions

View File

@ -26,6 +26,7 @@ import (
type Resource struct {
ID int32 `json:"id"`
Name string `json:"name"`
UID string `json:"uid"`
// Standard fields
CreatorID int32 `json:"creatorId"`
@ -371,7 +372,8 @@ func replacePathTemplate(path, filename string) string {
func convertResourceFromStore(resource *store.Resource) *Resource {
return &Resource{
ID: resource.ID,
Name: resource.UID,
Name: fmt.Sprintf("resources/%d", resource.ID),
UID: resource.UID,
CreatorID: resource.CreatorID,
CreatedTs: resource.CreatedTs,
UpdatedTs: resource.UpdatedTs,