diff --git a/ky_tools.sql b/ky_tools.sql index 0f2dbd0..887dd83 100644 --- a/ky_tools.sql +++ b/ky_tools.sql @@ -11,7 +11,7 @@ Target Server Version : 80200 (8.2.0) File Encoding : 65001 - Date: 01/04/2024 20:29:31 + Date: 07/05/2024 12:39:04 */ SET NAMES utf8mb4; @@ -25,10 +25,9 @@ CREATE TABLE `ky_account` ( `id` int NOT NULL AUTO_INCREMENT, `username` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '账号', `password` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '密码', - `type` enum('ky','hth','jy') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '类型 ky hth', + `type` enum('ky','hth','jy','aty') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '类型 ky hth', `name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '别名', `url` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'url', - `x_api_token` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'x-api-token', `headers` json NULL COMMENT 'headers', `user_id` int NOT NULL COMMENT '关联的用户id', `status` int NOT NULL DEFAULT 0 COMMENT '账号的状态,默认为0 禁用', @@ -36,7 +35,7 @@ CREATE TABLE `ky_account` ( UNIQUE INDEX `username`(`username` ASC) USING BTREE, INDEX `user_id`(`user_id` ASC) USING BTREE, CONSTRAINT `ky_account_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `ky_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Table structure for ky_user @@ -53,8 +52,9 @@ CREATE TABLE `ky_user` ( `chat_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '私聊id', `telegram_ids` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'telegram_id ,分割', `status` tinyint NOT NULL DEFAULT 0 COMMENT '用户状态 0 禁用 1启用', + `count_group_id` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '报数群组id', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `username`(`username` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = DYNAMIC; SET FOREIGN_KEY_CHECKS = 1; diff --git a/src/core/login.py b/src/core/login.py index 323ed98..92469c1 100644 --- a/src/core/login.py +++ b/src/core/login.py @@ -6,7 +6,7 @@ import time import requests from playwright.sync_api import Position, TimeoutError, sync_playwright -from src import logger +from loguru import logger from src.entity.account import Account, AccountType from src.entity.database import db from src.ui import global_signals @@ -159,7 +159,6 @@ def persistence(account: Account, headers: dict): db_account = session.query(Account).filter(Account.username == account.username, Account.password == account.password).one() db_account.headers = headers - db_account.x_api_token = headers['x-api-token'] session.commit() logger.info(f'Headers persisted for account {account.name}') diff --git a/src/entity/account.py b/src/entity/account.py index 3943a24..b0dea4f 100644 --- a/src/entity/account.py +++ b/src/entity/account.py @@ -28,7 +28,6 @@ class Account(db.Base): comment='类型 ky hth jy aty') name: Mapped[str] = mapped_column(String(64), nullable=True, comment='别名') url: Mapped[str] = mapped_column(String(128), nullable=False, comment='url') - x_api_token: Mapped[str] = mapped_column(String(64), nullable=True, comment='x-api-token') headers: Mapped[Sql_JSON] = mapped_column(Sql_JSON, nullable=True, comment='headers') user_id: Mapped[int] = mapped_column(ForeignKey('ky_user.id'), nullable=False, comment='关联的用户id') diff --git a/src/entity/banner_info.py b/src/entity/banner_info.py index 4c1a57c..da0b1ff 100644 --- a/src/entity/banner_info.py +++ b/src/entity/banner_info.py @@ -8,7 +8,6 @@ from loguru import logger from src.core.api_request import account_post from src.core.constant import BANNER_URL from src.core.message_client import send_message -from src.core.util import get_curr_day from src.entity.account import Account from src.entity.member import get_today_new_member_list from src.entity.pay_record import get_latest_deposit_user