作者 tangxvhui

Merge branch 'dev' into test

... ... @@ -41,25 +41,25 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) (
if articleInfo.CompanyId != req.CompanyId {
return nil, xerr.NewErrMsg("没有查看权限")
}
if len(articleInfo.WhoRead) > 0 {
inWhoRead := false
for _, val := range articleInfo.WhoRead {
if req.UserId == int(val) {
inWhoRead = true
if articleInfo.AuthorId != int64(req.UserId) {
if len(articleInfo.WhoRead) > 0 {
inWhoRead := false
for _, val := range articleInfo.WhoRead {
if req.UserId == int(val) {
inWhoRead = true
}
}
}
if !inWhoRead {
// 文章内容不显示
resp = &types.MiniArticleGetResponse{
Id: articleInfo.Id,
Title: articleInfo.Title,
Show: int(domain.ArticleShowDisable),
if !inWhoRead {
// 文章内容不显示
resp = &types.MiniArticleGetResponse{
Id: articleInfo.Id,
Title: articleInfo.Title,
Show: int(domain.ArticleShowDisable),
}
return resp, nil
}
return resp, nil
}
}
if articleInfo.Show == domain.ArticleShowDisable {
// 文章内容不显示
resp = &types.MiniArticleGetResponse{
... ...
... ... @@ -21,9 +21,10 @@ type MiniSearchArticlePageLogic struct {
func NewMiniSearchArticlePageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MiniSearchArticlePageLogic {
return &MiniSearchArticlePageLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
userCache: make(map[int64]*domain.User),
}
}
... ...