...
|
...
|
@@ -101,6 +101,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma |
|
|
if len(companyIds) > 0 {
|
|
|
_, companyList, err := l.svcCtx.CompanyRepository.Find(l.ctx, conn, domain.NewQueryOptions().
|
|
|
WithFindOnly().
|
|
|
WithKV("companyId", userToken.CompanyId).
|
|
|
WithKV("ids", companyIds).
|
|
|
WithKV("limit", len(companyIds)))
|
|
|
if err != nil {
|
...
|
...
|
@@ -115,6 +116,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma |
|
|
if len(userIds) > 0 {
|
|
|
_, userList, err := l.svcCtx.UserRepository.Find(l.ctx, conn, domain.NewQueryOptions().
|
|
|
WithFindOnly().
|
|
|
WithKV("companyId", userToken.CompanyId).
|
|
|
WithKV("ids", userIds).
|
|
|
WithKV("limit", len(userIds)))
|
|
|
if err != nil {
|
...
|
...
|
@@ -129,6 +131,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma |
|
|
if len(commentIds) > 0 {
|
|
|
_, commentList, err := l.svcCtx.ArticleCommentRepository.Find(l.ctx, conn, domain.NewQueryOptions().
|
|
|
WithFindOnly().
|
|
|
WithKV("companyId", userToken.CompanyId).
|
|
|
WithKV("ids", commentIds).
|
|
|
WithKV("limit", len(commentIds)))
|
|
|
if err != nil {
|
...
|
...
|
@@ -143,6 +146,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma |
|
|
if len(articleIds) > 0 {
|
|
|
_, articleList, err := l.svcCtx.ArticleRepository.Find(l.ctx, conn, userToken.CompanyId, domain.NewQueryOptions().
|
|
|
WithFindOnly().
|
|
|
WithKV("companyId", userToken.CompanyId).
|
|
|
WithKV("ids", articleIds).
|
|
|
WithKV("limit", len(articleIds)))
|
|
|
if err != nil {
|
...
|
...
|
@@ -169,7 +173,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma |
|
|
CreatedAt: item.CreatedAt,
|
|
|
}
|
|
|
|
|
|
if v, ok := userIdMap[item.UserId]; ok {
|
|
|
if v, ok := userIdMap[item.UserId]; ok && v != nil {
|
|
|
to.User = &types.SimpleUser{
|
|
|
Id: v.Id,
|
|
|
CompanyId: v.CompanyId,
|
...
|
...
|
@@ -178,12 +182,12 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma |
|
|
Avatar: v.Avatar,
|
|
|
}
|
|
|
|
|
|
if v, ok := companyIdMap[item.CompanyId]; ok {
|
|
|
if v, ok := companyIdMap[item.CompanyId]; ok && v != nil {
|
|
|
to.User.CompanyName = v.Name
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if v, ok := articleIdMap[item.ArticleId]; ok {
|
|
|
if v, ok := articleIdMap[item.ArticleId]; ok && v != nil {
|
|
|
to.Article = &types.SimpleArticle{
|
|
|
Id: v.Id,
|
|
|
Title: v.Title,
|
...
|
...
|
@@ -193,7 +197,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageRequest, msgType doma |
|
|
}
|
|
|
}
|
|
|
|
|
|
if v, ok := commentIdMap[item.CommentId]; ok {
|
|
|
if v, ok := commentIdMap[item.CommentId]; ok && v != nil {
|
|
|
to.Comment = &types.SimpleComment{
|
|
|
Id: v.Id,
|
|
|
Content: v.Content,
|
...
|
...
|
|