...
|
...
|
@@ -248,13 +248,13 @@ func (l *MiniBusinessLogic) LikeComment(conn transaction.Conn, articleId int64, |
|
|
}
|
|
|
|
|
|
// UnLikeArticle 取消点赞文章
|
|
|
func (l *MiniBusinessLogic) UnLikeArticle(conn transaction.Conn, articleId int64) (err error) {
|
|
|
return l.deleteMessage(conn, domain.OptTypeArticle, articleId, 0)
|
|
|
func (l *MiniBusinessLogic) UnLikeArticle(conn transaction.Conn, articleId int64, recipientId int64) (err error) {
|
|
|
return l.deleteMessage(conn, domain.OptTypeArticle, articleId, 0, recipientId)
|
|
|
}
|
|
|
|
|
|
// UnLikeComment 取消点赞评论
|
|
|
func (l *MiniBusinessLogic) UnLikeComment(conn transaction.Conn, articleId int64, commentId int64) (err error) {
|
|
|
return l.deleteMessage(conn, domain.OptTypeComment, articleId, commentId)
|
|
|
func (l *MiniBusinessLogic) UnLikeComment(conn transaction.Conn, articleId int64, commentId int64, recipientId int64) (err error) {
|
|
|
return l.deleteMessage(conn, domain.OptTypeComment, articleId, commentId, recipientId)
|
|
|
}
|
|
|
|
|
|
func (l *MiniBusinessLogic) createMessage(
|
...
|
...
|
@@ -287,14 +287,14 @@ func (l *MiniBusinessLogic) createMessage( |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (l *MiniBusinessLogic) deleteMessage(conn transaction.Conn, optType domain.MsgBusinessOpt, articleId int64, commentId int64) (err error) {
|
|
|
func (l *MiniBusinessLogic) deleteMessage(conn transaction.Conn, optType domain.MsgBusinessOpt, articleId int64, commentId int64, recipientId int64) (err error) {
|
|
|
var userToken = contextdata.GetUserTokenFromCtx(l.ctx)
|
|
|
|
|
|
queryOption := domain.NewQueryOptions().WithFindOnly().WithOffsetLimit(1, 1).
|
|
|
MustWithKV("type", domain.MsgTypeLike).
|
|
|
MustWithKV("optType", optType).
|
|
|
MustWithKV("companyId", userToken.CompanyId).
|
|
|
MustWithKV("recipientId", userToken.UserId).
|
|
|
MustWithKV("recipientId", recipientId).
|
|
|
MustWithKV("articleId", articleId).
|
|
|
MustWithKV("commentId", commentId)
|
|
|
|
...
|
...
|
|