Browse Source

fix:修改分发邮箱bug

GTong 7 months ago
parent
commit
7a8ef90738

+ 2 - 1
.gitignore

@@ -1,4 +1,5 @@
 logs/
 pkg/lic
 *.mod
-*.sum
+*.sum
+lic-template/

+ 53 - 0
CRLF_lic_op_20241015105959_企业版(双机).cfg

@@ -0,0 +1,53 @@
+
+#用户项目信息
+	project_name    = 
+	user_name       = 企业版(双机)
+	user_addr       = 未填写
+	serial_number   = 未填写
+#环境信息
+	cpu_sn          = 未填写
+	baseboard_sn    = 未填写
+	mac_addr        =  fa:b4:49:60:01:00
+	disk_id         = 未填写
+	ip_addr         = 未填写
+#License信息
+	gen_date        = 2024-07-15
+	expire_date     = 9999-12-31
+	license_type    = 3
+	license_version = 1
+	hard_type       = 3
+#企业版                                   
+    ha              = true
+    hint            = true
+    full_text_index = true
+    function_index  = true
+    batch_mode      = true
+    pl_sql          = true
+#分布式版
+    add_node            = false
+    auto_partition      = true
+    resource_quota      = true
+    net_channel         = 0
+    data_auto_rebalance = true
+#其他组件
+    black_white_list   = true
+    mac                = true
+    col_privilege      = true
+    transmit_encrypt   = true
+    store_encrypt      = true
+    backup_encrypt     = true
+    audit_mode         = 0
+    global_binlog_node = 0
+    dblink             = true
+    json               = true
+    spatial            = true
+    max_parallel       = 0
+    stream_load        = true
+#服务能力
+    instance_num   = 0
+    table_rows     = 0
+    connect_num    = 0
+    store_capacity = 0
+    max_node_num   = 0
+    listen_channel = 0
+	

+ 53 - 0
CRLF_lic_op_20241015110000_企业版(双机).cfg

@@ -0,0 +1,53 @@
+
+#用户项目信息
+	project_name    = 
+	user_name       = 企业版(双机)
+	user_addr       = 未填写
+	serial_number   = 未填写
+#环境信息
+	cpu_sn          = 未填写
+	baseboard_sn    = 未填写
+	mac_addr        = fa:2a:16:56:5d:00
+	disk_id         = 未填写
+	ip_addr         = 未填写
+#License信息
+	gen_date        = 2024-07-15
+	expire_date     = 9999-12-31
+	license_type    = 3
+	license_version = 1
+	hard_type       = 3
+#企业版                                   
+    ha              = true
+    hint            = true
+    full_text_index = true
+    function_index  = true
+    batch_mode      = true
+    pl_sql          = true
+#分布式版
+    add_node            = false
+    auto_partition      = true
+    resource_quota      = true
+    net_channel         = 0
+    data_auto_rebalance = true
+#其他组件
+    black_white_list   = true
+    mac                = true
+    col_privilege      = true
+    transmit_encrypt   = true
+    store_encrypt      = true
+    backup_encrypt     = true
+    audit_mode         = 0
+    global_binlog_node = 0
+    dblink             = true
+    json               = true
+    spatial            = true
+    max_parallel       = 0
+    stream_load        = true
+#服务能力
+    instance_num   = 0
+    table_rows     = 0
+    connect_num    = 0
+    store_capacity = 0
+    max_node_num   = 0
+    listen_channel = 0
+	

+ 1 - 1
config.toml

@@ -18,4 +18,4 @@ licdb_password = "SYSDBA"
 
 
 [logs]
-lic_log = "/logs"
+lic_log = "./logs"

+ 12 - 3
internal/services/OALicenseInfo_services.go

