...
|
...
|
@@ -41,7 +41,7 @@ func IComment(header *protocol.RequestHeader, request *protocol.ICommentRequest) |
|
|
}
|
|
|
newComment := &models.Comment{
|
|
|
Id: idgen.Next(),
|
|
|
UserId: header.Uid,
|
|
|
UserId: header.UserId,
|
|
|
SourceType: int8(request.SourceType),
|
|
|
Content: request.Content,
|
|
|
CreateAt: time.Now(),
|
...
|
...
|
@@ -74,7 +74,7 @@ func IComments(header *protocol.RequestHeader, request *protocol.ICommentsReques |
|
|
baseUserInfo *protocol.BaseUserInfo
|
|
|
total int
|
|
|
)
|
|
|
if comments, total, err = repository.Comment.GetComments(header.Uid, protocol.SourceType_Chance, 0, request.LastId, request.PageSize); err != nil {
|
|
|
if comments, total, err = repository.Comment.GetComments(header.UserId, protocol.SourceType_Chance, 0, request.LastId, request.PageSize); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
...
|
...
|
@@ -112,7 +112,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) |
|
|
total int
|
|
|
exists bool
|
|
|
)
|
|
|
if comments, total, err = repository.Comment.GetComments(header.Uid, request.SourceType, request.SourceId, request.LastId, request.PageSize); err != nil {
|
|
|
if comments, total, err = repository.Comment.GetComments(header.UserId, request.SourceType, request.SourceId, request.LastId, request.PageSize); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
...
|
...
|
@@ -134,7 +134,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) |
|
|
ZanTotal: comment.ZanTotal,
|
|
|
CommentTotal: comment.CommentTotal,
|
|
|
}
|
|
|
if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.Uid, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists {
|
|
|
if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.UserId, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists {
|
|
|
item.IsZan = 1
|
|
|
}
|
|
|
rsp.Comments = append(rsp.Comments, item)
|
...
|
...
|
@@ -167,7 +167,7 @@ func CommentDetailsSingle(header *protocol.RequestHeader, request *protocol.Comm |
|
|
ZanTotal: comment.ZanTotal,
|
|
|
CommentTotal: comment.CommentTotal,
|
|
|
}
|
|
|
if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.Uid, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists {
|
|
|
if exists, _ = repository.ChanceFavorite.ExitsChanceFavorite(header.UserId, header.CompanyId, comment.Id, protocol.MarkFlag_Zan); exists {
|
|
|
rsp.Comment.IsZan = 1
|
|
|
}
|
|
|
return
|
...
|
...
|
|