dao

package
v0.20.8 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: AGPL-3.0, AGPL-3.0-only Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const FieldTypeCharacter = "crt"
View Source
const FieldTypePerson = "prsn"
View Source
const TableNameAccessToken = "chii_oauth_access_tokens"
View Source
const TableNameApp = "chii_apps"
View Source
const TableNameCast = "chii_crt_cast_index"
View Source
const TableNameCharacter = "chii_characters"
View Source
const TableNameCharacterSubjects = "chii_crt_subject_index"
View Source
const TableNameEpisode = "chii_episodes"
View Source
const TableNameIndex = "chii_index"
View Source
const TableNameIndexSubject = "chii_index_related"
View Source
const TableNameMember = "chii_members"
View Source
const TableNameMemberField = "chii_memberfields"
View Source
const TableNameOAuthClient = "chii_oauth_clients"
View Source
const TableNamePerson = "chii_persons"
View Source
const TableNamePersonField = "chii_person_fields"
View Source
const TableNamePersonSubjects = "chii_person_cs_index"
View Source
const TableNameRevisionHistory = "chii_rev_history"
View Source
const TableNameRevisionText = "chii_rev_text"
View Source
const TableNameSubject = "chii_subjects"
View Source
const TableNameSubjectCollection = "chii_subject_interests"
View Source
const TableNameSubjectField = "chii_subject_fields"
View Source
const TableNameSubjectRelation = "chii_subject_relations"
View Source
const TableNameSubjectRevision = "chii_subject_revisions"
View Source
const TableNameUserGroup = "chii_usergroup"
View Source
const TableNameWebSession = "chii_os_web_sessions"

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken added in v0.18.0

type AccessToken struct {
	ID          uint32    `gorm:"column:id;type:mediumint(8);primaryKey;autoIncrement:true"`
	Type        uint8     `gorm:"column:type;type:tinyint(1) unsigned;not null;index:type,priority:1"`
	AccessToken string    `gorm:"column:access_token;type:varchar(40);not null;uniqueIndex:access_token,priority:1"`
	ClientID    string    `gorm:"column:client_id;type:varchar(80);not null"`
	UserID      string    `gorm:"column:user_id;type:varchar(80)"`
	ExpiredAt   time.Time `gorm:"column:expires;type:timestamp;not null;default:CURRENT_TIMESTAMP"`
	Scope       *string   `gorm:"column:scope;type:varchar(4000)"`
	Info        []byte    `gorm:"column:info;type:varchar(255);not null"`
}

AccessToken mapped from table <chii_oauth_access_tokens>

func (*AccessToken) TableName added in v0.18.0

func (*AccessToken) TableName() string

TableName AccessToken's table name

type App added in v0.19.0

type App struct {
	ID          uint32       `gorm:"column:app_id;type:mediumint(8);primaryKey;autoIncrement:true"`
	Type        uint8        `gorm:"column:app_type;type:tinyint(1);not null;index:app_type,priority:1"`
	Creator     model.UserID `gorm:"column:app_creator;type:mediumint(8);not null;index:app_type,priority:2"`
	Name        string       `gorm:"column:app_name;type:varchar(255);not null"`
	Description string       `gorm:"column:app_desc;type:mediumtext;not null"`
	URL         string       `gorm:"column:app_url;type:varchar(2000);not null"`
	Collects    int32        `gorm:"column:app_collects;type:mediumint(8);not null"`
	Status      bool         `gorm:"column:app_status;type:tinyint(1);not null;index:app_status,priority:1"`
	CreatedAt   int32        `gorm:"column:app_timestamp;type:int(10);not null"`
	UpdatedAt   int32        `gorm:"column:app_lasttouch;type:int(10);not null"`
	Ban         bool         `gorm:"column:app_ban;type:tinyint(1);not null;index:app_ban,priority:1"`
}

App mapped from table <chii_apps>

func (*App) TableName added in v0.19.0

func (*App) TableName() string

TableName App's table name

type Cast

type Cast struct {
	CharacterID   model.CharacterID `gorm:"column:crt_id;type:mediumint(9) unsigned;primaryKey"`
	PersonID      model.PersonID    `gorm:"column:prsn_id;type:mediumint(9) unsigned;primaryKey;index:prsn_id,priority:1"`
	SubjectID     model.SubjectID   `gorm:"column:subject_id;type:mediumint(9) unsigned;primaryKey;index:subject_id,priority:1"`
	SubjectTypeID uint8             `gorm:"column:subject_type_id;type:tinyint(3) unsigned;not null;index:subject_type_id,priority:1"` // 根据人物归类查询角色,动画,书籍,游戏
	Summary       string            `gorm:"column:summary;type:varchar(255);not null"`                                                 // 幼年,男乱马,女乱马,变身形态,少女形态。。
	Character     Character         `gorm:"foreignKey:crt_id;references:crt_id" json:"character"`
	Subject       Subject           `gorm:"foreignKey:subject_id;references:subject_id" json:"subject"`
	Person        Person            `gorm:"foreignKey:prsn_id;references:prsn_id" json:"person"`
}

