Skip to content

Commit 680002b

Browse files
committed
update readme doc
1 parent 3a3b7c3 commit 680002b

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,43 +47,48 @@
4747

4848
SuperCourseTimetableBot 是**基于 `mirai-core 2.x` 版本和 `mirai-console 2.x` 版本的插件,不兼容 1.x 版本**
4949

50-
1. 运行一个新的或使用现有的 MySQL 或 MariaDB 数据库,在数据库中新建一个 database,名称随意
50+
1. 运行一个新的或使用现有的 MySQL, MariaDB 或 SQLite 数据库。
5151
2.[Releases](https://github.com/StageGuard/SuperCourseTimetableBot/releases/) 中下载 `SCTimetableBot-x.x.mirai.jar` 将其放入 mirai-console 的 插件文件夹下。
52-
3. 启动 mirai-console, 会有如下提示
52+
3. 插件默认使用 SQLite 嵌入式数据库,启动 mirai-console,会有如下提示
5353

5454
```
55-
2020-12-19 12:28:20 E/SuperCourseTimetable: me.stageguard.sctimetable.database.InvalidDatabaseConfigException: Database password is not set in config file SG.SCTimeTableBotConfig.
56-
me.stageguard.sctimetable.database.InvalidDatabaseConfigException: Database password is not set in config file SG.SCTimeTableBotConfig.
57-
at me.stageguard.sctimetable.database.Database.hikariDataSourceProvider(Database.kt:75)
58-
at me.stageguard.sctimetable.database.Database.connect(Database.kt:43)
59-
at me.stageguard.sctimetable.PluginMain.onEnable(PluginMain.kt:32)
60-
at ...
55+
2021-12-21 11:18:41 I/SuperCourseTimetable: Plugin loaded
56+
2021-12-21 11:18:41 I/SuperCourseTimetable: Database is connected.
57+
2021-12-21 11:18:41 I/SuperCourseTimetable: Waiting target Bot 123456789 goes online...
6158
```
6259

6360
4. 停止运行 mirai-console,进入 SuperCourseTimetableBot 配置文件 `config/SuperCourseTimetable/SG.SCTimeTableBotConfig.yml`,按照如下提示修改配置。
6461

6562
```yaml
66-
# 用于工作的BOT的QQ号,只有这个 Bot 上线后 SuperCourseTimetableBot 才会开始工作。
63+
# 用于工作的BOT的QQ号
6764
qq: 123456789
6865
# 默认提前多长时间提醒(单位:分钟)。
6966
# 此值会在用户第一次被添加进数据库时设置给这个用户。
7067
# 注意:如果你修改了这个值,在修改之前已经被设置的用户和自己设定值的用户不会受到影响。
7168
advancedTipTime: 15
72-
database:
73-
# MariaDB 或 MySQL 数据库的地址.
69+
# 使用的数据库类型,支持 MySQL / MariaDB / SQLite
70+
# 填 `mysql` 表示使用 MySQL 或 MariaDB。
71+
# 填 `sqlite` 表示使用 SQLite。
72+
# 填其他字符为无效选项。
73+
# 当使用其中一个数据库类型时,另一个数据库配置不会生效。
74+
database: sqlite
75+
# MySQL / MariaDB 数据库配置。
76+
# 若使用此数据库类型,请先手动创建数据库:
77+
# create database `sctimetabledb`;
78+
# 或其他你在下方 table 中指定的数据库名称。
79+
mysqlConfig:
7480
address: localhost
75-
# 数据库登入用户.
7681
user: root
77-
# 数据库登入密码,删掉''后修改
7882
password: ''
79-
# 填入第一步你创建的数据库的名称。
80-
# 用户的数据都会被存储在这个数据库里。
8183
table: sctimetabledb
82-
# 最大连接数,非特殊情况不需要修改。
8384
maximumPoolSize: 10
85+
# SQLite 数据库配置。
86+
sqliteConfig:
87+
# SQLite 数据库文件。
88+
file: sctimetable.db
8489
```
8590
86-
5. 重新运行 mirai-console,登录在第四部配置中指定的账号,SuperCourseTimetableBot 会输出如下提示:
91+
5. 重新运行 mirai-console,登录在第四步配置中指定的账号,SuperCourseTimetableBot 会输出如下提示:
8792
8893
```
8994
2020-12-19 12:39:07 I/SuperCourseTimetable: TimeProviderService: Job YearUpdater is executed. (currentYear -> 2020)
@@ -94,7 +99,7 @@ database:
9499
95100
这时 SuperCourseTimetableBot 就已经成功工作了。
96101
97-
> 注意:请确保运行 mirai-console 宿主机的时区是 `Asia/Shanghai` 并已同步北京时间!
102+
> 注意:请确保运行 mirai-console 宿主机的时区和数据库时区是 `Asia/Shanghai` 并已同步北京时间!详见 [#4](https://github.com/StageGuard/SuperCourseTimetableBot/issues/4) 。
98103

99104
## 稳定性
100105

@@ -131,7 +136,7 @@ SuperCourseTimetableBot 并未经过长期运行测试,对于其 `Quartz` 任
131136
- [x] 手动修改时间表
132137
- [x] 在时间表被修改时通知本校其他用户
133138
- [ ] 支持手动添加课程(补课或永久调整的课程)
134-
- [ ] 使用 `Mozilla Rhino` 通过动态 `JavaScript` 来适配不同的教务系统
139+
- [ ] ~~使用 `Mozilla Rhino` 通过动态 `JavaScript` 来适配不同的教务系统~~
135140

136141
## 开发计划
137142

0 commit comments

Comments
 (0)