2023-01-12 12:42:16 +00:00
|
|
|
package cache
|
2023-01-10 12:09:55 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2023-11-25 09:49:20 +00:00
|
|
|
"github.com/fthvgb1/wp-go/cache/cachemanager"
|
2023-01-10 12:09:55 +00:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2024-01-13 13:15:54 +00:00
|
|
|
// GetPostMetaByPostIds query func see dao.GetPostMetaByPostIds
|
2023-11-25 09:49:20 +00:00
|
|
|
func GetPostMetaByPostIds(ctx context.Context, ids []uint64) ([]map[string]any, error) {
|
2024-01-10 15:50:23 +00:00
|
|
|
return cachemanager.GetBatchBy[map[string]any]("postMetaData", ctx, ids, time.Second)
|
2023-01-10 12:09:55 +00:00
|
|
|
}
|
2024-01-13 13:15:54 +00:00
|
|
|
|
|
|
|
// GetPostMetaByPostId query func see dao.GetPostMetaByPostIds
|
2023-11-25 09:49:20 +00:00
|
|
|
func GetPostMetaByPostId(ctx context.Context, id uint64) (map[string]any, error) {
|
2024-01-10 15:50:23 +00:00
|
|
|
return cachemanager.GetBy[map[string]any]("postMetaData", ctx, id, time.Second)
|
2023-01-10 12:09:55 +00:00
|
|
|
}
|