Cast mapped from table <chii_crt_cast_index>

func (*Cast) TableName

func (*Cast) TableName() string

TableName Cast's table name

type Character

type Character struct {
	ID       model.CharacterID `gorm:"column:crt_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true"`
	Name     string            `gorm:"column:crt_name;type:varchar(255);not null"`
	Role     uint8             `gorm:"column:crt_role;type:tinyint(4) unsigned;not null;index:crt_role,priority:1"` // 角色,机体,组织。。
	Infobox  string            `gorm:"column:crt_infobox;type:mediumtext;not null"`
	Summary  string            `gorm:"column:crt_summary;type:mediumtext;not null"`
	Img      string            `gorm:"column:crt_img;type:varchar(255);not null"`
	Comment  uint32            `gorm:"column:crt_comment;type:mediumint(9) unsigned;not null"`
	Collects uint32            `gorm:"column:crt_collects;type:mediumint(8) unsigned;not null"`
	Dateline uint32            `gorm:"column:crt_dateline;type:int(10) unsigned;not null"`
	Lastpost uint32            `gorm:"column:crt_lastpost;type:int(11) unsigned;not null"`
	Lock     int8              `gorm:"column:crt_lock;type:tinyint(4);not null;index:crt_lock,priority:1"`
	ImgAnidb string            `gorm:"column:crt_img_anidb;type:varchar(255);not null"`
	AnidbID  uint32            `gorm:"column:crt_anidb_id;type:mediumint(8) unsigned;not null"`
	Ban      uint8             `gorm:"column:crt_ban;type:tinyint(3) unsigned;not null;index:crt_ban,priority:1"`
	Redirect model.CharacterID `gorm:"column:crt_redirect;type:int(10) unsigned;not null"`
	Nsfw     bool              `gorm:"column:crt_nsfw;type:tinyint(1) unsigned;not null"`
	Fields   PersonField       `gorm:"foreignKey:crt_id;polymorphic:Owner;polymorphicValue:crt" json:"fields"`
}

Character mapped from table <chii_characters>

func (*Character) TableName

func (*Character) TableName() string

TableName Character's table name

type CharacterSubjects

type CharacterSubjects struct {
	CharacterID   model.CharacterID `gorm:"column:crt_id;type:mediumint(9) unsigned;primaryKey"`
	SubjectID     model.SubjectID   `gorm:"column:subject_id;type:mediumint(9) unsigned;primaryKey;index:subject_id,priority:1"`
	SubjectTypeID uint8             `gorm:"column:subject_type_id;type:tinyint(4) unsigned;not null;index:subject_type_id,priority:1"`
	CrtType       uint8             `gorm:"column:crt_type;type:tinyint(4) unsigned;not null;index:crt_type,priority:1"` // 主角,配角
	CtrAppearEps  string            `gorm:"column:ctr_appear_eps;type:mediumtext;not null"`                              // 可选,角色出场的的章节
	CrtOrder      uint8             `gorm:"column:crt_order;type:tinyint(3) unsigned;not null"`
	Character     Character         `gorm:"foreignKey:crt_id;references:crt_id" json:"character"`
	Subject       Subject           `gorm:"foreignKey:subject_id;references:subject_id" json:"subject"`
}

CharacterSubjects mapped from table <chii_crt_subject_index>

func (*CharacterSubjects) TableName

func (*CharacterSubjects) TableName() string

TableName CharacterSubjects's table name

type Episode

