mirror of https://gitee.com/answerdev/answer.git
update question
This commit is contained in:
parent
ca6d8fb5a8
commit
1a814da53b
|
@ -215,14 +215,16 @@ type UserAnswerInfo struct {
|
|||
CreateTime int `json:"create_time"`
|
||||
UpdateTime int `json:"update_time"`
|
||||
QuestionInfo struct {
|
||||
Title string `json:"title"`
|
||||
Tags []interface{} `json:"tags"`
|
||||
Title string `json:"title"`
|
||||
UrlTitle string `json:"url_title"`
|
||||
Tags []interface{} `json:"tags"`
|
||||
} `json:"question_info"`
|
||||
}
|
||||
|
||||
type UserQuestionInfo struct {
|
||||
ID string `json:"question_id"`
|
||||
Title string `json:"title"`
|
||||
UrlTitle string `json:"url_title"`
|
||||
VoteCount int `json:"vote_count"`
|
||||
Tags []interface{} `json:"tags"`
|
||||
ViewCount int `json:"view_count"`
|
||||
|
|
|
@ -834,6 +834,7 @@ func (qs *QuestionService) SearchUserTopList(ctx context.Context, userName strin
|
|||
for _, item := range questionlist {
|
||||
info := &schema.UserQuestionInfo{}
|
||||
_ = copier.Copy(info, item)
|
||||
info.UrlTitle = htmltext.UrlTitle(info.Title)
|
||||
userQuestionlist = append(userQuestionlist, info)
|
||||
}
|
||||
|
||||
|
@ -842,6 +843,7 @@ func (qs *QuestionService) SearchUserTopList(ctx context.Context, userName strin
|
|||
_ = copier.Copy(info, item)
|
||||
info.AnswerID = item.ID
|
||||
info.QuestionID = item.QuestionID
|
||||
info.QuestionInfo.UrlTitle = htmltext.UrlTitle(info.QuestionInfo.Title)
|
||||
userAnswerlist = append(userAnswerlist, info)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue