model

package
v0.33.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RevisionTypeSubject                  = 1  // 条目
	RevisionTypeSubjectCharacterRelation = 5  // 条目->角色关联
	RevisionTypeSubjectCastRelation      = 6  // 条目->声优关联
	RevisionTypeSubjectPersonRelation    = 10 // 条目->人物关联
	RevisionTypeSubjectMerge             = 11 // 条目管理
	RevisionTypeSubjectErase             = 12
	RevisionTypeSubjectRelation          = 17 // 条目关联
	RevisionTypeSubjectLock              = 103
	RevisionTypeSubjectUnlock            = 104
	RevisionTypeCharacter                = 2  // 角色
	RevisionTypeCharacterSubjectRelation = 4  // 角色->条目关联
	RevisionTypeCharacterCastRelation    = 7  // 角色->声优关联
	RevisionTypeCharacterMerge           = 13 // 角色管理
	RevisionTypeCharacterErase           = 14
	RevisionTypePerson                   = 3  // 人物
	RevisionTypePersonCastRelation       = 8  // 人物->声优关联
	RevisionTypePersonSubjectRelation    = 9  // 人物->条目关联
	RevisionTypePersonMerge              = 15 // 人物管理
	RevisionTypePersonErase              = 16
	RevisionTypeEp                       = 18  // 章节
	RevisionTypeEpMerge                  = 181 // 章节管理
	RevisionTypeEpMove                   = 182
	RevisionTypeEpLock                   = 183
	RevisionTypeEpUnlock                 = 184
	RevisionTypeEpErase                  = 185
)

Variables

This section is empty.

Functions

func CharacterRevisionTypes

func CharacterRevisionTypes() []uint8

func EpisodeRevisionTypes added in v0.30.0

func EpisodeRevisionTypes() []uint8

func PersonRevisionTypes

func PersonRevisionTypes() []uint8

func SubjectTypeString

func SubjectTypeString(s uint8) string

Types

type Character

type Character struct {
	Name           string
	Image          string
	Infobox        string
	Summary        string
	ID             CharacterID
	Redirect       CharacterID
	CollectCount   uint32
	CommentCount   uint32
	FieldBirthYear uint16
	Producer       bool
	Type           uint8
	Artist         bool
	Seiyu          bool
	Writer         bool
	Illustrator    bool
	Actor          bool
	FieldBloodType uint8
	FieldGender    uint8
	FieldBirthMon  uint8
	Locked         bool
	FieldBirthDay  uint8
	NSFW           bool
}

type CharacterID added in v0.20.2

type CharacterID = uint32

type CharacterRevision

type CharacterRevision struct {
	Data CharacterRevisionData
	RevisionCommon
}

CharacterRevision concrete revision data type.

type CharacterRevisionData

type CharacterRevisionData map[string]CharacterRevisionDataItem

type CharacterRevisionDataItem added in v0.16.9

type CharacterRevisionDataItem struct {
	Name    string `json:"name" mapstructure:"crt_name"`
	InfoBox string `json:"infobox" mapstructure:"crt_infobox"`
	Summary string `json:"summary"`
	Extra   Extra  `json:"extra"`
}

type Count

type Count struct {
	Field1  uint32
	Field2  uint32
	Field3  uint32
	Field4  uint32
	Field5  uint32
	Field6  uint32
	Field7  uint32
	Field8  uint32
	Field9  uint32
	Field10 uint32
}

type EpisodeID added in v0.20.2

type EpisodeID = uint32

type EpisodeRevision added in v0.30.0

type EpisodeRevision struct {
	Data EpisodeRevisionData
	RevisionCommon
}

EpisodeRevision concrete revision data type.

type EpisodeRevisionData added in v0.30.0

type EpisodeRevisionData map[string]EpisodeRevisionDataItem

type EpisodeRevisionDataItem added in v0.30.0

type EpisodeRevisionDataItem struct {
	Airdate  string `json:"airdate" mapstructure:"ep_airdate"`
	Desc     string `json:"desc" mapstructure:"ep_desc"`
	Duration string `json:"duration" mapstructure:"ep_duration"`
	Name     string `json:"name" mapstructure:"ep_name"`
	NameCn   string `json:"name_cn" mapstructure:"ep_name_cn"`
	Sort     string `json:"sort" mapstructure:"ep_sort"`
	Type     string `json:"type" mapstructure:"ep_type"`
}

type Extra

type Extra struct {
	Img string `json:"img,omitempty"`
}

type Group added in v0.20.9

type Group struct {
	CreatedAt   time.Time
	Name        string
	Icon        string
	Description string
	Title       string
	ID          GroupID
	NSFW        bool
	MemberCount int64
}

type GroupID

type GroupID = uint16

type GroupMember added in v0.20.9

type GroupMember struct {
	JoinAt time.Time
	UserID UserID
	Mod    bool
}

type Index

type Index struct {
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Title       string
	Description string
	CreatorID   UserID
	Total       uint32
	ID          IndexID
	Comments    uint32
	Collects    uint32
	NSFW        bool
}

type IndexID added in v0.20.2

type IndexID = uint32

type NotificationFieldID added in v0.29.0

type NotificationFieldID = uint32

type NotificationID added in v0.29.0

type NotificationID = uint32

type Person

