|
@@ -23,7 +23,7 @@ import (
|
|
|
)
|
|
|
|
|
|
// Comment 发布留言
|
|
|
-func Comment(user user.UserInfo, communityQuestionID uint32, content string, sourceAgent, isShowName int8) (ybCommunityQuestionComment *yb_community_question_comment.YbCommunityQuestionComment, err error, errMsg string) {
|
|
|
+func Comment(user user.UserInfo, communityQuestionID uint32, content string, sourceAgent, isShowName int8, qaAvatarUrl string) (ybCommunityQuestionComment *yb_community_question_comment.YbCommunityQuestionComment, err error, errMsg string) {
|
|
|
errMsg = "发布留言失败"
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -92,8 +92,9 @@ func Comment(user user.UserInfo, communityQuestionID uint32, content string, sou
|
|
|
SourceAgent: sourceAgent,
|
|
|
//TopTime: time.Time{},
|
|
|
//HotTime: time.Time{},
|
|
|
- ModifyTime: now,
|
|
|
- CreateTime: now,
|
|
|
+ ModifyTime: now,
|
|
|
+ CreateTime: now,
|
|
|
+ QaAvatarUrl: qaAvatarUrl,
|
|
|
}
|
|
|
err = ybCommunityQuestionComment.Create()
|
|
|
if err != nil {
|
|
@@ -266,6 +267,7 @@ func List(userId uint64, communityQuestionID int, hotFlag bool, page, pageSize i
|
|
|
UserImgUrl: utils.DEFAULT_HONGZE_USER_LOGO,
|
|
|
CreateTime: v.CreateTime,
|
|
|
ReplyList: nil,
|
|
|
+ QaAvatarUrl: v.QaAvatarUrl,
|
|
|
}
|
|
|
if info, ok := usersMap[v.UserID]; ok && v.IsShowName == 1 {
|
|
|
tmp.UserName = info.NickName
|
|
@@ -389,6 +391,7 @@ func HandleCommentByCommunityQuestionItemList(userId uint64, questionList []*res
|
|
|
//最近一条 精选/我的 评论
|
|
|
if ybCommunityQuestionCommentInfo, ok := ybCommunityQuestionCommentMap[uint32(v.CommunityQuestionID)]; ok {
|
|
|
v.Comment = ybCommunityQuestionCommentInfo.Content
|
|
|
+ v.QaAvatarUrl = ybCommunityQuestionCommentInfo.QaAvatarUrl
|
|
|
v.CommentUserName = "匿名用户" + strconv.Itoa(int(3333+ybCommunityQuestionCommentInfo.UserID))
|
|
|
if info, ok := usersMap[ybCommunityQuestionCommentInfo.UserID]; ok && ybCommunityQuestionCommentInfo.IsShowName == 1 {
|
|
|
v.CommentUserName = info.NickName
|