CREATE TABLE `cai_ip_record`
(
    `id`          bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '子账户ID',
    `count_date`     date    NOT NULL COMMENT '统计日期',
    `ip_addr`     varchar(100)    NOT NULL COMMENT 'IP地址',
    `path_addr`   varchar(255)    NULL COMMENT '请求地址',
    `business_id` varchar(255)    NULL,
    `remark`      varchar(255)    NULL COMMENT '备注',
    `number`      bigint(20)               default 0 not null COMMENT '手机号',
    `create_time` datetime        NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` datetime        NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `ip_addr` (`ip_addr`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_general_ci
  ROW_FORMAT = DYNAMIC COMMENT ='ip访问记录';


CREATE TABLE `cai_ip_black`
(
    `id`            bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '子账户ID',
    `ip_addr`       varchar(100)    NOT NULL COMMENT 'IP地址',
    `enable_status` tinyint                  default 0 not NULL COMMENT '是否开启',
    `create_time`   datetime        NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE KEY `ip_addr` (`ip_addr`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_general_ci
  ROW_FORMAT = DYNAMIC COMMENT ='ip黑名单';

