chore: use resource name in frontend

This commit is contained in:
Steven
2024-01-21 10:55:49 +08:00
parent 582cc6609c
commit 4d48f50815
10 changed files with 168 additions and 147 deletions

View File

@@ -27,7 +27,8 @@ import (
)
type Resource struct {
ID int32 `json:"id"`
ID int32 `json:"id"`
Name string `json:"name"`
// Standard fields
CreatorID int32 `json:"creatorId"`
@@ -368,6 +369,7 @@ func replacePathTemplate(path, filename string) string {
func convertResourceFromStore(resource *store.Resource) *Resource {
return &Resource{
ID: resource.ID,
Name: resource.ResourceName,
CreatorID: resource.CreatorID,
CreatedTs: resource.CreatedTs,
UpdatedTs: resource.UpdatedTs,

View File

@@ -138,7 +138,7 @@ func (s *APIV1Service) generateRSSFromMemoList(ctx context.Context, memoList []*
if resource.ExternalLink != "" {
enclosure.Url = resource.ExternalLink
} else {
enclosure.Url = baseURL + "/o/r/" + fmt.Sprintf("%d", resource.ID)
enclosure.Url = baseURL + "/o/r/" + resource.Name
}
enclosure.Length = strconv.Itoa(int(resource.Size))
enclosure.Type = resource.Type