model

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 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
)
View Source
const (
	// CollectPrivacyNone 默认公开收藏。
	CollectPrivacyNone = 0
	// CollectPrivacySelf 私有收藏,正常计入评分。
	CollectPrivacySelf = 1
	// CollectPrivacyBan Shadow Ban, 显示为私有收藏,不计入评分。
	CollectPrivacyBan = 2
)

Variables

This section is empty.

Functions

func CharacterRevisionTypes

func CharacterRevisionTypes() []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             uint32
	Redirect       uint32
	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 CharacterIDType

type CharacterIDType = uint32

type CharacterRevision

type CharacterRevision struct {
	Data CharacterRevisionData
	RevisionCommon
}

CharacterRevision concrete revision data type.

type CharacterRevisionData

type CharacterRevisionData struct {
	CharacterRevisionEdit
}

type CharacterRevisionEdit

type CharacterRevisionEdit map[string]CharacterRevisionEditItem

type CharacterRevisionEditItem

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

type Collection

type Collection struct {
	UpdatedAt   time.Time
	Comment     string
	Tags        []string
	VolStatus   uint32
	EpStatus    uint32
	SubjectID   uint32
	SubjectType uint8
	Rate        uint8
	Type        uint8
	Private     bool
}

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 Creator

type Creator struct {
	Username string
	Nickname string
}

type EpTypeType

type EpTypeType = int8

type Episode

type Episode struct {
	Airdate     string
	Name        string
	NameCN      string
	Duration    string
	Description string
	Ep          float32
	SubjectID   uint32
	Sort        float32
	Comment     uint32
	ID          uint32
	Type        int8
	Disc        uint8
}

type EpisodeIDType

type EpisodeIDType = uint32

type Extra

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

type GroupID

type GroupID = uint8

type Index

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

type Person

type Person struct {
	Name           string
	Image          string
	Infobox        string
	Summary        string
	ID             uint32
	Redirect       uint32
	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 PersonIDType

type PersonIDType = uint32

type PersonRevisionDataItem

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

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 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 Revision

type Revision struct {
	Data      interface{}
	CreatedAt time.Time
	Summary   string
	Type      uint8
	ID        uint32
	CreatorID uint32
}

type RevisionCommon

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

RevisionCommon common parts in revision. TODO: rename RevisionCommon to Revision and replace the latter.

type RevisionTypeType

type RevisionTypeType = 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
	OnHold        uint32
	Dropped       uint32
	Volumes       uint32
	Eps           uint32
	Wish          uint32
	Collect       uint32
	Doing         uint32
	ID            uint32
	PlatformID    uint16
	TypeID        SubjectType
	Ban           uint8
	Airtime       uint8 // air weekday, start from
	NSFW          bool
	Rating        Rating
	Redirect      uint32
}

func (Subject) Locked

func (s Subject) Locked() bool

type SubjectCharacterRelation

type SubjectCharacterRelation struct {
	Character Character
	Subject   Subject
	TypeID    uint8
}

type SubjectIDType

type SubjectIDType = uint32 // in case we need future change, but I guess not...

type SubjectInternalRelation

type SubjectInternalRelation struct {
	Source      Subject
	Destination Subject
	TypeID      uint16
}

type SubjectPersonRelation

type SubjectPersonRelation struct {
	Person  Person
	Subject Subject
	TypeID  uint16
}

type SubjectRevisionData

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

type SubjectType

type SubjectType = uint8
const (
	SubjectBook SubjectType = iota + 1
	SubjectAnime
	SubjectMusic
	SubjectGame

	SubjectReal
)

type UIDType

type UIDType = uint32 // UserID

type User

type User struct {
	RegistrationTime time.Time
	NickName         string
	Avatar           string
	Sign             string
	UserName         string
	ID               uint32
	UserGroup        GroupID
}

User is visible for everyone.

Jump to

Keyboard shortcuts

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