From def973175fd11debcc4795b12af1a5c9e63b8e66 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sat, 13 Jan 2024 19:32:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=A2=9E=E5=8A=A0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=9C=80=E5=A4=A7=E4=B8=8A=E4=BC=A0=E5=B0=BA=E5=AF=B8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/plan_model.go | 9 ++++++--- internal/setup/sql.json | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/db/models/plan_model.go b/internal/db/models/plan_model.go index 87b6c233..7cca05d0 100644 --- a/internal/db/models/plan_model.go +++ b/internal/db/models/plan_model.go @@ -9,7 +9,7 @@ const ( PlanField_Description dbs.FieldName = "description" // 套餐简介 PlanField_ClusterId dbs.FieldName = "clusterId" // 集群ID PlanField_TrafficLimit dbs.FieldName = "trafficLimit" // 流量限制 - PlanField_BandwidthLimitPerNode dbs.FieldName = "bandwidthLimitPerNode" // 带宽限制 + PlanField_BandwidthLimitPerNode dbs.FieldName = "bandwidthLimitPerNode" // 单节点带宽限制 PlanField_Features dbs.FieldName = "features" // 允许的功能 PlanField_HasFullFeatures dbs.FieldName = "hasFullFeatures" // 是否有完整的功能 PlanField_TrafficPrice dbs.FieldName = "trafficPrice" // 流量价格设定 @@ -27,6 +27,7 @@ const ( PlanField_DailyRequests dbs.FieldName = "dailyRequests" // 每日访问量额度 PlanField_DailyWebsocketConnections dbs.FieldName = "dailyWebsocketConnections" // 每日Websocket连接数 PlanField_MonthlyWebsocketConnections dbs.FieldName = "monthlyWebsocketConnections" // 每月Websocket连接数 + PlanField_MaxUploadSize dbs.FieldName = "maxUploadSize" // 最大上传 ) // Plan 用户套餐 @@ -37,7 +38,7 @@ type Plan struct { Description string `field:"description"` // 套餐简介 ClusterId uint32 `field:"clusterId"` // 集群ID TrafficLimit dbs.JSON `field:"trafficLimit"` // 流量限制 - BandwidthLimitPerNode dbs.JSON `field:"bandwidthLimitPerNode"` // 带宽限制 + BandwidthLimitPerNode dbs.JSON `field:"bandwidthLimitPerNode"` // 单节点带宽限制 Features dbs.JSON `field:"features"` // 允许的功能 HasFullFeatures bool `field:"hasFullFeatures"` // 是否有完整的功能 TrafficPrice dbs.JSON `field:"trafficPrice"` // 流量价格设定 @@ -55,6 +56,7 @@ type Plan struct { DailyRequests uint64 `field:"dailyRequests"` // 每日访问量额度 DailyWebsocketConnections uint64 `field:"dailyWebsocketConnections"` // 每日Websocket连接数 MonthlyWebsocketConnections uint64 `field:"monthlyWebsocketConnections"` // 每月Websocket连接数 + MaxUploadSize dbs.JSON `field:"maxUploadSize"` // 最大上传 } type PlanOperator struct { @@ -64,7 +66,7 @@ type PlanOperator struct { Description any // 套餐简介 ClusterId any // 集群ID TrafficLimit any // 流量限制 - BandwidthLimitPerNode any // 带宽限制 + BandwidthLimitPerNode any // 单节点带宽限制 Features any // 允许的功能 HasFullFeatures any // 是否有完整的功能 TrafficPrice any // 流量价格设定 @@ -82,6 +84,7 @@ type PlanOperator struct { DailyRequests any // 每日访问量额度 DailyWebsocketConnections any // 每日Websocket连接数 MonthlyWebsocketConnections any // 每月Websocket连接数 + MaxUploadSize any // 最大上传 } func NewPlanOperator() *PlanOperator { diff --git a/internal/setup/sql.json b/internal/setup/sql.json index 31434d83..d9a39c07 100644 --- a/internal/setup/sql.json +++ b/internal/setup/sql.json @@ -111485,7 +111485,7 @@ "name": "edgePlans", "engine": "InnoDB", "charset": "utf8mb4_general_ci", - "definition": "CREATE TABLE `edgePlans` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',\n `isOn` tinyint(1) unsigned DEFAULT '1' COMMENT '是否启用',\n `name` varchar(255) DEFAULT NULL COMMENT '套餐名',\n `description` varchar(255) DEFAULT NULL COMMENT '套餐简介',\n `clusterId` int(11) unsigned DEFAULT '0' COMMENT '集群ID',\n `trafficLimit` json DEFAULT NULL COMMENT '流量限制',\n `bandwidthLimitPerNode` json DEFAULT NULL COMMENT '单节点带宽限制',\n `features` json DEFAULT NULL COMMENT '允许的功能',\n `hasFullFeatures` tinyint(1) unsigned DEFAULT '1' COMMENT '是否有完整的功能',\n `trafficPrice` json DEFAULT NULL COMMENT '流量价格设定',\n `bandwidthPrice` json DEFAULT NULL COMMENT '带宽价格',\n `monthlyPrice` decimal(12,2) unsigned DEFAULT '0.00' COMMENT '月付',\n `seasonallyPrice` decimal(12,2) unsigned DEFAULT '0.00' COMMENT '季付',\n `yearlyPrice` decimal(12,2) unsigned DEFAULT '0.00' COMMENT '年付',\n `priceType` varchar(32) DEFAULT NULL COMMENT '价格类型',\n `order` int(11) unsigned DEFAULT '0' COMMENT '排序',\n `state` tinyint(1) unsigned DEFAULT '1' COMMENT '状态',\n `totalServers` int(11) unsigned DEFAULT '1' COMMENT '可以绑定的网站数量',\n `totalServerNamesPerServer` int(255) unsigned DEFAULT '0' COMMENT '每个网站可以绑定的域名数量',\n `totalServerNames` int(255) unsigned DEFAULT '0' COMMENT '总域名数量',\n `monthlyRequests` bigint(20) unsigned DEFAULT '0' COMMENT '每月访问量额度',\n `dailyRequests` bigint(20) unsigned DEFAULT '0' COMMENT '每日访问量额度',\n `dailyWebsocketConnections` bigint(20) unsigned DEFAULT '0' COMMENT '每日Websocket连接数',\n `monthlyWebsocketConnections` bigint(20) unsigned DEFAULT '0' COMMENT '每月Websocket连接数',\n PRIMARY KEY (`id`),\n KEY `state` (`state`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户套餐'", + "definition": "CREATE TABLE `edgePlans` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',\n `isOn` tinyint(1) unsigned DEFAULT '1' COMMENT '是否启用',\n `name` varchar(255) DEFAULT NULL COMMENT '套餐名',\n `description` varchar(255) DEFAULT NULL COMMENT '套餐简介',\n `clusterId` int(11) unsigned DEFAULT '0' COMMENT '集群ID',\n `trafficLimit` json DEFAULT NULL COMMENT '流量限制',\n `bandwidthLimitPerNode` json DEFAULT NULL COMMENT '单节点带宽限制',\n `features` json DEFAULT NULL COMMENT '允许的功能',\n `hasFullFeatures` tinyint(1) unsigned DEFAULT '1' COMMENT '是否有完整的功能',\n `trafficPrice` json DEFAULT NULL COMMENT '流量价格设定',\n `bandwidthPrice` json DEFAULT NULL COMMENT '带宽价格',\n `monthlyPrice` decimal(12,2) unsigned DEFAULT '0.00' COMMENT '月付',\n `seasonallyPrice` decimal(12,2) unsigned DEFAULT '0.00' COMMENT '季付',\n `yearlyPrice` decimal(12,2) unsigned DEFAULT '0.00' COMMENT '年付',\n `priceType` varchar(32) DEFAULT NULL COMMENT '价格类型',\n `order` int(11) unsigned DEFAULT '0' COMMENT '排序',\n `state` tinyint(1) unsigned DEFAULT '1' COMMENT '状态',\n `totalServers` int(11) unsigned DEFAULT '1' COMMENT '可以绑定的网站数量',\n `totalServerNamesPerServer` int(255) unsigned DEFAULT '0' COMMENT '每个网站可以绑定的域名数量',\n `totalServerNames` int(255) unsigned DEFAULT '0' COMMENT '总域名数量',\n `monthlyRequests` bigint(20) unsigned DEFAULT '0' COMMENT '每月访问量额度',\n `dailyRequests` bigint(20) unsigned DEFAULT '0' COMMENT '每日访问量额度',\n `dailyWebsocketConnections` bigint(20) unsigned DEFAULT '0' COMMENT '每日Websocket连接数',\n `monthlyWebsocketConnections` bigint(20) unsigned DEFAULT '0' COMMENT '每月Websocket连接数',\n `maxUploadSize` json DEFAULT NULL COMMENT '最大上传',\n PRIMARY KEY (`id`),\n KEY `state` (`state`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户套餐'", "fields": [ { "name": "id", @@ -111582,6 +111582,10 @@ { "name": "monthlyWebsocketConnections", "definition": "bigint(20) unsigned DEFAULT '0' COMMENT '每月Websocket连接数'" + }, + { + "name": "maxUploadSize", + "definition": "json COMMENT '最大上传'" } ], "indexes": [