...
|
...
|
@@ -39,17 +39,25 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( |
|
|
return nil, xerr.NewErrMsg("没有查看权限")
|
|
|
}
|
|
|
|
|
|
inWhoRead := false
|
|
|
|
|
|
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),
|
|
|
}
|
|
|
return resp, nil
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if articleInfo.Show == domain.ArticleShowDisable || !inWhoRead {
|
|
|
if articleInfo.Show == domain.ArticleShowDisable {
|
|
|
// 文章内容不显示
|
|
|
resp = &types.MiniArticleGetResponse{
|
|
|
Id: articleInfo.Id,
|
...
|
...
|
|