You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.3 KiB
34 lines
1.3 KiB
package memory
|
|
|
|
import (
|
|
"yunyan/pb"
|
|
)
|
|
|
|
// IModel 模型组件接口
|
|
type IModel interface {
|
|
// 记忆项
|
|
addItem(item *pb.DBMemoryItem) error
|
|
findItemByClientKey(uid, clientKey string) (*pb.DBMemoryItem, error)
|
|
getItem(uid string, id uint64) (*pb.DBMemoryItem, error)
|
|
saveItem(item *pb.DBMemoryItem) error
|
|
listItems(q *itemQuery) ([]*pb.DBMemoryItem, int64, error)
|
|
delItems(uid string, ids []uint64) (int64, error)
|
|
completeItems(uid string, ids []uint64, done bool) (int64, error)
|
|
delMeetingItems(sourceID string, genRound int32) (int64, error)
|
|
|
|
// 周期报告
|
|
upsertReport(rec *pb.DBMemoryReport) error
|
|
saveReport(rec *pb.DBMemoryReport) error
|
|
getReport(id uint64) (*pb.DBMemoryReport, error)
|
|
getReportByPeriod(uid, ptype, pkey string) (*pb.DBMemoryReport, error)
|
|
latestUnconfirmedReport(uid string) (*pb.DBMemoryReport, error)
|
|
listReports(uid, ptype string, page, size int32) ([]*pb.DBMemoryReport, int64, error)
|
|
uidsWithItemsBetween(start, end string, minItems int) ([]string, error)
|
|
}
|
|
|
|
// Redis 队列键后缀(实际使用时还会经 service.GetTag() 与 redissys.RKey 加应用前缀,
|
|
// 测试机上多个应用共用一个 Redis,不加前缀会串号)
|
|
const (
|
|
QueueReportAwait = "memory:report:await" //报告生成等待队列
|
|
LockReportPrefix = "memory:report:lock" //cron 抢锁前缀,后面拼 <period_type>:<period_key>
|
|
)
|
|
|