-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature v1.3.0 查看合并请求 Project/Bullet!1
- Loading branch information
Showing
90 changed files
with
1,852 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,18 @@ | ||
|
||
CREATE TABLE `orders` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单id', | ||
`order_no` varchar(22) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单号', | ||
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id', | ||
`resource_type` int(2) NULL DEFAULT NULL COMMENT '资源类型 1域名 2端口 3流量 4 充值', | ||
`domain_id` bigint(22) NULL DEFAULT NULL COMMENT '资源id', | ||
`amount` bigint(22) NULL DEFAULT NULL COMMENT '购买量 单位:秒、MB', | ||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源名称', | ||
`price_amount` decimal(12, 2) NULL DEFAULT NULL COMMENT '原价', | ||
`discount_amount` decimal(12, 2) NULL DEFAULT NULL COMMENT '优惠金额', | ||
`pay_amount` decimal(12, 2) NULL DEFAULT NULL COMMENT '支付价格', | ||
`pay_type` int(1) NULL DEFAULT NULL COMMENT '支付方式 1余额 2支付宝', | ||
`status` tinyint(2) NULL DEFAULT NULL COMMENT '订单状态 0待支付 1已支付 2 取消 3退款中 4已退款', | ||
`trade_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '三方交易号', | ||
`pay_time` datetime(0) NULL DEFAULT NULL COMMENT '支付时间', | ||
`refund_time` datetime(0) NULL DEFAULT NULL COMMENT '退款时间', | ||
`cancel_time` datetime(0) NULL DEFAULT NULL COMMENT '取消时间', | ||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', | ||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', | ||
PRIMARY KEY (`id`) USING BTREE | ||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; | ||
|
||
-- 2022-09-05 marker 在线设备新增通道id | ||
ALTER TABLE `t_device_online` | ||
ADD COLUMN `server_tunnel_id` int(11) NULL COMMENT '通道id' AFTER `client_version`, | ||
MODIFY COLUMN `updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间' AFTER `client_version`; | ||
|
||
ALTER TABLE `t_domain` | ||
MODIFY COLUMN `sales_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '销售价格(元/天)' AFTER `create_time`, | ||
MODIFY COLUMN `original_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '原价(元/天)' AFTER `sales_price`; | ||
update t_device_online set server_tunnel_id =1; | ||
|
||
-- 2022-09-05 marker 在线设备新增设备信息 | ||
ALTER TABLE `t_device_online` | ||
ADD COLUMN `os` varchar(20) NULL COMMENT '操作系统' AFTER `server_tunnel_id`, | ||
ADD COLUMN `arch` varchar(20) NULL COMMENT 'CPU架构' AFTER `os`; | ||
|
||
|
||
ALTER TABLE `t_sys_users` | ||
ADD COLUMN `user_admin` tinyint(1) NULL DEFAULT 0 COMMENT '是否后台用户 1是 0否' AFTER `activate_code`; | ||
|
||
update t_sys_users set user_admin = 0 ; | ||
|
||
-- 2022-07-31 忘记密码增加索引 | ||
ALTER TABLE `t_user_forget` | ||
ADD INDEX `idx_code`(`code`), | ||
ADD INDEX `idx_email`(`email`); | ||
|
||
-- 2022-08-03 设备任意门文件服务器 | ||
CREATE TABLE `t_device_door` ( | ||
`id` bigint(22) NOT NULL AUTO_INCREMENT COMMENT 'id', | ||
`device_id` bigint(20) NULL DEFAULT NULL COMMENT '设备id', | ||
`local_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '本地服务路径', | ||
`server_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '服务端路径', | ||
`enable` int(1) NULL DEFAULT 0 COMMENT '启用状态 1启用 0停用', | ||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', | ||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', | ||
PRIMARY KEY (`id`) USING BTREE | ||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设备任意门' ROW_FORMAT = Dynamic; | ||
|
||
|
||
|
||
CREATE TABLE `device_peers` ( | ||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', | ||
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id', | ||
`server_device_id` bigint(11) NULL DEFAULT NULL COMMENT '服务侧设备id', | ||
`client_device_id` bigint(11) NULL DEFAULT NULL COMMENT '客户侧设备id', | ||
`server_local_port` int(11) NULL DEFAULT NULL COMMENT '服务侧本地端口', | ||
`client_proxy_port` int(11) NULL DEFAULT NULL COMMENT '客户侧代理端口', | ||
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态 1启用 0禁用', | ||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', | ||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', | ||
PRIMARY KEY (`id`) USING BTREE | ||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; | ||
|
||
|
||
ALTER TABLE `device_peers` | ||
ADD COLUMN `app_name` varchar(200) NULL COMMENT 'p2pAppName' AFTER `user_id`; | ||
|
||
-- 2022-08-12 marker 新增特定IP | ||
ALTER TABLE `device_peers` | ||
ADD COLUMN `server_local_host` varchar(20) NULL COMMENT '服务侧本地host' AFTER `server_local_port`, | ||
ADD COLUMN `client_proxy_host` varchar(20) NULL COMMENT '客户侧代理host' AFTER `client_proxy_port`, | ||
ADD COLUMN `remark` varchar(220) NULL COMMENT '备注' AFTER `client_proxy_host`; | ||
|
||
|
||
ALTER TABLE `device_peers` COMMENT = 'P2P映射'; | ||
|
||
|
||
-- 2022-08-21 marker 设备socks5代理 | ||
CREATE TABLE `device_proxy` ( | ||
`id` bigint(22) NOT NULL AUTO_INCREMENT COMMENT 'id', | ||
`device_id` bigint(22) NULL DEFAULT NULL COMMENT '设备id', | ||
`device_proxy_port` int(11) NULL DEFAULT NULL COMMENT '设备代理服务端口', | ||
`domain_id` int(11) NULL DEFAULT NULL COMMENT '端口id', | ||
`type` varchar(20) NULL DEFAULT NULL COMMENT '代理协议:http/https/socks5', | ||
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态 1启用 0禁用', | ||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', | ||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', | ||
PRIMARY KEY (`id`) USING BTREE | ||
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '设备代理' ROW_FORMAT = Dynamic; | ||
|
||
-- 2022-08-30 marker 数据收集的扩展字段 | ||
ALTER TABLE `data_metrics` | ||
ADD COLUMN `duration` int(11) NULL COMMENT '链接占用时长' AFTER `bytes_out`, | ||
ADD COLUMN `open_time` datetime NULL COMMENT '打开链接时间' AFTER `duration`, | ||
ADD COLUMN `close_time` datetime NULL COMMENT '关闭链接时间' AFTER `open_time`, | ||
ADD COLUMN `remote_addr` varchar(24) NULL COMMENT '远端地址' AFTER `close_time`; | ||
-- 历史数据处理 | ||
update data_metrics set duration = 0, open_time = create_time, close_time = create_time; | ||
|
||
|
||
-- 2022-08-31 marker 任意门新增domainid字段 | ||
ALTER TABLE `t_device_door` | ||
ADD COLUMN `domain_id` bigint(22) NULL COMMENT '域名id' AFTER `device_id`; | ||
ALTER TABLE `t_server_tunnel` | ||
ADD COLUMN `status` int(2) NULL COMMENT '在线状态 1在线 0不在线' AFTER `buy_status`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
joggle-common/src/main/java/com/wuweibi/bullet/protocol/MsgDeviceDown.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package com.wuweibi.bullet.protocol; | ||
/** | ||
* Created by marker on 2017/12/7. | ||
*/ | ||
|
||
import com.wuweibi.bullet.utils.Utils; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
|
||
/** | ||
* 设备下线消息 | ||
* @author marker | ||
* @create 2017-12-07 下午1:13 | ||
**/ | ||
public class MsgDeviceDown extends Message { | ||
|
||
|
||
// deviceNo | ||
private String deviceNo; | ||
|
||
|
||
|
||
/** | ||
* 构造 | ||
*/ | ||
public MsgDeviceDown(String deviceNo) { | ||
super(Message.DEVICE_DOWN); | ||
this.deviceNo = deviceNo; | ||
getHead().setLength(super.getLength() + deviceNo.length()); | ||
} | ||
|
||
public MsgDeviceDown() { | ||
super(Message.DEVICE_DOWN); | ||
} | ||
|
||
public MsgDeviceDown(MsgHead head) { | ||
super(Message.DEVICE_DOWN, head); | ||
} | ||
|
||
|
||
@Override | ||
public void write(OutputStream out) throws IOException { | ||
getHead().write(out); | ||
int len = deviceNo.getBytes().length; | ||
// 写入IP地址 | ||
byte bs[] = new byte[len]; | ||
System.arraycopy(deviceNo.getBytes(), 0, bs, 0, len); | ||
out.write(bs); | ||
out.flush(); | ||
} | ||
|
||
@Override | ||
public void read(InputStream in) throws IOException { | ||
// 读取deviceNo | ||
int len = getHead().getLength() - 24; | ||
|
||
byte bs[] = new byte[len]; | ||
in.read(bs); | ||
this.deviceNo = Utils.getString(bs, 0, len); | ||
|
||
} | ||
|
||
public String getDeviceNo() { | ||
return deviceNo; | ||
} | ||
|
||
public void setDeviceNo(String deviceNo) { | ||
this.deviceNo = deviceNo; | ||
getHead().setLength(super.getLength() + deviceNo.length()); | ||
} | ||
} |
Oops, something went wrong.