Skip to content

Commit 2287dcb

Browse files
committedJul 11, 2022
update
1 parent 7ad39bd commit 2287dcb

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
 

‎条目.md

-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ CREATE TABLE IF NOT EXISTS `chii_subject_relations` (
8888
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='条目关联表';
8989
```
9090

91-
条目关联的文本和说明定义在 `pol/db/const.py` 中。
92-
9391
对于 `改编` 关联,会 fallback 到对应条目的类型。比如 `动画 改编 书籍` 对应的关联信息为书籍。
9492

9593
# 章节

‎用户收藏.md

+38
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 条目收藏
2+
13
https://github.com/bangumi/dev-env/blob/master/sql/schema/chii_subject_interests.sql
24

35
```SQL
@@ -22,3 +24,39 @@ CREATE TABLE IF NOT EXISTS `chii_subject_interests` (
2224
`interest_private` tinyint(1) unsigned NOT NULL
2325
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2426
```
27+
28+
# 章节收藏
29+
30+
https://github.com/bangumi/dev-env/blob/master/sql/schema/chii_ep_status.sql
31+
32+
```SQL
33+
CREATE TABLE IF NOT EXISTS `chii_ep_status` (
34+
`ep_stt_id` mediumint(8) unsigned NOT NULL,
35+
`ep_stt_uid` mediumint(8) unsigned NOT NULL,
36+
`ep_stt_sid` mediumint(8) unsigned NOT NULL,
37+
`ep_stt_on_prg` tinyint(1) unsigned NOT NULL DEFAULT '0',
38+
`ep_stt_status` mediumtext NOT NULL,
39+
`ep_stt_lasttouch` int(10) unsigned NOT NULL
40+
) ENGINE = MyISAM DEFAULT CHARSET = utf8;
41+
```
42+
43+
`ep_stt_status` 字段经过了 php 序列化。
44+
45+
数据结构,解析后的数据结构大约如下:(使用 golang 表示)
46+
47+
```golang
48+
type EpisodeID = uint32
49+
type EpisodeCollectionType uint8
50+
51+
const (
52+
EpisodeCollectionAll EpisodeCollectionType = 0 // 全部
53+
EpisodeCollectionWish EpisodeCollectionType = 1 // 想看
54+
EpisodeCollectionDone EpisodeCollectionType = 2 // 看过
55+
EpisodeCollectionDropped EpisodeCollectionType = 3 // 抛弃
56+
)
57+
58+
type EpStatus = map[EpisodeID]struct {
59+
EpisodeID EpisodeID `php:"eid,string"`
60+
Type EpisodeCollectionType `php:"type"`
61+
}
62+
```

0 commit comments

Comments
 (0)
Please sign in to comment.