type Episode struct {
	ID        model.EpisodeID `gorm:"column:ep_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true"`
	SubjectID model.SubjectID `` /* 127-byte string literal not displayed */
	Sort      float32         `gorm:"column:ep_sort;type:float unsigned;not null;index:ep_sort,priority:1;index:ep_subject_id_2,priority:3"`
	Type      int16           `gorm:"column:ep_type;type:tinyint(1) unsigned;not null"`
	Disc      uint8           `gorm:"column:ep_disc;type:tinyint(3) unsigned;not null;index:ep_disc,priority:1"` // 碟片数
	Name      string          `gorm:"column:ep_name;type:varchar(80);not null"`
	NameCn    string          `gorm:"column:ep_name_cn;type:varchar(80);not null"`
	Rate      int8            `gorm:"column:ep_rate;type:tinyint(3);not null"`
	Duration  string          `gorm:"column:ep_duration;type:varchar(80);not null"`
	Airdate   string          `gorm:"column:ep_airdate;type:varchar(80);not null"`
	Online    string          `gorm:"column:ep_online;type:mediumtext;not null"`
	Comment   uint32          `gorm:"column:ep_comment;type:mediumint(8) unsigned;not null"`
	Resources uint32          `gorm:"column:ep_resources;type:mediumint(8) unsigned;not null"`
	Desc      string          `gorm:"column:ep_desc;type:mediumtext;not null"`
	Dateline  uint32          `gorm:"column:ep_dateline;type:int(10) unsigned;not null"`
	Lastpost  uint32          `gorm:"column:ep_lastpost;type:int(10) unsigned;not null;index:ep_lastpost,priority:1"`
	Lock      uint8           `gorm:"column:ep_lock;type:tinyint(3) unsigned;not null"`
	Ban       uint8           `gorm:"column:ep_ban;type:tinyint(3) unsigned;not null;index:ep_ban,priority:1;index:ep_subject_id_2,priority:2"`
	Subject   Subject         `gorm:"foreignKey:ep_subject_id;references:subject_id" json:"subject"`
}

Episode mapped from table <chii_episodes>

func (*Episode) TableName

func (*Episode) TableName() string

TableName Episode's table name

type Index

type Index struct {
	ID           uint32       `gorm:"column:idx_id;type:mediumint(8);primaryKey;autoIncrement:true;uniqueIndex:mid,priority:1"` // 自动id
	Type         uint8        `gorm:"column:idx_type;type:tinyint(3) unsigned;not null;index:idx_type,priority:1"`
	Title        string       `gorm:"column:idx_title;type:varchar(80);not null"`                                   // 标题
	Desc         string       `gorm:"column:idx_desc;type:mediumtext;not null"`                                     // 简介
	Replies      uint32       `gorm:"column:idx_replies;type:mediumint(8) unsigned;not null"`                       // 回复数
	SubjectTotal uint32       `gorm:"column:idx_subject_total;type:mediumint(8) unsigned;not null"`                 // 内含条目总数
	Collects     uint32       `gorm:"column:idx_collects;type:mediumint(8);not null;index:idx_collects,priority:1"` // 收藏数
	Stats        string       `gorm:"column:idx_stats;type:mediumtext;not null"`
	Dateline     int32        `gorm:"column:idx_dateline;type:int(10);not null"` // 创建时间
	Lasttouch    uint32       `gorm:"column:idx_lasttouch;type:int(10) unsigned;not null"`
	CreatorID    model.UserID `gorm:"column:idx_uid;type:mediumint(8);not null;index:idx_uid,priority:1"` // 创建人UID
	Ban          bool         `gorm:"column:idx_ban;type:tinyint(1) unsigned;not null;index:idx_ban,priority:1"`
}

Index mapped from table <chii_index>

func (*Index) TableName

func (*Index) TableName() string

TableName Index's table name

type IndexSubject

type IndexSubject struct {
	ID  uint32 `gorm:"column:idx_rlt_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true"`
	Cat int8   `gorm:"column:idx_rlt_cat;type:tinyint(3);not null;index:idx_rlt_cat,priority:1;index:idx_order,priority:2"`
	Rid uint32 `` // 关联目录
	/* 146-byte string literal not displayed */
	Type uint8  `gorm:"column:idx_rlt_type;type:smallint(6) unsigned;not null;index:idx_rlt_rid,priority:2"` // 关联条目类型
	Sid  uint32 ``                                                                                           // 关联条目ID
	/* 148-byte string literal not displayed */
	Order    uint32  `gorm:"column:idx_rlt_order;type:mediumint(8) unsigned;not null;index:idx_order,priority:3"`
	Comment  string  `gorm:"column:idx_rlt_comment;type:mediumtext;not null"`
	Dateline uint32  `gorm:"column:idx_rlt_dateline;type:int(10) unsigned;not null"`
	Subject  Subject `gorm:"foreignKey:idx_rlt_sid;references:subject_id" json:"subject"`
}

IndexSubject mapped from table <chii_index_related>

func (*IndexSubject) TableName

func (*IndexSubject) TableName() string

TableName IndexSubject's table name

type Member

