fix: 修复代码被注释

This commit is contained in:
2025-12-17 21:50:02 +08:00
parent 99e77a37cf
commit 1c866d8fde
3 changed files with 46 additions and 17 deletions

6
.env.example Normal file
View File

@@ -0,0 +1,6 @@
# 城科水电
UID=
USER_NO=
SCHOOL_ACCOUNT=
USER_NAME=
WECHAT_COMANY_BOT_KEY=

View File

@@ -10,32 +10,55 @@
### 使用
- 配置当前目录下的 `config.py` 文件
- 修改配置文件(二选一即可)
- 手动去 Github 下载 [LXGWWenKai-Medium 字体](https://github.com/lxgw/LxgwWenKai) 保存到fonts文件夹中或者使用 wget 进行获取,然后修改配置文件
```sh
curl -L -o ./fonts/LXGWWenKaiMono-Medium.ttf https://github.5700.cf/https://github.com/lxgw/LxgwWenKai/releases/download/v1.521/LXGWWenKaiMono-Medium.ttf
```
1.`.env.example` 复制为 `.env`
- `UID` 获取,使用支付宝进行扫描下方二维码即可获得 `uid`
- 手动去 Github 下载 [LXGWWenKai-Medium 字体](https://github.com/lxgw/LxgwWenKai) 保存到fonts文件夹中或者使用 wget 进行获取,然后修改配置文件
```sh
curl -L -o ./fonts/LXGWWenKaiMono-Medium.ttf https://github.5700.cf/https://github.com/lxgw/LxgwWenKai/releases/download/v1.521/LXGWWenKaiMono-Medium.ttf
```
![UID 获取](./images/image.png)
- `UID` 获取,使用支付宝进行扫描下方二维码即可获得 `uid`
![UID 获取](./images/image.png)
- `USER_NO` 获取,通过抓包获取,使用抓包软件进行抓取微信小程序**扫呗团餐**,对响应体进行搜索`user_no`即可
- `USER_NO` 获取,通过抓包获取,使用抓包软件进行抓取微信小程序**扫呗团餐**,对响应体进行搜索`user_no`即可
![USER_NO 获取](./images/image2.png)
![USER_NO 获取](./images/image2.png)
- `SCHOOL_ACCOUNT` 这是学号(可选)
- `USER_NAME` 这是姓名(可选)
- `WECHAT_COMANY_BOT_KEY` 企业微信机器人 key
- `SCHOOL_ACCOUNT` 这是学号(可选)
- `USER_NAME` 这是姓名(可选)
- `WECHAT_COMANY_BOT_KEY` 企业微信机器人 key
2. 配置当前目录下的 `config.py` 文件
- 手动去 Github 下载 [LXGWWenKai-Medium 字体](https://github.com/lxgw/LxgwWenKai) 保存到fonts文件夹中或者使用 wget 进行获取,然后修改配置文件
```sh
curl -L -o ./fonts/LXGWWenKaiMono-Medium.ttf https://github.5700.cf/https://github.com/lxgw/LxgwWenKai/releases/download/v1.521/LXGWWenKaiMono-Medium.ttf
```
- `UID` 获取,使用支付宝进行扫描下方二维码即可获得 `uid`
![UID 获取](./images/image.png)
- `USER_NO` 获取,通过抓包获取,使用抓包软件进行抓取微信小程序**扫呗团餐**,对响应体进行搜索`user_no`即可
![USER_NO 获取](./images/image2.png)
- `SCHOOL_ACCOUNT` 这是学号(可选)
- `USER_NAME` 这是姓名(可选)
- `WECHAT_COMANY_BOT_KEY` 企业微信机器人 key
- 安装依赖
```sh
pip install aiosqlite apscheduler httpx matplotlib
pip install aiosqlite apscheduler httpx matplotlib dotenv
```
- 通过 `scheduler.py` 修改监控时长配置(不懂的请问 AI

View File

@@ -25,10 +25,10 @@ if db_dir and not os.path.exists(db_dir):
async def main():
# await WaterUsageModel.create_table()
# await AmmeterUsageModel.create_table()
await WaterUsageModel.create_table()
await AmmeterUsageModel.create_table()
# start_scheduler()
start_scheduler()
await SD().push()