CREATE TABLE qywechat_appinfo(
                             id INT AUTO_INCREMENT PRIMARY KEY,
                             application_name VARCHAR(255) NOT NULL,
                             agent_id VARCHAR(255) NOT NULL,
                             phone_number VARCHAR(255) NOT NULL,
                             corp_id VARCHAR(255) NOT NULL,
                             corp_secret VARCHAR(255) NOT NULL,
                             access_token VARCHAR(255) NOT NULL
);

INSERT INTO qywechat_appinfo (application_name,agent_id,phone_number,corp_id,corp_secret,access_token)
VALUES ('MassageBot', '1000002', '18281561650', 'ww2e0e0a2504751c38', 'hFXaFC9tsmPimP_28QV5QZrq2n8Dkz1EloUwS2jb3T8', 'febfnnerbfavrbr');

CREATE TABLE qywechat_url (
                          id INT AUTO_INCREMENT PRIMARY KEY,
                          phone_number VARCHAR(255) NOT NULL,
                          send_text_card_message_url VARCHAR(255) NOT NULL,
                          qy_wechat_get_token_url VARCHAR(255) NOT NULL
);

INSERT INTO qywechat_url (phone_number,send_text_card_message_url,qy_wechat_get_token_url)
VALUES ('18281561650','https://qyapi.weixin.qq.com/cgi-bin/message','https://qyapi.weixin.qq.com/cgi-bin/gettoken');

CREATE TABLE api_setting(
    id INT,
    phone_number VARCHAR(255) PRIMARY KEY,
    access_token VARCHAR(255),
    msgtype VARCHAR(255) NOT NULL,
    touser VARCHAR(255) NOT NULL,
    agentid INT NOT NULL,
    enable_duplicate_check INT NOT NULL,
    duplicate_check_interval INT NOT NULL
);

INSERT INTO api_setting(id,phone_number,access_token,msgtype,touser,agentid,enable_duplicate_check,duplicate_check_interval)
VALUES (1,'18281561650','gKGCDSgWV82XbU0H','textcard','@all',1000002,1,1800);


CREATE TABLE device_info (
        id INT PRIMARY KEY AUTO_INCREMENT,
        is_Monitored INT,
        time_out_period BIGINT,
        device_brand VARCHAR(255),
        android_version VARCHAR(255),
        sn VARCHAR(255),
        device_model VARCHAR(255),
        last_online_time BIGINT,
        status INT
);

INSERT INTO device_info (is_monitored, time_out_period, device_brand, android_version, sn, device_model, last_online_time, status) VALUES
                    (1, 600, 'google', 'Android 10', UNIX_TIMESTAMP(), 1),