type Member struct {
	ID            model.UserID `gorm:"column:uid;type:mediumint(8) unsigned;primaryKey;autoIncrement:true"`
	Username      string       `gorm:"column:username;type:char(15);not null;uniqueIndex:username,priority:1"`
	Nickname      string       `gorm:"column:nickname;type:varchar(30);not null"`
	Avatar        string       `gorm:"column:avatar;type:varchar(255);not null"`
	Groupid       uint8        `gorm:"column:groupid;type:smallint(6) unsigned;not null"`
	Regdate       int64        `gorm:"column:regdate;type:int(10) unsigned;not null"`
	Lastvisit     uint32       `gorm:"column:lastvisit;type:int(10) unsigned;not null"`
	Lastactivity  uint32       `gorm:"column:lastactivity;type:int(10) unsigned;not null"`
	Lastpost      uint32       `gorm:"column:lastpost;type:int(10) unsigned;not null"`
	Dateformat    string       `gorm:"column:dateformat;type:char(10);not null"`
	Timeformat    bool         `gorm:"column:timeformat;type:tinyint(1);not null"`
	Timeoffset    string       `gorm:"column:timeoffset;type:char(4);not null"`
	Newpm         bool         `gorm:"column:newpm;type:tinyint(1);not null"`
	NewNotify     uint16       `gorm:"column:new_notify;type:smallint(6) unsigned;not null"` // 新提醒
	Sign          string       `gorm:"column:sign;type:varchar(255);not null"`
	PasswordCrypt []byte       `gorm:"column:password_crypt;type:char(64);not null"`
	Email         string       `gorm:"column:email;type:char(50);not null"`
	Fields        MemberField  `gorm:"foreignKey:uid;references:uid" json:"fields"`
}

Member mapped from table <chii_members>

func (*Member) TableName

func (*Member) TableName() string

TableName Member's table name

type MemberField

type MemberField struct {
	UID       model.UserID `gorm:"column:uid;type:mediumint(8) unsigned;primaryKey"`
	Site      string       `gorm:"column:site;type:varchar(75);not null"`
	Location  string       `gorm:"column:location;type:varchar(30);not null"`
	Bio       string       `gorm:"column:bio;type:text;not null"`
	Privacy   string       `gorm:"column:privacy;type:mediumtext;not null"`
	Blocklist string       `gorm:"column:blocklist;type:mediumtext;not null"`
}

MemberField mapped from table <chii_memberfields>

func (*MemberField) TableName

func (*MemberField) TableName() string

TableName MemberField's table name

type OAuthClient added in v0.19.0

type OAuthClient struct {
	AppID        uint32 `gorm:"column:app_id;type:mediumint(8);primaryKey"`
	ClientID     string `gorm:"column:client_id;type:varchar(80);not null;index:client_id,priority:1"`
	ClientSecret string `gorm:"column:client_secret;type:varchar(80)"`
	RedirectURI  string `gorm:"column:redirect_uri;type:varchar(2000)"`
	GrantTypes   string `gorm:"column:grant_types;type:varchar(80)"`
	Scope        string `gorm:"column:scope;type:varchar(4000)"`
	UserID       string `gorm:"column:user_id;type:varchar(80)"`
	App          App    `gorm:"foreignKey:app_id;references:app_id" json:"app"`
}

OAuthClient mapped from table <chii_oauth_clients>

func (*OAuthClient) TableName added in v0.19.0

func (*OAuthClient) TableName() string

TableName OAuthClient's table name

type Person

