127 lines
3.0 KiB
Go
127 lines
3.0 KiB
Go
// Package model 提供播客和剧集的数据模型
|
|
package model
|
|
|
|
// ChartResult 表示Apple Podcasts排行榜结果
|
|
type ChartResult struct {
|
|
Feed Feed `json:"feed"`
|
|
}
|
|
|
|
// Feed 表示排行榜的Feed信息
|
|
type Feed struct {
|
|
Author Author `json:"author"`
|
|
Entry []Entry `json:"entry"`
|
|
}
|
|
|
|
// Author 表示Feed的作者信息
|
|
type Author struct {
|
|
Name NameLabel `json:"name"`
|
|
URI URILabel `json:"uri"`
|
|
}
|
|
|
|
// NameLabel 表示带标签的名称
|
|
type NameLabel struct {
|
|
Label string `json:"label"`
|
|
}
|
|
|
|
// URILabel 表示带标签的URI
|
|
type URILabel struct {
|
|
Label string `json:"label"`
|
|
}
|
|
|
|
// Entry 表示排行榜中的一个播客条目
|
|
type Entry struct {
|
|
Name NameLabel `json:"im:name"`
|
|
Image []Image `json:"im:image"`
|
|
Summary NameLabel `json:"summary"`
|
|
Price Price `json:"im:price"`
|
|
ContentType ContentType `json:"im:contentType"`
|
|
Rights NameLabel `json:"rights"`
|
|
Title NameLabel `json:"title"`
|
|
Link Link `json:"link"`
|
|
ID ID `json:"id"`
|
|
Artist NameLabel `json:"im:artist"`
|
|
Category Category `json:"category"`
|
|
ReleaseDate ReleaseDate `json:"im:releaseDate"`
|
|
}
|
|
|
|
// Image 表示播客的图片信息
|
|
type Image struct {
|
|
Label string `json:"label"`
|
|
Attributes ImageAttribute `json:"attributes"`
|
|
}
|
|
|
|
// ImageAttribute 表示图片的属性
|
|
type ImageAttribute struct {
|
|
Height string `json:"height"`
|
|
}
|
|
|
|
// Price 表示播客的价格信息
|
|
type Price struct {
|
|
Label string `json:"label"`
|
|
Attributes PriceAttributes `json:"attributes"`
|
|
}
|
|
|
|
// PriceAttributes 表示价格的属性
|
|
type PriceAttributes struct {
|
|
Amount string `json:"amount"`
|
|
Currency string `json:"currency"`
|
|
}
|
|
|
|
// ContentType 表示内容类型
|
|
type ContentType struct {
|
|
Attributes ContentTypeAttributes `json:"attributes"`
|
|
}
|
|
|
|
// ContentTypeAttributes 表示内容类型的属性
|
|
type ContentTypeAttributes struct {
|
|
Term string `json:"term"`
|
|
Label string `json:"label"`
|
|
}
|
|
|
|
// Link 表示链接信息
|
|
type Link struct {
|
|
Attributes LinkAttributes `json:"attributes"`
|
|
}
|
|
|
|
// LinkAttributes 表示链接的属性
|
|
type LinkAttributes struct {
|
|
Rel string `json:"rel"`
|
|
Type string `json:"type"`
|
|
Href string `json:"href"`
|
|
}
|
|
|
|
// ID 表示播客的ID信息
|
|
type ID struct {
|
|
Label string `json:"label"`
|
|
Attributes IDAttributes `json:"attributes"`
|
|
}
|
|
|
|
// IDAttributes 表示ID的属性
|
|
type IDAttributes struct {
|
|
ID string `json:"im:id"`
|
|
}
|
|
|
|
// Category 表示播客的分类信息
|
|
type Category struct {
|
|
Attributes CategoryAttributes `json:"attributes"`
|
|
}
|
|
|
|
// CategoryAttributes 表示分类的属性
|
|
type CategoryAttributes struct {
|
|
ID string `json:"im:id"`
|
|
Term string `json:"term"`
|
|
Scheme string `json:"scheme"`
|
|
Label string `json:"label"`
|
|
}
|
|
|
|
// ReleaseDate 表示发布日期信息
|
|
type ReleaseDate struct {
|
|
Label string `json:"label"`
|
|
Attributes ReleaseDateAttributes `json:"attributes"`
|
|
}
|
|
|
|
// ReleaseDateAttributes 表示发布日期的属性
|
|
type ReleaseDateAttributes struct {
|
|
Label string `json:"label"`
|
|
}
|