作者 tangxvhui

调整UserLoveFlag 结构

... ... @@ -2,6 +2,7 @@ package article
import (
"context"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/message"
"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
... ... @@ -249,6 +250,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeArticle(req *types.MiniSetUserLikeRequ
CommentId: 0,
CommentAuthor: 0,
UserId: req.UserId,
ToUserId: articleInfo.AuthorId,
}
// 添加点赞标识
_, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo)
... ... @@ -338,6 +340,7 @@ func (l *MiniSetUserLikeLogic) setUserLikeComment(req *types.MiniSetUserLikeRequ
CommentId: req.CommentId,
CommentAuthor: commentInfo.FromUserId,
UserId: req.UserId,
ToUserId: commentInfo.FromUserId,
}
// 设置赞标识
_, err = l.svcCtx.UserLoveFlagRepository.Insert(ctx, c, &flagInfo)
... ...
... ... @@ -52,6 +52,7 @@ func (l *SystemEditAticleCommentShowLogic) SystemEditAticleCommentShow(req *type
}
}
}
if err != nil {
return resp, err
}
... ...
... ... @@ -16,6 +16,7 @@ type UserLoveFlag struct {
ArticleAuthor int64 // 文章的发布人
CommentAuthor int64 // 评论的填写人
UserId int64
ToUserId int64
CreatedAt int64
UpdatedAt int64
DeletedAt int64
... ...
... ... @@ -160,6 +160,7 @@ func (repository *UserLoveFlagRepository) ModelToDomainModel(from *models.UserLo
CommentAuthor: from.CommentAuthor,
CommentId: from.CommentId,
UserId: from.UserId,
ToUserId: from.ToUserId,
CreatedAt: from.CreatedAt,
UpdatedAt: from.UpdatedAt,
DeletedAt: from.DeletedAt,
... ... @@ -177,6 +178,7 @@ func (repository *UserLoveFlagRepository) DomainModelToModel(from *domain.UserLo
ArticleAuthor: from.ArticleAuthor,
CommentAuthor: from.CommentAuthor,
UserId: from.UserId,
ToUserId: from.ToUserId,
CreatedAt: from.CreatedAt,
UpdatedAt: from.UpdatedAt,
DeletedAt: from.DeletedAt,
... ...
... ... @@ -14,7 +14,8 @@ type UserLoveFlag struct {
ArticleAuthor int64 `json:"articleAuthor"` // 文章的发布人
CommentId int64 `json:"commentId"` // 点赞评论时,填评论id
CommentAuthor int64 `json:"commentAuthor"` // 评论的填写人
UserId int64 `json:"userId"`
ToUserId int64 `json:"toUserId"` // 点赞的接受人
UserId int64 `json:"userId"` // 点赞的人
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
DeletedAt int64 `json:"deletedAt,omitempty"`
... ...