优化节点配置生成速度

This commit is contained in:
刘祥超
2021-11-11 14:16:42 +08:00
parent 8afd21f2f4
commit 5b32343a2c
49 changed files with 527 additions and 198 deletions

View File

@@ -3,8 +3,8 @@ package services
import (
"context"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/utils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/maps"
)
// MessageRecipientService 消息接收人服务
@@ -83,7 +83,7 @@ func (this *MessageRecipientService) ListEnabledMessageRecipients(ctx context.Co
}
var tx = this.NullTx()
var cacheMap = maps.Map{}
var cacheMap = utils.NewCacheMap()
recipients, err := models.SharedMessageRecipientDAO.ListAllEnabledRecipients(tx, req.AdminId, req.MessageRecipientGroupId, req.MediaType, req.Keyword, req.Offset, req.Size)
if err != nil {
return nil, err
@@ -163,7 +163,7 @@ func (this *MessageRecipientService) FindEnabledMessageRecipient(ctx context.Con
}
var tx = this.NullTx()
var cacheMap = maps.Map{}
var cacheMap = utils.NewCacheMap()
recipient, err := models.SharedMessageRecipientDAO.FindEnabledMessageRecipient(tx, req.MessageRecipientId, cacheMap)
if err != nil {
return nil, err