type Person struct {
	ID          model.PersonID `gorm:"column:prsn_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true"`
	Name        string         `gorm:"column:prsn_name;type:varchar(255);not null"`
	Type        uint8          `gorm:"column:prsn_type;type:tinyint(4) unsigned;not null;index:prsn_type,priority:1"` // 个人,公司,组合
	Infobox     string         `gorm:"column:prsn_infobox;type:mediumtext;not null"`
	Producer    bool           `gorm:"column:prsn_producer;type:tinyint(1);not null;index:prsn_producer,priority:1"`
	Mangaka     bool           `gorm:"column:prsn_mangaka;type:tinyint(1);not null;index:prsn_mangaka,priority:1"`
	Artist      bool           `gorm:"column:prsn_artist;type:tinyint(1);not null;index:prsn_artist,priority:1"`
	Seiyu       bool           `gorm:"column:prsn_seiyu;type:tinyint(1);not null;index:prsn_seiyu,priority:1"`
	Writer      bool           `gorm:"column:prsn_writer;type:tinyint(4);not null;index:prsn_writer,priority:1"`           // 作家
	Illustrator bool           `gorm:"column:prsn_illustrator;type:tinyint(4);not null;index:prsn_illustrator,priority:1"` // 绘师
	Actor       bool           `gorm:"column:prsn_actor;type:tinyint(1);not null;index:prsn_actor,priority:1"`             // 演员
	Summary     string         `gorm:"column:prsn_summary;type:mediumtext;not null"`
	Img         string         `gorm:"column:prsn_img;type:varchar(255);not null"`
	ImgAnidb    string         `gorm:"column:prsn_img_anidb;type:varchar(255);not null"`
	Comment     uint32         `gorm:"column:prsn_comment;type:mediumint(9) unsigned;not null"`
	Collects    uint32         `gorm:"column:prsn_collects;type:mediumint(8) unsigned;not null"`
	Dateline    uint32         `gorm:"column:prsn_dateline;type:int(10) unsigned;not null"`
	Lastpost    uint32         `gorm:"column:prsn_lastpost;type:int(11) unsigned;not null"`
	Lock        int8           `gorm:"column:prsn_lock;type:tinyint(4);not null;index:prsn_lock,priority:1"`
	AnidbID     uint32         `gorm:"column:prsn_anidb_id;type:mediumint(8) unsigned;not null"`
	Ban         uint8          `gorm:"column:prsn_ban;type:tinyint(3) unsigned;not null;index:prsn_ban,priority:1"`
	Redirect    model.PersonID `gorm:"column:prsn_redirect;type:int(10) unsigned;not null"`
	Nsfw        bool           `gorm:"column:prsn_nsfw;type:tinyint(1) unsigned;not null"`
	Fields      PersonField    `gorm:"foreignKey:prsn_id;polymorphic:Owner;polymorphicValue:prsn" json:"fields"`
}

Person mapped from table <chii_persons>

func (*Person) TableName

func (*Person) TableName() string

TableName Person's table name

type PersonField

type PersonField struct {
	OwnerType string         `gorm:"column:prsn_cat;type:enum('prsn','crt');primaryKey"`
	OwnerID   model.PersonID `gorm:"column:prsn_id;type:int(8) unsigned;primaryKey;index:prsn_id,priority:1"`
	Gender    uint8          `gorm:"column:gender;type:tinyint(4) unsigned;not null"`
	Bloodtype uint8          `gorm:"column:bloodtype;type:tinyint(4) unsigned;not null"`
	BirthYear uint16         `gorm:"column:birth_year;type:year(4);not null"`
	BirthMon  uint8          `gorm:"column:birth_mon;type:tinyint(2) unsigned;not null"`
	BirthDay  uint8          `gorm:"column:birth_day;type:tinyint(2) unsigned;not null"`
}

PersonField mapped from table <chii_person_fields>

func (*PersonField) TableName

func (*PersonField) TableName() string

TableName PersonField's table name

type PersonSubjects

type PersonSubjects struct {
	PrsnType      string          `gorm:"column:prsn_type;type:enum('prsn','crt');primaryKey"`
	PersonID      model.PersonID  `gorm:"column:prsn_id;type:mediumint(9) unsigned;primaryKey;index:prsn_id,priority:1"`
	PrsnPosition  uint16          `gorm:"column:prsn_position;type:smallint(5) unsigned;primaryKey;index:prsn_position,priority:1"` // 监督,原案,脚本,..
	SubjectID     model.SubjectID `gorm:"column:subject_id;type:mediumint(9) unsigned;primaryKey;index:subject_id,priority:1"`
	SubjectTypeID uint8           `gorm:"column:subject_type_id;type:tinyint(4) unsigned;not null;index:subject_type_id,priority:1"`
	Summary       string          `gorm:"column:summary;type:mediumtext;not null"`
	PrsnAppearEps string          `gorm:"column:prsn_appear_eps;type:mediumtext;not null"` // 可选,人物参与的章节
	Subject       Subject         `gorm:"foreignKey:subject_id;references:subject_id" json:"subject"`
	Person        Person          `gorm:"foreignKey:prsn_id;references:prsn_id" json:"person"`
}

PersonSubjects mapped from table <chii_person_cs_index>

func (*PersonSubjects) TableName

func (*PersonSubjects) TableName() string

TableName PersonSubjects's table name

type RevisionHistory added in v0.10.1

type RevisionHistory struct {
	ID        uint32       `gorm:"column:rev_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true;index:rev_id,priority:1"`
	Type      uint8        `gorm:"column:rev_type;type:tinyint(3) unsigned;not null;index:rev_crt_id,priority:1;index:rev_id,priority:2"` // 条目,角色,人物
	Mid       uint32       `gorm:"column:rev_mid;type:mediumint(8) unsigned;not null;index:rev_crt_id,priority:2"`                        // 对应条目,人物的ID
	TextID    uint32       `gorm:"column:rev_text_id;type:mediumint(9) unsigned;not null"`
	CreatedAt uint32       `gorm:"column:rev_dateline;type:int(10) unsigned;not null"`
	CreatorID model.UserID `gorm:"column:rev_creator;type:mediumint(8) unsigned;not null;index:rev_crt_creator,priority:1;index:rev_id,priority:3"`
	Summary   string       `gorm:"column:rev_edit_summary;type:varchar(200);not null"`
}

