answer/internal/schema/template_schema.go

55 lines
1.4 KiB
Go
Raw Normal View History

2022-11-30 16:18:23 +08:00
package schema
2022-12-02 16:16:49 +08:00
import "time"
2022-11-30 16:18:23 +08:00
type Paginator struct {
Pages []int
Totalpages int
2022-11-30 16:27:23 +08:00
Prevpage int
Nextpage int
2022-11-30 16:18:23 +08:00
Currpage int
}
2022-12-02 16:16:49 +08:00
type QAPageJsonLD struct {
Context string `json:"@context"`
Type string `json:"@type"`
MainEntity struct {
Type string `json:"@type"`
Name string `json:"name"`
Text string `json:"text"`
AnswerCount int `json:"answerCount"`
UpvoteCount int `json:"upvoteCount"`
DateCreated time.Time `json:"dateCreated"`
Author struct {
Type string `json:"@type"`
Name string `json:"name"`
} `json:"author"`
2022-12-13 17:58:48 +08:00
AcceptedAnswer *AcceptedAnswerItem `json:"acceptedAnswer,omitempty"`
2022-12-02 16:16:49 +08:00
SuggestedAnswer []*SuggestedAnswerItem `json:"suggestedAnswer"`
} `json:"mainEntity"`
}
2022-12-09 11:12:25 +08:00
type AcceptedAnswerItem struct {
2022-12-13 17:58:48 +08:00
Type string `json:"@type"`
Text string `json:"text"`
DateCreated time.Time `json:"dateCreated"`
UpvoteCount int `json:"upvoteCount"`
URL string `json:"url"`
2022-12-09 11:18:04 +08:00
Author struct {
Type string `json:"@type"`
Name string `json:"name"`
} `json:"author"`
2022-12-09 11:12:25 +08:00
}
2022-12-02 16:16:49 +08:00
type SuggestedAnswerItem struct {
Type string `json:"@type"`
Text string `json:"text"`
DateCreated time.Time `json:"dateCreated"`
UpvoteCount int `json:"upvoteCount"`
URL string `json:"url"`
Author struct {
Type string `json:"@type"`
Name string `json:"name"`
} `json:"author"`
}