Merge pull request 'mainconflict' (#199) from mainconflict into main

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/199
This commit is contained in:
chenhao 2024-03-25 12:14:21 +08:00
commit 7af89f7d42
3 changed files with 10 additions and 16 deletions

View File

@ -1394,7 +1394,7 @@ func (m *Mongo) GetMomentListByIds(ctx *gin.Context, req *momentproto.OpListById
},
"del_flag": 0,
}
err := col.Find(ctx, query).Sort("ct").All(&list)
err := col.Find(ctx, query).Sort("_id").All(&list)
if err == qmgo.ErrNoSuchDocuments {
err = nil
return list, err

View File

@ -1262,17 +1262,6 @@ func (s *Service) utilGetApiMomentVOListByIds(ctx *gin.Context, visitorMid int64
return
}
// list -> idList 索引的map保证不打乱顺序
_momentIndexMap := make(map[int]int)
for i, account := range list {
id1 := util.DerefInt64(account.Id)
for j, id2 := range ids {
if id1 == id2 {
_momentIndexMap[i] = j
}
}
}
// 获取访问者的关注列表
followMap, err := s.utilGetFollowMap(ctx, visitorMid)
if err != nil {
@ -1286,8 +1275,8 @@ func (s *Service) utilGetApiMomentVOListByIds(ctx *gin.Context, visitorMid int64
logger.Error("utilFillMomentsStreamerInfo fail, , err: %v", err)
return
}
volist = make([]*momentproto.ApiMomentVO, len(vos))
for i, vo := range vos {
volist = make([]*momentproto.ApiMomentVO, 0)
for _, vo := range vos {
apiVO, _ := vo.(*momentproto.ApiMomentVO)
// 填充是否关注
s.utilFillIsFollowedFillable(ctx, followMap, apiVO)
@ -1296,7 +1285,7 @@ func (s *Service) utilGetApiMomentVOListByIds(ctx *gin.Context, visitorMid int64
logger.Error("utilFillIsThumbedUpFillable fail")
return
}
volist[_momentIndexMap[i]] = apiVO
volist = append(volist, apiVO)
}
return

View File

@ -39,7 +39,12 @@ func (interceptor *CryptoTagInterceptor) Intercept(p any, tags ...string) (err e
//开始遍历标签
for interceptor.cryptoEleQueue.Len() != 0 {
cryptoElement, _ := interceptor.cryptoEleQueue.Remove(interceptor.cryptoEleQueue.Front()).(*CryptoElement)
ele := interceptor.cryptoEleQueue.Remove(interceptor.cryptoEleQueue.Front())
cryptoElement, ok := ele.(*CryptoElement)
if !ok {
logger.Error("crypto element assertion failed, element is: %v, type is: %v", ele, reflect.TypeOf(ele).String())
continue
}
if cryptoElement == nil {
continue
}