|
package published
|
|
|
|
import (
|
|
"errors"
|
|
"encoding/json"
|
|
"database/sql/driver"
|
|
//"time"
|
|
"cygnux/kepler/models"
|
|
"cygnux/kepler/models/metas"
|
|
)
|
|
|
|
//type HStore map[string]string
|
|
//type HStoreList []HStore
|
|
|
|
type PublishedCategoryFilterTag struct {
|
|
Name string `json:"n"`
|
|
Value string `json:"v"`
|
|
Remark string `json:"s"`
|
|
}
|
|
|
|
type PublishedCategoryFilter struct {
|
|
Name string `json:"ns"`
|
|
Expression string `json:"exp"`
|
|
Tags []PublishedCategoryFilterTag `json:"tags"`
|
|
}
|
|
|
|
type PublishedCategoryFilterList []*PublishedCategoryFilter
|
|
|
|
func (p *PublishedCategoryFilterList) Scan(src interface{}) error {
|
|
source, ok := src.([]byte)
|
|
if !ok {
|
|
return errors.New("Type assertion .([]byte) failed.")
|
|
}
|
|
var i PublishedCategoryFilterList
|
|
err := json.Unmarshal(source, &i)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*p = i
|
|
return nil
|
|
}
|
|
|
|
func (p PublishedCategoryFilterList) Value() (driver.Value, error) {
|
|
j, err := json.Marshal(p)
|
|
return j, err
|
|
}
|
|
|
|
const PUBLISHEDVODCATEGORY = "published_vod_categories"
|
|
|
|
type PublishedVodCategory struct {
|
|
metas.VodCategory
|
|
//Id string `json:"id"`
|
|
//CategoryName string `json:"categoryName"`
|
|
//Index int `json:"index,omitempty" xql:"idx"`
|
|
//Icon string `json:"icon,omitempty"`
|
|
//Type int `json:"type,omitempty"`
|
|
Filters PublishedCategoryFilterList `json:"filters,omitempty"`
|
|
//Description string `json:"description,omitempty"`
|
|
//Created *time.Time `json:"created,omitempty"`
|
|
//Updated *time.Time `json:"updated,omitempty"`
|
|
}
|
|
|
|
const PUBLISHEDVODALBUM = "published_vod_albums"
|
|
|
|
type PublishedVodAlbum struct {
|
|
metas.VodAlbum `xql:"skips:ProviderId;"`
|
|
//Id string `json:"id"`
|
|
//AlbumName string `json:"albumName"`
|
|
NameInitials string `json:"nameInitials,omitempty" xql:"name_initials"`
|
|
//IsSeries bool `json:"isSeries"`
|
|
//FilmTotal int `json:"filmTotal"`
|
|
//FilmCount int `json:"filmCount"`
|
|
//FilmIndex int `json:"filmIndex"`
|
|
//Remark string `json:"remark"`
|
|
//Index int `json:"-" xql:"idx"`
|
|
FilmId string `json:"filmId" xql:"-"`
|
|
Duration int `json:"duration" xql:"-"`
|
|
Played int64 `json:"played" xql:"-"`
|
|
Viewed int64 `json:"viewed" xql:"-"`
|
|
//AlbumPicture string `json:"albumPicture"`
|
|
Language string `json:"language" xql:"-"`
|
|
//IssueDate string `json:"issueDate,omitempty"`
|
|
//PublishTime *time.Time `json:"publishTime,omitempty"`
|
|
//Score float32 `json:"score,omitempty"`
|
|
//ContentRating string `json:"contentRating"`
|
|
ProviderName string `json:"providerName,omitempty"`
|
|
Categories models.HSTOREDictionary `json:"categories,omitempty"`
|
|
Tags models.StringArray `json:"tags,omitempty"`
|
|
Geniuses models.StringArray `json:"geniuses,omitempty"`
|
|
Crews models.JSONDictionary `json:"crews,omitempty"`
|
|
Videos models.JSONDictionaryArray `json:"videos,omitempty" xql:"-"`
|
|
ScreenShots models.StringArray `json:"screenShots,omitempty" xql:"-"`
|
|
VIPInfo models.JSONDictionary `json:"vipInfo,omitempty" xql:"vip_info"`
|
|
PlayControl models.JSONDictionary `json:"playCtrl,omitempty" xql:"-"`
|
|
//Description string `json:"description,omitempty"`
|
|
//Created *time.Time `json:"created,omitempty"`
|
|
//Updated *time.Time `json:"updated,omitempty"`
|
|
Films interface{} `json:"films,omitempty" xql:"-"`
|
|
RelatedAlbums interface{} `json:"relatedAlbums,omitempty" xql:"-"`
|
|
}
|
|
|
|
const PUBLISHEDVODFILM = "published_vod_films"
|
|
|
|
type PublishedVodFilm struct {
|
|
metas.VodFilm //`xql:"skips:Id;"`
|
|
AlbumId string `json:"albumId" xql:"album_id,pk"`
|
|
FilmId string `json:"filmId" xql:"film_id,pk"`
|
|
//FilmName string `json:"filmName"`
|
|
Index int `json:"index" xql:"idx"`
|
|
//Duration int `json:"duration"`
|
|
Played int64 `json:"played"`
|
|
Viewed int64 `json:"viewed"`
|
|
//FilmPicture string `json:"filmPicture"`
|
|
//Remark string `json:"remark"`
|
|
//Language string `json:"language"`
|
|
//IssueDate string `json:"issueDate,omitempty"`
|
|
PlayControl models.JSONDictionary `json:"playCtrl,omitempty" xql:"play_ctrl"`
|
|
Crews models.JSONDictionary `json:"crews,omitempty"`
|
|
Videos models.JSONDictionaryArray `json:"videos,omitempty"`
|
|
ScreenShots models.StringArray `json:"screenShots,omitempty"`
|
|
//Description string `json:"description,omitempty"`
|
|
//Created *time.Time `json:"created,omitempty"`
|
|
//Updated *time.Time `json:"updated,omitempty"`
|
|
}
|
|
|
|
const PUBLISHEDVODRECOMMENDALBUM = "published_vod_recommend_albums"
|
|
|
|
type PublishedVodRecommendAlbum struct {
|
|
AlbumId string `json:"albumId"`
|
|
AlbumName string `json:"albumName"`
|
|
Score float32 `json:"score,omitempty"`
|
|
Remark string `json:"remark"`
|
|
Poster string `json:"poster"`
|
|
Categories models.HSTOREDictionary `json:"categories"`
|
|
}
|