Skip to content

Commit

Permalink
Merge pull request #202 from xhyqaq/feat/article-view
Browse files Browse the repository at this point in the history
feat: article view and page view
  • Loading branch information
IRONICBo authored Feb 28, 2024
2 parents f5a8220 + c0d6956 commit dd426f1
Show file tree
Hide file tree
Showing 6 changed files with 433 additions and 371 deletions.
14 changes: 9 additions & 5 deletions cmd/gopcomm/community_yap.gox
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,18 @@ get "/article/:id", ctx => {
}
id := ctx.param("id")
article, err := community.Article(todo, id)
likeState,_:= community.ArticleLikeState(todo,userId,id)
if err != nil {
if err!=nil {
xLog.Error("get article error:", err)
return
}
articleJson, err := json.Marshal(&article)
if err != nil {
xLog.Error("json marshal error:", err)
likeState,err := community.ArticleLikeState(todo,userId,id)
if err!=nil {
xLog.Error("article state err:", err)
return
}
ip := community.GetClientIP(ctx.Request)
community.ArticleLView(todo,id,ip,userId)
articleJson, _ := json.Marshal(&article)
ctx.yap "article", {
"UserId": userId,
"User": user,
Expand Down
Loading

0 comments on commit dd426f1

Please sign in to comment.