123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- package model
- import (
- "fmt"
- "go-common/library/time"
- )
- const (
-
- ModulesNotDelete = 0
-
- ModulesDelete = 1
-
- ModulesValid = 1
-
- ModulesPublishYes = 1
-
- ModulesPublishNo = 0
-
- PageMain = 0
-
- PageJP = 1
-
- PageMovie = 2
-
- PageDocumentary = 3
-
- PageCN = 4
-
- PageSoapopera = 5
-
- TypeSevenFocus = 1
-
- TypeFiveFocus = 2
-
- TypeSixFocus = 3
-
- TypeVertListFirst = 4
-
- TypeVertListSecond = 5
-
- TypeHorizList = 6
-
- TypeZhuiFan = 7
- )
- type Modules struct {
- ID uint64 `json:"id"`
- PageID string `json:"page_id" form:"page_id" validate:"required"`
- Flexible string `json:"flexible" form:"flexible" validate:"required"`
- Icon string `json:"icon" form:"icon"`
- Title string `json:"title" form:"title" validate:"required"`
- Capacity uint64 `json:"capacity" form:"capacity" validate:"required"`
- More string `json:"more" form:"more" validate:"required"`
- Order uint8 `json:"order"`
- Moretype string `json:"moretype" form:"moretype"`
- Morepage int64 `json:"morepage" form:"morepage"`
- Deleted uint8 `json:"-"`
- Valid uint8 `json:"valid"`
- ModCore
- }
- type ModulesAddParam struct {
- ID uint64 `form:"id" validate:"required"`
- PageID string `form:"page_id" validate:"required"`
- Flexible string `form:"flexible" validate:"required"`
- Icon string `form:"icon"`
- Title string `form:"title" validate:"required"`
- Capacity uint64 `form:"capacity" validate:"required"`
- More string `form:"more" validate:"required"`
- Moretype string `json:"moretype" form:"moretype"`
- Morepage int64 `json:"morepage" form:"morepage"`
- Order uint8
- ModCore
- }
- type ModCore struct {
- Type string `json:"type" form:"type" validate:"required"`
- Source string `json:"source" form:"source" validate:"required"`
- SrcType int `json:"src_type" form:"src_type" validate:"required"`
- }
- type ModPub struct {
- Time string
- State uint8
- }
- type ModulesList struct {
- Items []*Modules `json:"items"`
- PubState uint8 `json:"pubstate"`
- PubTime string `json:"pubtime"`
- }
- func (a Modules) TableName() string {
- return "tv_modules"
- }
- type CommonCat struct {
- ID int32 `json:"id"`
- PID int32 `json:"pid"`
- Name string `json:"name"`
- Type int `json:"type"`
- }
- type ParentCat struct {
- ID int32 `json:"id"`
- Name string `json:"name"`
- Type int `json:"type"`
- Children []*CommonCat `json:"children,omitempty"`
- }
- type SupCats struct {
- UgcMap map[int32]int
- PgcMap map[int32]int
- }
- type AbnorCids struct {
- CID int64 `json:"cid"`
- VideoTitle string `json:"video_title"`
- CTime string `json:"ctime"`
- AID int64 `json:"aid"`
- ArcTitle string `json:"arc_title"`
- PubTime string `json:"pub_time"`
- }
- func (v *AbnorCids) Export() (res []string) {
- res = append(res, fmt.Sprintf("%d", v.CID))
- res = append(res, v.VideoTitle)
- res = append(res, v.CTime)
- res = append(res, fmt.Sprintf("%d", v.AID))
- res = append(res, v.ArcTitle)
- res = append(res, v.PubTime)
- return
- }
- type AbnorVideo struct {
- CID int64
- VideoTitle string
- CTime time.Time
- AID int64
- }
- func (v *AbnorVideo) ToCids(arc *Archive) *AbnorCids {
- return &AbnorCids{
- CID: v.CID,
- VideoTitle: v.VideoTitle,
- CTime: v.CTime.Time().Format("2006-01-02 15:04:05"),
- AID: v.AID,
- ArcTitle: arc.Title,
- PubTime: arc.Pubtime.Time().Format("2006-01-02 15:04:05"),
- }
- }
|