...
|
...
|
@@ -40,7 +40,7 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
|
|
}
|
|
|
|
|
|
var userList []*domain.User
|
|
|
if len(articleInfo.WhoRead) == 0 {
|
|
|
if articleInfo.TargetUser == domain.ArticleTargetAll {
|
|
|
//获取所有人
|
|
|
queryOption := domain.NewQueryOptions().WithFindOnly().MustWithKV("companyId", articleInfo.CompanyId)
|
|
|
_, userList, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOption)
|
...
|
...
|
@@ -49,20 +49,21 @@ func (l *MiniArticleCommentAtWhoLogic) MiniArticleCommentAtWho(req *types.MiniAr |
|
|
return resp, nil
|
|
|
}
|
|
|
} else {
|
|
|
queryOption := domain.NewQueryOptions().WithFindOnly().MustWithKV("ids", articleInfo.WhoRead)
|
|
|
_, userList, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOption)
|
|
|
if err != nil {
|
|
|
resp = &types.MiniArticleCommentAtWhoResponse{}
|
|
|
return resp, nil
|
|
|
if len(articleInfo.WhoRead) > 0 {
|
|
|
queryOption := domain.NewQueryOptions().WithFindOnly().MustWithKV("ids", articleInfo.WhoRead)
|
|
|
_, userList, err = l.svcCtx.UserRepository.Find(l.ctx, conn, queryOption)
|
|
|
if err != nil {
|
|
|
resp = &types.MiniArticleCommentAtWhoResponse{}
|
|
|
return resp, nil
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
uList := make([]types.CommentAtWho, len(userList))
|
|
|
|
|
|
for i := range userList {
|
|
|
uList[i] = types.CommentAtWho{
|
|
|
Id: userList[i].Id,
|
|
|
Name: userList[i].Name,
|
|
|
Avatar: userList[i].Avatar,
|
|
|
FirstLetter: "",
|
|
|
}
|
|
|
for _, val := range userList[i].PinYinName {
|
...
|
...
|
|