Skip to content

Latest commit

 

History

History
76 lines (64 loc) · 2.55 KB

用户收藏.md

File metadata and controls

76 lines (64 loc) · 2.55 KB

条目收藏

https:/bangumi/dev-env/blob/master/sql/schema/chii_subject_interests.sql

CREATE TABLE IF NOT EXISTS `chii_subject_interests` (
  `interest_id` int(10) unsigned NOT NULL,
  `interest_uid` mediumint(8) unsigned NOT NULL,
  `interest_subject_id` mediumint(8) unsigned NOT NULL,
  `interest_subject_type` smallint(6) unsigned NOT NULL DEFAULT '0',
  `interest_rate` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `interest_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `interest_has_comment` tinyint(1) unsigned NOT NULL,
  `interest_comment` mediumtext NOT NULL,
  `interest_tag` mediumtext NOT NULL,
  `interest_ep_status` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `interest_vol_status` mediumint(8) unsigned NOT NULL COMMENT '卷数',
  `interest_wish_dateline` int(10) unsigned NOT NULL,
  `interest_doing_dateline` int(10) unsigned NOT NULL,
  `interest_collect_dateline` int(10) unsigned NOT NULL,
  `interest_on_hold_dateline` int(10) unsigned NOT NULL,
  `interest_dropped_dateline` int(10) unsigned NOT NULL,
  `interest_lasttouch` int(10) unsigned NOT NULL DEFAULT '0',
  `interest_private` tinyint(1) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

章节收藏

https:/bangumi/dev-env/blob/master/sql/schema/chii_ep_status.sql

CREATE TABLE IF NOT EXISTS `chii_ep_status` (
    `ep_stt_id` mediumint(8) unsigned NOT NULL,
    `ep_stt_uid` mediumint(8) unsigned NOT NULL,
    `ep_stt_sid` mediumint(8) unsigned NOT NULL,
    `ep_stt_on_prg` tinyint(1) unsigned NOT NULL DEFAULT '0',
    `ep_stt_status` mediumtext NOT NULL,
    `ep_stt_lasttouch` int(10) unsigned NOT NULL
  ) ENGINE = MyISAM DEFAULT CHARSET = utf8;

ep_stt_status 字段经过了 php 序列化。

数据结构,解析后的数据结构大约如下:(使用 TypeScript 表示)

type EpisodeID = number
enum EpisodeCollectionType {
    watched = 1, // 想看
    done = 2, // 看过
    dropped = 3, // 抛弃
}

type EpStatus = {
    [episode_id: EpisodeID]: {
        eid: string // EpisodeID in string
        stat: EpisodeCollectionType
    }
}

人物收藏

https:/bangumi/dev-env/blob/master/sql/schema/chii_person_collects.sql

CREATE TABLE IF NOT EXISTS
  `chii_person_collects` (
    `prsn_clt_id` MEDIUMINT(8) UNSIGNED NOT NULL,
    `prsn_clt_cat` ENUM('prsn', 'crt') NOT NULL,
    `prsn_clt_mid` MEDIUMINT(8) UNSIGNED NOT NULL,
    `prsn_clt_uid` MEDIUMINT(8) UNSIGNED NOT NULL,
    `prsn_clt_dateline` INT(10) UNSIGNED NOT NULL
  ) ENGINE = MyISAM DEFAULT CHARSET = utf8 COMMENT = '人物收藏';