|
@@ -16,7 +16,7 @@ import (
|
|
|
)
|
|
|
|
|
|
// GetQuestionList 获取问答列表
|
|
|
-func GetQuestionList(pageIndex, pageSize, onlyMine, chartPermissionId, replyStatus, replierUserId int, userInfo user.UserInfo) (resp *response.CommunityQuestionList, err error) {
|
|
|
+func GetQuestionList(pageIndex, pageSize, onlyMine, chartPermissionId, replyStatus, replierUserId int, userInfo user.UserInfo) (resp []*response.CommunityQuestionItem, err error) {
|
|
|
condition := make(map[string]interface{})
|
|
|
condition["is_deleted ="] = 0
|
|
|
// 用户身份
|
|
@@ -75,8 +75,7 @@ func GetQuestionList(pageIndex, pageSize, onlyMine, chartPermissionId, replyStat
|
|
|
}
|
|
|
|
|
|
userId := int(userInfo.UserID)
|
|
|
- resp = new(response.CommunityQuestionList)
|
|
|
- respList := make([]*response.CommunityQuestionItem, 0)
|
|
|
+ resp = make([]*response.CommunityQuestionItem, 0)
|
|
|
for _, v := range questionList {
|
|
|
audios := make([]*response.CommunityQuestionAudioItem, 0)
|
|
|
for _, a := range audioList {
|
|
@@ -114,10 +113,8 @@ func GetQuestionList(pageIndex, pageSize, onlyMine, chartPermissionId, replyStat
|
|
|
if !isAdmin && item.IsRead == 0 && item.UserId == userId {
|
|
|
item.IsTop = 1
|
|
|
}
|
|
|
- respList = append(respList, item)
|
|
|
+ resp = append(resp, item)
|
|
|
}
|
|
|
- resp.QuestionList = respList
|
|
|
- //resp.PermissionInfo = permissionInfo
|
|
|
return
|
|
|
}
|
|
|
|