...
|
...
|
@@ -42,25 +42,8 @@ func (l *MiniGetArticleLogic) MiniGetArticle(req *types.MiniArticleGetRequest) ( |
|
|
return nil, xerr.NewErrMsg("没有查看权限")
|
|
|
}
|
|
|
// 检查文章的可查看人
|
|
|
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),
|
|
|
// }
|
|
|
// return resp, nil
|
|
|
return nil, xerr.NewErrMsg("没有查看权限")
|
|
|
}
|
|
|
}
|
|
|
if ok := articleInfo.WhoCanRead(int64(req.UserId)); !ok {
|
|
|
return nil, xerr.NewErrMsg("没有查看权限")
|
|
|
}
|
|
|
if articleInfo.Show == domain.ArticleShowDisable {
|
|
|
// 文章内容不显示
|
...
|
...
|
|