RevisionHistory mapped from table <chii_rev_history>

func (*RevisionHistory) TableName added in v0.10.1

func (*RevisionHistory) TableName() string

TableName RevisionHistory's table name

type RevisionText added in v0.10.1

type RevisionText struct {
	TextID uint32 `gorm:"column:rev_text_id;type:mediumint(9) unsigned;primaryKey;autoIncrement:true"`
	Text   []byte `gorm:"column:rev_text;type:mediumblob;not null"`
}

RevisionText mapped from table <chii_rev_text>

func (*RevisionText) TableName added in v0.10.1

func (*RevisionText) TableName() string

TableName RevisionText's table name

type Subject

type Subject struct {
	ID          model.SubjectID `gorm:"column:subject_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true"`
	TypeID      uint8           `` /* 185-byte string literal not displayed */
	Name        string          `gorm:"column:subject_name;type:varchar(80);not null;index:subject_name,priority:1;index:order_by_name,priority:5"`
	NameCN      string          `gorm:"column:subject_name_cn;type:varchar(80);not null;index:subject_name_cn,priority:1"`
	UID         string          `gorm:"column:subject_uid;type:varchar(20);not null"` // isbn / imdb
	Creator     uint32          `gorm:"column:subject_creator;type:mediumint(8) unsigned;not null;index:subject_creator,priority:1"`
	Dateline    uint32          `gorm:"column:subject_dateline;type:int(10) unsigned;not null"`
	Image       string          `gorm:"column:subject_image;type:varchar(255);not null"`
	Platform    uint16          `` /* 155-byte string literal not displayed */
	Infobox     string          `gorm:"column:field_infobox;type:mediumtext;not null"`
	Summary     string          `gorm:"column:field_summary;type:mediumtext;not null"`            // summary
	Field5      string          `gorm:"column:field_5;type:mediumtext;not null"`                  // author summary
	Volumes     uint32          `gorm:"column:field_volumes;type:mediumint(8) unsigned;not null"` // 卷数
	Eps         uint32          `gorm:"column:field_eps;type:mediumint(8) unsigned;not null"`
	Wish        uint32          `gorm:"column:subject_wish;type:mediumint(8) unsigned;not null"`
	Collect     uint32          `gorm:"column:subject_collect;type:mediumint(8) unsigned;not null"`
	Doing       uint32          `gorm:"column:subject_doing;type:mediumint(8) unsigned;not null"`
	OnHold      uint32          `gorm:"column:subject_on_hold;type:mediumint(8) unsigned;not null"` // 搁置人数
	Dropped     uint32          `gorm:"column:subject_dropped;type:mediumint(8) unsigned;not null"` // 抛弃人数
	Series      bool            ``                                                                  /* 150-byte string literal not displayed */
	SeriesEntry uint32          `gorm:"column:subject_series_entry;type:mediumint(8) unsigned;not null;index:subject_series_entry,priority:1"`
	IdxCn       string          `gorm:"column:subject_idx_cn;type:varchar(1);not null;index:subject_idx_cn,priority:1"`
	Airtime     uint8           `gorm:"column:subject_airtime;type:tinyint(1) unsigned;not null;index:subject_airtime,priority:1"`
	Nsfw        bool            `gorm:"column:subject_nsfw;type:tinyint(1);not null;index:subject_nsfw,priority:1"`
	Ban         uint8           `` /* 144-byte string literal not displayed */
	Fields      SubjectField    `gorm:"foreignKey:subject_id;references:field_sid" json:"fields"`
}

Subject mapped from table <chii_subjects>

func (*Subject) TableName

func (*Subject) TableName() string

TableName Subject's table name

type SubjectCollection