type Person struct {
	Name           string
	Image          string
	Infobox        string
	Summary        string
	ID             PersonID
	Redirect       PersonID
	CollectCount   uint32
	CommentCount   uint32
	FieldBirthYear uint16
	Producer       bool
	Mangaka        bool
	Type           uint8
	Artist         bool
	Seiyu          bool
	Writer         bool
	Illustrator    bool
	Actor          bool
	FieldBloodType uint8
	FieldGender    uint8
	FieldBirthMon  uint8
	Locked         bool
	FieldBirthDay  uint8
}

func (Person) Careers

func (p Person) Careers() []string

type PersonCharacterRelation

type PersonCharacterRelation struct {
	Character Character
	Person    Person
	Subject   Subject
}

type PersonID added in v0.20.2

type PersonID = uint32

type PersonRevision added in v0.16.9

type PersonRevision struct {
	Data PersonRevisionData
	RevisionCommon
}

type PersonRevisionData added in v0.16.9

type PersonRevisionData map[string]PersonRevisionDataItem

type PersonRevisionDataItem

type PersonRevisionDataItem struct {
	Name       string     `json:"name" mapstructure:"prsn_name"`
	InfoBox    string     `json:"infobox" mapstructure:"prsn_infobox"`
	Summary    string     `json:"summary" mapstructure:"prsn_summary"`
	Profession Profession `json:"profession"`
	Extra      Extra      `json:"extra"`
}

type Platform

type Platform struct {
	Alias        string `json:"alias"`
	Type         string `json:"type"`
	TypeCN       string `json:"type_cn"`
	WikiTpl      string `json:"wiki_tpl"`
	SearchString string `json:"search_string"`
	ID           int    `json:"id"`
	EnableHeader bool   `json:"enable_header"`
}

func (Platform) String

func (p Platform) String() string

type PrivateMessageID added in v0.29.0

type PrivateMessageID = uint32

type Profession

type Profession struct {
	Writer      string `json:"writer,omitempty"`
	Producer    string `json:"producer,omitempty"`
	Mangaka     string `json:"mangaka,omitempty"`
	Artist      string `json:"artist,omitempty"`
	Seiyu       string `json:"seiyu,omitempty"`
	Illustrator string `json:"illustrator,omitempty"`
	Actor       string `json:"actor,omitempty"`
}

type Rating

type Rating struct {
	Rank  uint32
	Total uint32
	Count Count
	Score float64
}

type RevisionCommon

type RevisionCommon struct {
	CreatedAt time.Time
	Summary   string
	ID        RevisionID
	CreatorID UserID
	Type      uint8
}

RevisionCommon common parts in revision.

type RevisionID added in v0.20.2

type RevisionID = uint32

type RevisionType added in v0.20.2

type RevisionType = uint8

type Subject

type Subject struct {
	Image         string
	Summary       string
	Name          string
	Date          string // first release date
	NameCN        string
	Infobox       string
	CompatRawTags []byte // compat field for old tags
	Tags          []Tag
	OnHold        uint32
	Dropped       uint32
	Series        bool
	Volumes       uint32 // book volumes count from episode
	Eps           uint32 // episode count from episode
	Wish          uint32
	Collect       uint32
	Doing         uint32
	ID            SubjectID
	PlatformID    uint16
	TypeID        SubjectType
	Ban           uint8
	Airtime       uint8 // air weekday, start from
	NSFW          bool
	Rating        Rating
	Redirect      SubjectID
}

func (Subject) GetID added in v0.27.6

func (s Subject) GetID() SubjectID

func (Subject) Locked

func (s Subject) Locked() bool

type SubjectCharacterRelation

type SubjectCharacterRelation struct {
	Character Character
	Subject   Subject
	TypeID    uint8
}

type SubjectID added in v0.20.2

type SubjectID = uint32

type SubjectInternalRelation

type SubjectInternalRelation struct {
	Source      Subject
	Destination Subject
	TypeID      uint16
}

type SubjectPersonRelation

type SubjectPersonRelation struct {
	Person  Person
	Subject Subject
	TypeID  uint16
}

type SubjectRevision added in v0.16.9

type SubjectRevision struct {
	Data *SubjectRevisionData
	RevisionCommon
}

type SubjectRevisionData

type SubjectRevisionData struct {
	Name         string
	NameCN       string
	VoteField    string
	FieldInfobox string
	FieldSummary string
	Platform     uint16
	TypeID       uint16
	SubjectID    SubjectID
	FieldEps     uint32
	Type         uint8
}

type SubjectType

type SubjectType = uint8
const (
	SubjectTypeAll   SubjectType = 0
	SubjectTypeBook  SubjectType = 1 // 书籍
	SubjectTypeAnime SubjectType = 2 // 动画
	SubjectTypeMusic SubjectType = 3 // 音乐
	SubjectTypeGame  SubjectType = 4 // 游戏
	SubjectTypeReal  SubjectType = 6 // 三次元
)

type Tag added in v0.21.1

type Tag struct {
	Name  string
	Count int
}

type TimeLineCat added in v0.25.7

type TimeLineCat = uint16

type TimeLineID added in v0.25.7

type TimeLineID = uint32

type TopicID added in v0.22.0

type TopicID = uint32

type UserID added in v0.20.2

type UserID = uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL