|
@@ -140,8 +140,8 @@ func Delete(user user.UserInfo, communityQuestionCommentID uint64) (err error, e
|
|
}
|
|
}
|
|
|
|
|
|
// MyList 我的留言列表
|
|
// MyList 我的留言列表
|
|
-func MyList(userId uint64, communityQuestionCommentID int, page, pageSize int) (list []*response.RespCommunityQuestionCommentItem, total int64, isShowName int8, err error, errMsg string) {
|
|
|
|
- list, total, err, errMsg = List(userId, communityQuestionCommentID, false, page, pageSize)
|
|
|
|
|
|
+func MyList(userId uint64, communityQuestionID int, page, pageSize int) (list []*response.RespCommunityQuestionCommentItem, total int64, isShowName int8, err error, errMsg string) {
|
|
|
|
+ list, total, err, errMsg = List(userId, communityQuestionID, false, page, pageSize)
|
|
if err != nil {
|
|
if err != nil {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -154,7 +154,7 @@ func MyList(userId uint64, communityQuestionCommentID int, page, pageSize int) (
|
|
}
|
|
}
|
|
|
|
|
|
// List 查询精选留言列表或我的留言列表
|
|
// List 查询精选留言列表或我的留言列表
|
|
-func List(userId uint64, communityQuestionCommentID int, hotFlag bool, page, pageSize int) (list []*response.RespCommunityQuestionCommentItem, total int64, err error, errMsg string) {
|
|
|
|
|
|
+func List(userId uint64, communityQuestionID int, hotFlag bool, page, pageSize int) (list []*response.RespCommunityQuestionCommentItem, total int64, err error, errMsg string) {
|
|
defer func() {
|
|
defer func() {
|
|
if err != nil {
|
|
if err != nil {
|
|
global.LOG.Critical(fmt.Sprintf("comment List: userId=%d, err:%s, errMsg:%s", userId, err.Error(), errMsg))
|
|
global.LOG.Critical(fmt.Sprintf("comment List: userId=%d, err:%s, errMsg:%s", userId, err.Error(), errMsg))
|
|
@@ -162,7 +162,7 @@ func List(userId uint64, communityQuestionCommentID int, hotFlag bool, page, pag
|
|
}()
|
|
}()
|
|
list = make([]*response.RespCommunityQuestionCommentItem, 0)
|
|
list = make([]*response.RespCommunityQuestionCommentItem, 0)
|
|
|
|
|
|
- if communityQuestionCommentID <= 0 {
|
|
|
|
|
|
+ if communityQuestionID <= 0 {
|
|
err = errors.New("请输入问答ID")
|
|
err = errors.New("请输入问答ID")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -170,24 +170,24 @@ func List(userId uint64, communityQuestionCommentID int, hotFlag bool, page, pag
|
|
var commentList []*yb_community_question_comment.YbCommunityQuestionComment
|
|
var commentList []*yb_community_question_comment.YbCommunityQuestionComment
|
|
//查询精选留言
|
|
//查询精选留言
|
|
if hotFlag {
|
|
if hotFlag {
|
|
- commentList, err = yb_community_question_comment.GetHotListByCommunityQuestionCommentID(communityQuestionCommentID, (page-1)*pageSize, pageSize)
|
|
|
|
|
|
+ commentList, err = yb_community_question_comment.GetHotListByCommunityQuestionID(communityQuestionID, (page-1)*pageSize, pageSize)
|
|
if err != nil {
|
|
if err != nil {
|
|
errMsg = `查询精选留言列表出错`
|
|
errMsg = `查询精选留言列表出错`
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- total, err = yb_community_question_comment.GetHotListTotalByCommunityQuestionCommentID(communityQuestionCommentID)
|
|
|
|
|
|
+ total, err = yb_community_question_comment.GetHotListTotalByCommunityQuestionID(communityQuestionID)
|
|
if err != nil {
|
|
if err != nil {
|
|
errMsg = `查询精选留言总数出错`
|
|
errMsg = `查询精选留言总数出错`
|
|
return
|
|
return
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//查询个人留言
|
|
//查询个人留言
|
|
- commentList, err = yb_community_question_comment.GetListByUserIdCommunityQuestionCommentID(userId, communityQuestionCommentID)
|
|
|
|
|
|
+ commentList, err = yb_community_question_comment.GetListByUserIdCommunityQuestionID(userId, communityQuestionID)
|
|
if err != nil {
|
|
if err != nil {
|
|
errMsg = `查询我的留言列表出错`
|
|
errMsg = `查询我的留言列表出错`
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- total, err = yb_community_question_comment.GetListTotalByUserIdCommunityQuestionCommentID(userId, communityQuestionCommentID)
|
|
|
|
|
|
+ total, err = yb_community_question_comment.GetListTotalByUserIdCommunityQuestionID(userId, communityQuestionID)
|
|
if err != nil {
|
|
if err != nil {
|
|
errMsg = `查询我的留言总数出错`
|
|
errMsg = `查询我的留言总数出错`
|
|
return
|
|
return
|