@@ -184,27 +184,36 @@ func DistributeLicenseToEmailServices(OperatorUniqueID string, OaRequestId int64
 	for i, lic := range *LicInfos {
 		ii := i + 1
 		num := 1
-		filetestName := fmt.Sprintf("%d_%s_license_jdCount%d_%d", ii, lic.LicInfo.OAGLXMName.String, lic.LicInfo.OANodeCount.Int64, num)
+		filetestName := fmt.Sprintf("%d_%s_license_%djd_%d", ii, lic.LicInfo.OAGLXMName.String, lic.LicInfo.OANodeCount.Int64, num)
 		num++
 		// 将数据添加到 ZIP 中
-		file1, err := zipWriter.Create(fmt.Sprintf(filetestName+"_%s", lic.LicInfo.OAMainMAC.String))
+		file1, err := zipWriter.Create(fmt.Sprintf(filetestName+"_%s.dat", lic.LicInfo.OAMainMAC.String))
 		if err != nil {
 			global.Logger.Errorln(err)
+			return err, nil
 		}
 		if lic.GenrateInfo.Lic1.Valid {
 			_, err = file1.Write([]byte(lic.GenrateInfo.Lic1.String))
 			if err != nil {
 				global.Logger.Errorln(err)
+				return err, nil
 			}
 		}
-		file2, err := zipWriter.Create(fmt.Sprintf(filetestName+"_%s", lic.LicInfo.OASecondMAC.String))
+
 		if lic.GenrateInfo.Lic2.Valid {
 			if err != nil {
 				global.Logger.Errorln(err)
+				return err, nil
+			}
+			file2, err := zipWriter.Create(fmt.Sprintf(filetestName+"_%s", lic.LicInfo.OASecondMAC.String))
+			if err != nil {
+				global.Logger.Errorln(err)
+				return err, nil
 			}
 			_, err = file2.Write([]byte(lic.GenrateInfo.Lic2.String))
 			if err != nil {
 				global.Logger.Errorln(err)
+				return err, nil
 			}
 
 		}

+ 53 - 0
lic_op_20241015105959_企业版(双机).cfg

@@ -0,0 +1,53 @@
+
+#用户项目信息
+	project_name    = 
+	user_name       = 企业版(双机)
+	user_addr       = 未填写
+	serial_number   = 未填写
+#环境信息
+	cpu_sn          = 未填写
+	baseboard_sn    = 未填写
+	mac_addr        =  fa:b4:49:60:01:00
+	disk_id         = 未填写
+	ip_addr         = 未填写
+#License信息
+	gen_date        = 2024-07-15
+	expire_date     = 9999-12-31
+	license_type    = 3
+	license_version = 1
+	hard_type       = 3
+#企业版                                   
+    ha              = true
+    hint            = true
+    full_text_index = true
+    function_index  = true
+    batch_mode      = true
+    pl_sql          = true
+#分布式版
+    add_node            = false
+    auto_partition      = true
+    resource_quota      = true
+    net_channel         = 0
+    data_auto_rebalance = true
+#其他组件
+    black_white_list   = true
+    mac                = true
+    col_privilege      = true
+    transmit_encrypt   = true
+    store_encrypt      = true
+    backup_encrypt     = true
+    audit_mode         = 0
+    global_binlog_node = 0
+    dblink             = true
+    json               = true
+    spatial            = true
+    max_parallel       = 0
+    stream_load        = true
+#服务能力
+    instance_num   = 0
+    table_rows     = 0
+    connect_num    = 0
+    store_capacity = 0
+    max_node_num   = 0
+    listen_channel = 0
+	

+ 53 - 0
lic_op_20241015110000_企业版(双机).cfg

@@ -0,0 +1,53 @@
+
+#用户项目信息
+	project_name    = 
+	user_name       = 企业版(双机)
+	user_addr       = 未填写
+	serial_number   = 未填写
+#环境信息
+	cpu_sn          = 未填写
+	baseboard_sn    = 未填写
+	mac_addr        = fa:2a:16:56:5d:00
+	disk_id         = 未填写
+	ip_addr         = 未填写
+#License信息
+	gen_date        = 2024-07-15
+	expire_date     = 9999-12-31
+	license_type    = 3
+	license_version = 1
+	hard_type       = 3
+#企业版                                   
+    ha              = true
+    hint            = true
+    full_text_index = true
+    function_index  = true
+    batch_mode      = true
+    pl_sql          = true
+#分布式版
+    add_node            = false
+    auto_partition      = true
+    resource_quota      = true
+    net_channel         = 0
+    data_auto_rebalance = true
+#其他组件
+    black_white_list   = true
+    mac                = true
+    col_privilege      = true
+    transmit_encrypt   = true
+    store_encrypt      = true
+    backup_encrypt     = true
+    audit_mode         = 0
+    global_binlog_node = 0
+    dblink             = true
+    json               = true
+    spatial            = true
+    max_parallel       = 0
+    stream_load        = true
+#服务能力
+    instance_num   = 0
+    table_rows     = 0
+    connect_num    = 0
+    store_capacity = 0
+    max_node_num   = 0
+    listen_channel = 0
+