-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
83 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
comment/comment-job/model/dao/db/model/comment_response.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package model | ||
|
||
type CommentResponse struct { | ||
CommentId uint // 评论id | ||
ResourceId uint // 评论所关联的资源id | ||
ResourceTitle string // 资源的title | ||
Content string // 文本信息 | ||
ContentMeta string // 存储一些关键的附属信息 | ||
ContentRich string | ||
Pid uint // 父评论 ID | ||
Ext string // 额外信息存储 | ||
IP string | ||
IPArea string | ||
UserID uint // 发表者id | ||
UserName string // 发表者名称 | ||
Type uint // 评论类型,文字评论、图评等 | ||
IsCollapsed bool // 折叠 | ||
IsPending bool // 待审 | ||
IsPinned bool // 置顶 | ||
State uint // 状态 | ||
LikeCount uint // 点赞数 | ||
HateCount uint // 点踩数 | ||
ReplyCount uint // 回复数 | ||
|
||
FloorCount uint // 评论层数 | ||
} | ||
|
||
type CommentListResponse struct { | ||
CommentResponses []CommentResponse | ||
RootReplyCount uint // 根评论回复数 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
package queue | ||
|
||
import "comment-job/libary/event" | ||
import ( | ||
"comment-job/job/comment" | ||
"comment-job/libary/event" | ||
) | ||
|
||
func UpdateComment() { | ||
// 发送事件 | ||
func UpdateComment(commentInfo comment.CommentInfo) error { | ||
// todo redis相关更新操作 | ||
|
||
// 发送事件,进行后置更新,消息通知等行为 | ||
event.Send(event.CommentUpdateEvent{ | ||
UserId: userId, | ||
CommentId: comment.Id, | ||
UserId: commentInfo.UserID, | ||
ResourceId: commentInfo.ResourceId, | ||
CommentId: commentInfo.CommentId, | ||
}) | ||
return nil | ||
} |