/*
 Navicat Premium Data Transfer

 Source Server         : mac-mysql
 Source Server Type    : MySQL
 Source Server Version : 80036 (8.0.36)
 Source Host           : 192.168.86.7:3309
 Source Schema         : cycle_api

 Target Server Type    : MySQL
 Target Server Version : 80036 (8.0.36)
 File Encoding         : 65001

 Date: 03/06/2024 05:57:23
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for customer_change_info_log
-- ----------------------------
DROP TABLE IF EXISTS `customer_change_info_log`;
CREATE TABLE `customer_change_info_log`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` smallint UNSIGNED NOT NULL COMMENT '日志类型',
  `uid` bigint NOT NULL COMMENT '用户uid',
  `column` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字段名',
  `value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '变更值',
  `before_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '变更前值',
  `after_value` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '变更后值',
  `pid` int NOT NULL DEFAULT 0 COMMENT '管理员id，默认0为系统任务',
  `remark_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '变更原因代码',
  `remark_desc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '变更原因备注',
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息变更记录表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_change_info_log
-- ----------------------------

-- ----------------------------
-- Table structure for customer_follow
-- ----------------------------
DROP TABLE IF EXISTS `customer_follow`;
CREATE TABLE `customer_follow`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uid` bigint UNSIGNED NOT NULL COMMENT '主uid',
  `follow_uid` bigint UNSIGNED NOT NULL COMMENT '被关注uid',
  `created_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uid_cid`(`uid` ASC, `follow_uid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_follow
-- ----------------------------
INSERT INTO `customer_follow` VALUES (1, 1, 1, '2024-03-26 21:32:54');
INSERT INTO `customer_follow` VALUES (2, 2, 2, '2024-03-26 21:39:34');

-- ----------------------------
-- Table structure for customer_follow_history
-- ----------------------------
DROP TABLE IF EXISTS `customer_follow_history`;
CREATE TABLE `customer_follow_history`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `method` tinyint UNSIGNED NOT NULL COMMENT '操作：1.关注  2.取关',
  `uid` bigint UNSIGNED NOT NULL COMMENT '主uid',
  `follow_uid` bigint UNSIGNED NOT NULL COMMENT '被关注uid',
  `created_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_follow_history
-- ----------------------------

-- ----------------------------
-- Table structure for customer_login_history
-- ----------------------------
DROP TABLE IF EXISTS `customer_login_history`;
CREATE TABLE `customer_login_history`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `status` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态：1.成功 2.失败',
  `uid` bigint UNSIGNED NOT NULL COMMENT '用户uid',
  `device` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '登录设备：1.app 2.web 3.h5',
  `created_at` datetime NOT NULL COMMENT '登录时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_login_history
-- ----------------------------

-- ----------------------------
-- Table structure for customer_post
-- ----------------------------
DROP TABLE IF EXISTS `customer_post`;
CREATE TABLE `customer_post`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` smallint NOT NULL COMMENT '类型：1.推文  2.转推',
  `uuid` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '外部唯一标识，给用户展示标记',
  `post_batch_sn` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '上传批号，同一批号根据时间排序',
  `mid` bigint UNSIGNED NULL DEFAULT NULL COMMENT '主推文id',
  `uid` bigint UNSIGNED NOT NULL,
  `media` json NULL COMMENT '图片或视频列表',
  `post_params` json NULL COMMENT '内容延展参数，转推存放原推主信息',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '推文',
  `is_pay` tinyint NOT NULL DEFAULT 2 COMMENT '是否可以否买：1.是 2.否',
  `amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '支付金额',
  `delivery_hour` int NOT NULL DEFAULT 0 COMMENT '交付期（小时）',
  `created_at` datetime NULL DEFAULT NULL,
  `deleted_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '推文表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_post
-- ----------------------------

-- ----------------------------
-- Table structure for customer_post_bookmark
-- ----------------------------
DROP TABLE IF EXISTS `customer_post_bookmark`;
CREATE TABLE `customer_post_bookmark`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `pid` bigint UNSIGNED NOT NULL COMMENT 'customer_post id ',
  `uid` bigint UNSIGNED NOT NULL COMMENT 'customer id',
  `created_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `pid_uid`(`pid` ASC, `uid` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_post_bookmark
-- ----------------------------

-- ----------------------------
-- Table structure for customer_post_comment
-- ----------------------------
DROP TABLE IF EXISTS `customer_post_comment`;
CREATE TABLE `customer_post_comment`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `pid` bigint UNSIGNED NOT NULL COMMENT 'customer_post id',
  `uid` bigint UNSIGNED NOT NULL COMMENT 'customer id',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '评论内容',
  `created_at` datetime NULL DEFAULT NULL,
  `deleted_at` datetime NULL DEFAULT NULL COMMENT '软删除字段',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_post_comment
-- ----------------------------

-- ----------------------------
-- Table structure for customer_post_history
-- ----------------------------
DROP TABLE IF EXISTS `customer_post_history`;
CREATE TABLE `customer_post_history`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `method` tinyint NULL DEFAULT NULL COMMENT '操作：1.发布 2.修改 3.删除',
  `oid` bigint UNSIGNED NOT NULL COMMENT '原表id',
  `uuid` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'uuid用户给用户展示标记',
  `mid` bigint UNSIGNED NULL DEFAULT NULL COMMENT '主推文id',
  `uid` bigint UNSIGNED NOT NULL,
  `media` json NULL COMMENT '图片或视频列表',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '推文',
  `is_pay` tinyint NOT NULL DEFAULT 2 COMMENT '是否可以否买：1.是 2.否',
  `amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '支付金额',
  `delivery_hour` int NOT NULL DEFAULT 0 COMMENT '交付期（小时）',
  `created_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '推文表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_post_history
-- ----------------------------

-- ----------------------------
-- Table structure for customer_post_like
-- ----------------------------
DROP TABLE IF EXISTS `customer_post_like`;
CREATE TABLE `customer_post_like`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `pid` bigint UNSIGNED NOT NULL COMMENT 'customer_post id ',
  `uid` bigint UNSIGNED NOT NULL COMMENT 'customer id',
  `created_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `pid_uid`(`pid` ASC, `uid` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_post_like
-- ----------------------------

-- ----------------------------
-- Table structure for customer_post_push_box
-- ----------------------------
DROP TABLE IF EXISTS `customer_post_push_box`;
CREATE TABLE `customer_post_push_box`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` smallint NOT NULL DEFAULT 1 COMMENT '类型：1.post 2.转推 3.评论',
  `uid` bigint UNSIGNED NOT NULL,
  `pid` bigint UNSIGNED NOT NULL COMMENT '文章post id',
  `puuid` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文章uuid',
  `post_params` json NULL COMMENT '内容延展参数',
  `is_like` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否喜欢：1.默认 2.喜欢 3.不喜欢',
  `is_repost` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否转发：1.默认  2.已转发',
  `is_bookmark` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否收藏：1.默认  2.已收藏',
  `is_read` tinyint NOT NULL DEFAULT 1 COMMENT '是否阅读：1.默认  2.已阅读',
  `is_send` tinyint NOT NULL DEFAULT 1 COMMENT '是否发送：1.默认  2.已发送',
  `post_created_at` datetime NULL DEFAULT NULL COMMENT 'post发布时间',
  `created_at` datetime NOT NULL COMMENT '发送至信箱时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `uid`(`uid` ASC, `created_at` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章推送盒子，每个用户用来接收文章流' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_post_push_box
-- ----------------------------

-- ----------------------------
-- Table structure for customer_setting
-- ----------------------------
DROP TABLE IF EXISTS `customer_setting`;
CREATE TABLE `customer_setting`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `created_at` datetime NULL DEFAULT NULL,
  `updated_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_setting
-- ----------------------------
INSERT INTO `customer_setting` VALUES (1, 'withdraw_fee_amount', '1', '提现手续费', '2024-03-24 22:58:56', '2024-03-24 22:58:58');

-- ----------------------------
-- Table structure for customer_user_extend
-- ----------------------------
DROP TABLE IF EXISTS `customer_user_extend`;
CREATE TABLE `customer_user_extend`  (
  `uid` bigint UNSIGNED NOT NULL COMMENT '用户uid',
  `is_active` tinyint NOT NULL DEFAULT 1 COMMENT '是否活跃用户：1.活跃 2.不活跃',
  `fans_num` int NOT NULL DEFAULT 0 COMMENT '粉丝数',
  `follow_num` int NOT NULL DEFAULT 0 COMMENT '关注他人数',
  `updated_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`uid`) USING BTREE,
  UNIQUE INDEX `uid`(`uid` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_user_extend
-- ----------------------------

-- ----------------------------
-- Table structure for customer_user_post_order
-- ----------------------------
DROP TABLE IF EXISTS `customer_user_post_order`;
CREATE TABLE `customer_user_post_order`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `sn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pay_status` tinyint NOT NULL DEFAULT 1 COMMENT '支付状态： 1.未支付  2.已支付 ',
  `buyer_uid` bigint NOT NULL COMMENT '买家uid',
  `buyer_currency_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '买家币种代码',
  `seller_uid` bigint NOT NULL COMMENT '卖家uid',
  `seller_currency_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '卖家币种代码',
  `pid` bigint NOT NULL COMMENT 'post_id',
  `post_history_id` bigint NOT NULL COMMENT 'post_history_id 快照',
  `amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '金额',
  `buyer_wallet_transaction_id` bigint NULL DEFAULT NULL COMMENT '买家付款关联账变id',
  `seller_wallet_transaction_id` bigint NULL DEFAULT NULL COMMENT '卖家接收关联账变id',
  `dispute_status` tinyint NOT NULL DEFAULT 1 COMMENT '纠纷状态：1.无纠纷 2.纠纷提交待处理 3.纠纷处理中 4.纠纷处理成功',
  `dispute_result_status` tinyint NULL DEFAULT NULL COMMENT '纠纷处理结果：1.无过失 2.有过失',
  `created_at` datetime NULL DEFAULT NULL,
  `updated_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_user_post_order
-- ----------------------------

-- ----------------------------
-- Table structure for customer_user_post_order_dispute
-- ----------------------------
DROP TABLE IF EXISTS `customer_user_post_order_dispute`;
CREATE TABLE `customer_user_post_order_dispute`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `post_order_id` bigint NOT NULL COMMENT '关联订单id',
  `status` tinyint NOT NULL DEFAULT 2 COMMENT '纠纷状态：1.无纠纷 2.待处理 3.处理中 4.处理完成',
  `chat_group_id` bigint NULL DEFAULT NULL COMMENT '纠纷处理聊天组',
  `seller_submit_datetime` datetime NULL DEFAULT NULL COMMENT '卖家上传证据时间',
  `buyer_submit_datetime` datetime NULL DEFAULT NULL COMMENT '卖家上传证据时间',
  `result_status` tinyint NULL DEFAULT NULL COMMENT '判罚状态：1.卖家全责 2.买家权责 3.各部分责任 4.事实不清驳回',
  `buyer_uid` bigint NOT NULL COMMENT '买家uid',
  `buyer_pay_dispute_status` tinyint NULL DEFAULT 1 COMMENT '买家判罚执行结果：1.待执行 2.成功 3.失败',
  `buyer_pay_amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '买家获得判罚金额',
  `buyer_pay_transaction_id` bigint NULL DEFAULT NULL COMMENT '买家关联账变id',
  `buyer_dispute_fee_pay_status` tinyint NOT NULL DEFAULT 1 COMMENT '买家纠纷手续费支付状态：1.未支付 2.已支付',
  `buyer_dispute_fee_amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '买家纠纷手续费USDT计费',
  `buyer_dispute_fee_pay_transaction_id` bigint NULL DEFAULT NULL COMMENT '买家纠纷手续费关联账变id',
  `seller_uid` bigint NOT NULL COMMENT '卖家uid',
  `seller_pay_dispute_status` tinyint NULL DEFAULT 1 COMMENT '卖家判罚执行结果：1.待执行 2.成功 3.失败',
  `seller_pay_amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '卖家获得判罚金额',
  `seller_pay_transaction_id` bigint NULL DEFAULT NULL COMMENT '卖家关联账变id',
  `seller_desc_key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '卖家执行结果备注',
  `seller_desc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `admin_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员备注',
  `admin_uid` int NULL DEFAULT NULL COMMENT '管理员处理人uid',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '订单纠纷处理表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_user_post_order_dispute
-- ----------------------------

-- ----------------------------
-- Table structure for customer_users
-- ----------------------------
DROP TABLE IF EXISTS `customer_users`;
CREATE TABLE `customer_users`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'uid',
  `status` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态：1正常',
  `im_user_id` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT 'im系统唯一uid，默认与id同值',
  `avatar` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '' COMMENT '头像地址',
  `country_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '' COMMENT '国家英语',
  `username` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '',
  `password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '',
  `nickname` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '' COMMENT '昵称',
  `email` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '',
  `phone_area` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '' COMMENT '手机国家区号',
  `phone` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '',
  `is_google_auth` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否开启谷歌验证:1关闭  2开启',
  `google_auth_secret` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '' COMMENT '谷歌验证密钥',
  `created_at` datetime NULL DEFAULT NULL,
  `updated_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_users
-- ----------------------------
INSERT INTO `customer_users` VALUES (1, 1, 'aa', NULL, NULL, 'cc', NULL, NULL, NULL, NULL, NULL, 1, '', NULL, NULL);
INSERT INTO `customer_users` VALUES (6, 1, 'uid_6', NULL, '', 'user_1', '$2a$14$KDg47lcuM00NPDaT3aRFCuaPLx4MhRlEUZjqVUvZ10OiVcwsdBm7a', '', '', '', '', 1, '', '2023-09-14 16:42:12', '2023-09-14 16:42:12');
INSERT INTO `customer_users` VALUES (7, 1, ' ', NULL, NULL, 'test_1', '$2y$12$YaqzVfr.TI7qx39bc.8gVOQ9duUTaHDa3UM2RdCoad99KxMOq.LZO', 'test_1', NULL, NULL, NULL, 1, '', '2023-12-17 17:24:17', '2023-12-17 17:24:17');
INSERT INTO `customer_users` VALUES (8, 1, ' ', NULL, NULL, 'test_2', '$2y$12$uUX2YsCPF8GAfk/343p8iOVVg25UuN20EpkevdoeV2VQW6c1Y2kiS', 'test_2', NULL, NULL, NULL, 1, '', '2023-12-17 17:58:56', '2023-12-17 17:58:56');
INSERT INTO `customer_users` VALUES (9, 1, ' ', NULL, NULL, 'test_3', '$2y$12$heFWQBNxKzkMaDf0NblYR.9IzxSkRbZmtc8GvC7sZYSmRPBs7Of3.', 'test_3', NULL, NULL, NULL, 1, '', '2023-12-17 18:11:43', '2023-12-17 18:11:43');

-- ----------------------------
-- Table structure for customer_wallet_balance
-- ----------------------------
DROP TABLE IF EXISTS `customer_wallet_balance`;
CREATE TABLE `customer_wallet_balance`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `uid` bigint NOT NULL,
  `currency_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '币种代码',
  `total_amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '总余额',
  `frozen_amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '已冻结余额',
  `available_amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '可用余额',
  `security_amount` decimal(32, 8) NOT NULL DEFAULT 0.00000000 COMMENT '担保金余额',
  `recharge_wallet_addr` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '虚拟币钱包充值地址',
  `created_at` datetime NULL DEFAULT NULL,
  `updated_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `uid_code_index`(`uid` ASC, `currency_code` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '平台用户当前各币种余额' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_wallet_balance
-- ----------------------------

-- ----------------------------
-- Table structure for customer_wallet_balance_transaction
-- ----------------------------
DROP TABLE IF EXISTS `customer_wallet_balance_transaction`;
CREATE TABLE `customer_wallet_balance_transaction`  (
  `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  `sn` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '唯一订单号',
  `type` tinyint UNSIGNED NOT NULL COMMENT '账变类型',
  `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态：1.待处理 2.进行中 3.成功 4.失败 5.延期到账',
  `wallet_id` bigint NOT NULL COMMENT '钱包id',
  `uid` bigint NOT NULL,
  `currency_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '币种代码',
  `amount` decimal(64, 12) NOT NULL DEFAULT 0.000000000000 COMMENT '变动金额',
  `fee_amount` decimal(12, 6) NOT NULL DEFAULT 0.000000 COMMENT '手续费（只做记录不参与计算）',
  `before_total_amount` decimal(64, 12) NOT NULL DEFAULT 0.000000000000 COMMENT '钱包地址之前总余额',
  `after_total_amount` decimal(64, 12) NOT NULL DEFAULT 0.000000000000 COMMENT '钱包地址之后总余额',
  `source_params` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '1' COMMENT '来源参数',
  `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户转账备注',
  `target_uid` bigint NULL DEFAULT NULL COMMENT '目标uid',
  `target_post_order_id` bigint NULL DEFAULT NULL COMMENT '目标订单id',
  `target_post_order_dispute_id` bigint NULL DEFAULT NULL COMMENT '纠纷id',
  `sign` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '签名',
  `callback_time` datetime NULL DEFAULT NULL COMMENT '回调时间',
  `delay_payment_time` datetime NULL DEFAULT NULL COMMENT '延期到账时间',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户账变表关联到wallet_platform_user_balance表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_wallet_balance_transaction
-- ----------------------------

-- ----------------------------
-- Table structure for customer_wallet_currency
-- ----------------------------
DROP TABLE IF EXISTS `customer_wallet_currency`;
CREATE TABLE `customer_wallet_currency`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `type` smallint UNSIGNED NOT NULL COMMENT '币种类型：1.现金 2.加密货币',
  `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '币种代码（唯一）',
  `token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '币种合约地址',
  `transfer_rate` decimal(10, 6) NOT NULL DEFAULT 0.000000 COMMENT '转账费率',
  `desc` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明',
  `created_at` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `code_index`(`code` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '钱包币种表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_wallet_currency
-- ----------------------------

-- ----------------------------
-- Table structure for customer_ws_history
-- ----------------------------
DROP TABLE IF EXISTS `customer_ws_history`;
CREATE TABLE `customer_ws_history`  (
  `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  `event` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT '连接事件：1.onConnect ',
  `status` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态：1.成功 2.失败',
  `uid` bigint UNSIGNED NOT NULL COMMENT '用户uid',
  `device` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '登录设备：1.app 2.web 3.h5',
  `created_at` datetime NOT NULL COMMENT '登录时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户werbsocket连接记录' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of customer_ws_history
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;
