mirror of https://gitee.com/answerdev/answer.git
add AcceptedAnswerItem
This commit is contained in:
parent
0954b5ff11
commit
ff69966e82
|
@ -316,6 +316,16 @@ func (qc *QuestionController) UpdateQuestion(ctx *gin.Context) {
|
|||
// TODO: pass errFields and return errors
|
||||
log.Info(errFields)
|
||||
|
||||
// errMsg := fmt.Sprintf(`The reserved tag "%s" must be present.`,
|
||||
// strings.Join(CheckOldTaglist, ","))
|
||||
// errorlist := make([]*validator.FormErrorField, 0)
|
||||
// errorlist = append(errorlist, &validator.FormErrorField{
|
||||
// ErrorField: "tags",
|
||||
// ErrorMsg: errMsg,
|
||||
// })
|
||||
// err = errors.BadRequest(reason.RequestFormatError).WithMsg(errMsg)
|
||||
// return errorlist, err
|
||||
|
||||
resp, err := qc.questionService.UpdateQuestion(ctx, req)
|
||||
if err != nil {
|
||||
handler.HandleResponse(ctx, err, resp)
|
||||
|
|
|
@ -24,10 +24,18 @@ type QAPageJsonLD struct {
|
|||
Type string `json:"@type"`
|
||||
Name string `json:"name"`
|
||||
} `json:"author"`
|
||||
AcceptedAnswer AcceptedAnswerItem `json:"acceptedAnswer"`
|
||||
SuggestedAnswer []*SuggestedAnswerItem `json:"suggestedAnswer"`
|
||||
} `json:"mainEntity"`
|
||||
}
|
||||
|
||||
type AcceptedAnswerItem struct {
|
||||
Type string `json:"@type"`
|
||||
Text string `json:"text"`
|
||||
UpvoteCount int `json:"upvoteCount"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type SuggestedAnswerItem struct {
|
||||
Type string `json:"@type"`
|
||||
Text string `json:"text"`
|
||||
|
|
Loading…
Reference in New Issue