mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Improve search
This commit is contained in:
@@ -391,7 +391,7 @@ func RandomResource() (model.Resource, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func GetResourcesIdWithTag(tagID uint) (map[uint]time.Time, error) {
|
||||
func GetResourcesIdWithTag(tagID uint) ([]uint, error) {
|
||||
tag, err := GetTagByID(tagID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -422,11 +422,7 @@ func GetResourcesIdWithTag(tagID uint) (map[uint]time.Time, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resMap := make(map[uint]time.Time)
|
||||
for _, r := range result {
|
||||
resMap[r.ID] = r.CreatedAt
|
||||
}
|
||||
return resMap, nil
|
||||
return tagIds, nil
|
||||
}
|
||||
|
||||
func BatchGetResources(ids []uint) ([]model.Resource, error) {
|
||||
|
Reference in New Issue
Block a user