From ca6e160bef0695a0fd24ffe6bc0347f41a3cdcb7 Mon Sep 17 00:00:00 2001 From: luorijun Date: Sat, 12 Apr 2025 11:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=20node.isp=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- cmd/playground/main.go | 10 +++------- scripts/sql/init.sql | 8 ++++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bec252f..7cc325d 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,11 @@ 中间件: -- [ ] CORS - [ ] Limiter - [ ] Compress +检查数据库枚举字段,0 值只作为空值使用 + 实现开发时迁移脚本: - 检查 sql 注释 - 执行迁移 diff --git a/cmd/playground/main.go b/cmd/playground/main.go index f105b42..ae46f68 100644 --- a/cmd/playground/main.go +++ b/cmd/playground/main.go @@ -1,11 +1,7 @@ package main -import ( - "platform/web/services" -) - func main() { - for range 12 { - println(services.ID.GenReadable("res")) - } + println(rune('\r')) + println(rune('\n')) + println(rune('|')) } diff --git a/scripts/sql/init.sql b/scripts/sql/init.sql index faffaf8..6049d50 100644 --- a/scripts/sql/init.sql +++ b/scripts/sql/init.sql @@ -427,7 +427,7 @@ create table node ( version int not null, name varchar(255) not null unique, host varchar(255) not null, - isp varchar(255) not null, + isp int not null, prov varchar(255) not null, city varchar(255) not null, proxy_id int references proxy (id) @@ -453,7 +453,7 @@ comment on column node.id is '节点ID'; comment on column node.version is '节点版本'; comment on column node.name is '节点名称'; comment on column node.host is '节点地址'; -comment on column node.isp is '运营商'; +comment on column node.isp is '运营商:0-其他,1-电信,2-联通,3-移动'; comment on column node.prov is '省份'; comment on column node.city is '城市'; comment on column node.proxy_id is '代理ID'; @@ -508,7 +508,7 @@ create table channel ( proxy_host varchar(255) not null default '', proxy_port int not null, node_host varchar(255), - protocol varchar(255), + protocol int, auth_ip bool not null default false, user_host varchar(255), auth_pass bool not null default false, @@ -543,7 +543,7 @@ comment on column channel.proxy_port is '转发端口'; comment on column channel.node_host is '节点地址'; comment on column channel.auth_ip is 'IP认证'; comment on column channel.auth_pass is '密码认证'; -comment on column channel.protocol is '协议'; +comment on column channel.protocol is '协议类型:1-http,2-https,3-socks5'; comment on column channel.username is '用户名'; comment on column channel.password is '密码'; comment on column channel.expiration is '过期时间';