type SubjectCollection struct {
	ID              uint32          `gorm:"column:interest_id;type:int(10) unsigned;primaryKey;autoIncrement:true"`
	UserID          model.UserID    `` /* 358-byte string literal not displayed */
	SubjectID       model.SubjectID `` /* 342-byte string literal not displayed */
	SubjectType     uint8           `` /* 273-byte string literal not displayed */
	Rate            uint8           `gorm:"column:interest_rate;type:tinyint(3) unsigned;not null;index:interest_rate,priority:1;index:subject_rate,priority:2"`
	Type            uint8           `` /* 299-byte string literal not displayed */
	HasComment      bool            `gorm:"column:interest_has_comment;type:tinyint(1) unsigned;not null;index:subject_comment,priority:2"`
	Comment         string          `gorm:"column:interest_comment;type:mediumtext;not null"`
	Tag             string          `gorm:"column:interest_tag;type:mediumtext;not null"`
	EpStatus        uint32          `gorm:"column:interest_ep_status;type:mediumint(8) unsigned;not null"`
	VolStatus       uint32          `gorm:"column:interest_vol_status;type:mediumint(8) unsigned;not null"` // 卷数
	WishDateline    uint32          `gorm:"column:interest_wish_dateline;type:int(10) unsigned;not null"`
	DoingDateline   uint32          `gorm:"column:interest_doing_dateline;type:int(10) unsigned;not null;index:top_subject,priority:3"`
	CollectDateline uint32          `` /* 181-byte string literal not displayed */
	OnHoldDateline  uint32          `gorm:"column:interest_on_hold_dateline;type:int(10) unsigned;not null"`
	DroppedDateline uint32          `gorm:"column:interest_dropped_dateline;type:int(10) unsigned;not null"`
	Lasttouch       uint32          `` /* 199-byte string literal not displayed */
	Private         uint8           `` /* 362-byte string literal not displayed */
}

SubjectCollection mapped from table <chii_subject_interests>

func (*SubjectCollection) TableName

func (*SubjectCollection) TableName() string

TableName SubjectCollection's table name

type SubjectField

type SubjectField struct {
	Sid      uint32          `gorm:"column:field_sid;type:mediumint(8) unsigned;primaryKey;autoIncrement:true;index:query_date,priority:1"`
	Tid      uint16          `gorm:"column:field_tid;type:smallint(6) unsigned;not null;index:sort_id,priority:1"`
	Tags     []byte          `gorm:"column:field_tags;type:mediumtext;not null"`
	Rate1    uint32          `gorm:"column:field_rate_1;type:mediumint(8) unsigned;not null"`
	Rate2    uint32          `gorm:"column:field_rate_2;type:mediumint(8) unsigned;not null"`
	Rate3    uint32          `gorm:"column:field_rate_3;type:mediumint(8) unsigned;not null"`
	Rate4    uint32          `gorm:"column:field_rate_4;type:mediumint(8) unsigned;not null"`
	Rate5    uint32          `gorm:"column:field_rate_5;type:mediumint(8) unsigned;not null"`
	Rate6    uint32          `gorm:"column:field_rate_6;type:mediumint(8) unsigned;not null"`
	Rate7    uint32          `gorm:"column:field_rate_7;type:mediumint(8) unsigned;not null"`
	Rate8    uint32          `gorm:"column:field_rate_8;type:mediumint(8) unsigned;not null"`
	Rate9    uint32          `gorm:"column:field_rate_9;type:mediumint(8) unsigned;not null"`
	Rate10   uint32          `gorm:"column:field_rate_10;type:mediumint(8) unsigned;not null"`
	Airtime  uint8           `gorm:"column:field_airtime;type:tinyint(1) unsigned;not null;index:subject_airtime,priority:1"`
	Rank     uint32          `gorm:"column:field_rank;type:int(10) unsigned;not null;index:field_rank,priority:1"`
	Year     int32           `gorm:"column:field_year;type:year(4);not null;index:field_year_mon,priority:1;index:field_year,priority:1"` // 放送年份
	Mon      int8            `gorm:"column:field_mon;type:tinyint(2);not null;index:field_year_mon,priority:2"`                           // 放送月份
	WeekDay  int8            `gorm:"column:field_week_day;type:tinyint(1);not null"`                                                      // 放送日(星期X)
	Date     time.Time       `gorm:"column:field_date;type:date;not null;index:field_date,priority:1;index:query_date,priority:2"`        // 放送日期
	Redirect model.SubjectID `gorm:"column:field_redirect;type:mediumint(8) unsigned;not null"`
}

SubjectField mapped from table <chii_subject_fields>

func (*SubjectField) TableName

func (*SubjectField) TableName() string

TableName SubjectField's table name

type SubjectRelation

type SubjectRelation struct {
	SubjectID model.SubjectID `` // 关联主 ID
	/* 139-byte string literal not displayed */
	SubjectTypeID    uint8           `gorm:"column:rlt_subject_type_id;type:tinyint(3) unsigned;not null;index:rlt_subject_type_id,priority:1"`
	RelationType     uint16          `gorm:"column:rlt_relation_type;type:smallint(5) unsigned;not null;index:rlt_relation_type,priority:1"` // 关联类型
	RelatedSubjectID model.SubjectID ``                                                                                                      // 关联目标 ID
	/* 147-byte string literal not displayed */
	RelatedSubjectTypeID uint8   `gorm:"column:rlt_related_subject_type_id;type:tinyint(3) unsigned;not null;index:rlt_related_subject_type_id,priority:1"` // 关联目标类型
	ViceVersa            bool    `gorm:"column:rlt_vice_versa;type:tinyint(1) unsigned;primaryKey;uniqueIndex:rlt_subject_id,priority:3"`
	Order                uint8   `gorm:"column:rlt_order;type:tinyint(3) unsigned;not null;index:rlt_related_subject_type_id,priority:2"` // 关联排序
	Subject              Subject `gorm:"foreignKey:rlt_related_subject_id;references:subject_id" json:"subject"`
}

SubjectRelation mapped from table <chii_subject_relations>

func (*SubjectRelation) TableName

func (*SubjectRelation) TableName() string

TableName SubjectRelation's table name

type SubjectRevision

type SubjectRevision struct {
	ID           uint32          `gorm:"column:rev_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true;index:rev_creator,priority:2"`
	Type         uint8           `gorm:"column:rev_type;type:tinyint(3) unsigned;not null;index:rev_type,priority:1;default:1"` // 修订类型
	SubjectID    model.SubjectID `gorm:"column:rev_subject_id;type:mediumint(8) unsigned;not null;index:rev_subject_id,priority:1"`
	TypeID       uint16          `gorm:"column:rev_type_id;type:smallint(6) unsigned;not null"`
	CreatorID    model.UserID    `gorm:"column:rev_creator;type:mediumint(8) unsigned;not null;index:rev_subject_id,priority:2;index:rev_creator,priority:1"`
	Dateline     uint32          `gorm:"column:rev_dateline;type:int(10) unsigned;not null;index:rev_dateline,priority:1"`
	Name         string          `gorm:"column:rev_name;type:varchar(80);not null"`
	NameCN       string          `gorm:"column:rev_name_cn;type:varchar(80);not null"`
	FieldInfobox string          `gorm:"column:rev_field_infobox;type:mediumtext;not null"`
	FieldSummary string          `gorm:"column:rev_field_summary;type:mediumtext;not null"`
	VoteField    string          `gorm:"column:rev_vote_field;type:mediumtext;not null"`
	FieldEps     uint32          `gorm:"column:rev_field_eps;type:mediumint(8) unsigned;not null"`
	EditSummary  string          `gorm:"column:rev_edit_summary;type:varchar(200);not null"`
	Platform     uint16          `gorm:"column:rev_platform;type:smallint(6) unsigned;not null"`
	Subject      Subject         `gorm:"foreignKey:rev_subject_id;references:subject_id" json:"subject"`
}

SubjectRevision mapped from table <chii_subject_revisions>

func (*SubjectRevision) TableName

func (*SubjectRevision) TableName() string

TableName SubjectRevision's table name

type UserGroup added in v0.12.4

type UserGroup struct {
	ID       uint8  `gorm:"column:usr_grp_id;type:mediumint(8) unsigned;primaryKey;autoIncrement:true"`
	Name     string `gorm:"column:usr_grp_name;type:varchar(255);not null"`
	Perm     []byte `gorm:"column:usr_grp_perm;type:mediumtext;not null"`
	Dateline uint32 `gorm:"column:usr_grp_dateline;type:int(10) unsigned;not null"`
}

UserGroup mapped from table <chii_usergroup>

func (*UserGroup) TableName added in v0.12.4

func (*UserGroup) TableName() string

TableName UserGroup's table name

type WebSession added in v0.12.4

type WebSession struct {
	Key       string       `gorm:"column:key;type:char(64);primaryKey"`           // session key
	UserID    model.UserID `gorm:"column:user_id;type:int(10) unsigned;not null"` // uint32 user id
	Value     []byte       `gorm:"column:value;type:mediumblob;not null"`         // json encoded session data
	CreatedAt int64        `gorm:"column:created_at;type:bigint(20);not null"`    // int64 unix timestamp, when session is created
	ExpiredAt int64        `gorm:"column:expired_at;type:bigint(20);not null"`    // int64 unix timestamp, when session is expired
}

WebSession mapped from table <chii_os_web_sessions>

func (*WebSession) TableName added in v0.12.4

func (*WebSession) TableName() string

TableName WebSession's table name

Jump to

Keyboard shortcuts

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