4 Commits

Author SHA1 Message Date
zhangsz
45a0ab1707 chore: service fix 2025-08-08 11:44:39 +08:00
zhangsz
4dfea691d1 chore: release 1.2508.1 2025-08-08 10:41:54 +08:00
zhangsz
758fa02f7f fix: ne ssh issu 2025-08-08 10:41:32 +08:00
zhangsz
4da891c883 fix: cb message issue 2025-08-08 10:41:03 +08:00
10 changed files with 26 additions and 24 deletions

View File

@@ -11,7 +11,6 @@ LimitNPROC=65535
Restart=always Restart=always
RestartSec=10 RestartSec=10
StartLimitIntervalSec=60
StartLimitBurst=3 StartLimitBurst=3
ExecStart=/usr/local/omc/bin/restagent -c /usr/local/omc/etc/restconf.yaml ExecStart=/usr/local/omc/bin/restagent -c /usr/local/omc/etc/restconf.yaml
RestartPreventExitStatus=SIGTERM SIGKILL RestartPreventExitStatus=SIGTERM SIGKILL

View File

@@ -33,7 +33,5 @@ CREATE TABLE `ne_info` (
-- 初始网元数据 -- 初始网元数据
INSERT INTO `ne_info` VALUES (1, 'OMC', '001', '4400PSAPOMC001', 'PSAP门户管理中心', '172.16.5.100', 33030, 'PNF', '-', '-', '-', '-', '1,2', 0, '', '', 0, '', 0); INSERT INTO `ne_info` VALUES (1, 'OMC', '001', '4400PSAPOMC001', 'PSAP门户管理中心', '172.16.5.100', 33030, 'PNF', '-', '-', '-', '-', '1,2', 0, '', '', 0, '', 0);
INSERT INTO `ne_info` VALUES (2, 'MF', '001', '4400PSAPMF0001', 'PSAP紧急呼叫中心', '172.16.5.110', 33030, 'PNF', '-', '-', '-', '-', '3,4', 0, '', '', 0, '', 0);
INSERT INTO `ne_info` VALUES (3, 'CBC', '001', '4400PSAPCBC001', 'PSAP小区广播中心', '172.16.5.120', 33030, 'PNF', '-', '-', '-', '-', '3,4', 0, '', '', 0, '', 0);
SET FOREIGN_KEY_CHECKS=1; SET FOREIGN_KEY_CHECKS=1;

View File

@@ -27,9 +27,5 @@ CREATE TABLE `ne_license` (
-- 初始数据对应网元 -- 初始数据对应网元
INSERT INTO `ne_license` VALUES (1, 'OMC', '001', '', '', '', '', '0', '', 'supervisor', (UNIX_TIMESTAMP(NOW(3)) * 1000), '', 0); INSERT INTO `ne_license` VALUES (1, 'OMC', '001', '', '', '', '', '0', '', 'supervisor', (UNIX_TIMESTAMP(NOW(3)) * 1000), '', 0);
INSERT INTO `ne_license` VALUES (2, 'CBC', '001', '', '', '', '', '0', '', 'supervisor', (UNIX_TIMESTAMP(NOW(3)) * 1000), '', 0);
INSERT INTO `ne_license` VALUES (3, 'MF', '001', '', '', '', '', '0', '', 'supervisor', (UNIX_TIMESTAMP(NOW(3)) * 1000), '', 0);
INSERT INTO `ne_license` VALUES (4, 'IMS', '001', '', '', '', '', '0', '', 'supervisor', (UNIX_TIMESTAMP(NOW(3)) * 1000), '', 0);
INSERT INTO `ne_license` VALUES (5, 'SMSC', '001', '', '', '', '', '0', '', 'supervisor', (UNIX_TIMESTAMP(NOW(3)) * 1000), '', 0);
SET FOREIGN_KEY_CHECKS=1; SET FOREIGN_KEY_CHECKS=1;

View File

@@ -31,7 +31,5 @@ CREATE TABLE `ne_version` (
-- 初始数据对应网元 -- 初始数据对应网元
INSERT INTO `ne_version` VALUES (1, 'OMC', '001', '', '', '', '', '', '', '', '', '', '0', 'supervisor', 1713928436957, '', 0); INSERT INTO `ne_version` VALUES (1, 'OMC', '001', '', '', '', '', '', '', '', '', '', '0', 'supervisor', 1713928436957, '', 0);
INSERT INTO `ne_version` VALUES (2, 'CBC', '001', '', '', '', '', '', '', '', '', '', '0', 'supervisor', 1713928436957, '', 0);
INSERT INTO `ne_version` VALUES (3, 'MF', '001', '', '', '', '', '', '', '', '', '', '0', 'supervisor', 1713928436957, '', 0);
SET FOREIGN_KEY_CHECKS=1; SET FOREIGN_KEY_CHECKS=1;

View File

@@ -32,9 +32,5 @@ CREATE TABLE IF NOT EXISTS `ne_info` (
-- 初始网元数据 -- 初始网元数据
INSERT IGNORE INTO `ne_info` VALUES (1, 'OMC', '001', '4400PSAPOMC001', 'PSAP门户管理中心', '172.16.5.100', 33030, 'PNF', '-', '-', '-', '-', '1,2', 0, '', '', 0, '', 0); INSERT IGNORE INTO `ne_info` VALUES (1, 'OMC', '001', '4400PSAPOMC001', 'PSAP门户管理中心', '172.16.5.100', 33030, 'PNF', '-', '-', '-', '-', '1,2', 0, '', '', 0, '', 0);
INSERT IGNORE INTO `ne_info` VALUES (2, 'MF', '001', '4400PSAPMF0001', 'PSAP紧急呼叫中心', '172.16.5.110', 33030, 'PNF', '-', '-', '-', '-', '3,4', 0, '', '', 0, '', 0);
INSERT IGNORE INTO `ne_info` VALUES (3, 'CBC', '001', '4400PSAPCBC001', 'PSAP小区广播中心', '172.16.5.120', 33030, 'PNF', '-', '-', '-', '-', '3,4', 0, '', '', 0, '', 0);
INSERT IGNORE INTO `ne_info` VALUES (4, 'IMS', '001', '4400PSAPIMS001', 'PSAP彩铃中心', '172.16.5.130', 33030, 'PNF', '-', '-', '-', '-', '3,4', 0, '', '', 0, '', 0);
INSERT IGNORE INTO `ne_info` VALUES (5, 'SMSC', '001', '4400PSAPSMSC01', 'PSAP彩信中心', '172.16.5.140', 33030, 'PNF', '-', '-', '-', '-', '3,4', 0, '', '', 0, '', 0);
SET FOREIGN_KEY_CHECKS=1; SET FOREIGN_KEY_CHECKS=1;

View File

@@ -200,12 +200,27 @@ func (s *CBMessageService) UpdateCBMessage(id int64, messageJson json.RawMessage
} }
now := time.Now().UnixMicro() now := time.Now().UnixMicro()
if err := s.db.Table("cb_message"). err := s.db.Transaction(func(tx *gorm.DB) error {
Where("id = ?", id). // 在事务中更新
Updates(map[string]interface{}{ if err := tx.Table("cb_message").
"message_json": messageJson, Where("id = ?", id).
"updated_at": now, Updates(map[string]any{
}).Error; err != nil { "message_json": messageJson,
"updated_at": now,
}).Error; err != nil {
return fmt.Errorf("failed to update CBC message: %w", err)
}
// 在事务中查询更新后的记录
if err := tx.Table("cb_message").
Where("id = ?", id).
First(&msg).Error; err != nil {
return fmt.Errorf("failed to fetch updated CBC message: %w", err)
}
return nil
})
if err != nil {
return fmt.Errorf("failed to update CB message: %w", err) return fmt.Errorf("failed to update CB message: %w", err)
} }
@@ -488,7 +503,7 @@ func (s *CBMessageService) sendUpdateRequest(msg CBMessage) error {
return err return err
} }
return client.PutMessage(msg.MessageJson) return client.PostMessage(msg.MessageJson)
} }
// 重构后的停用请求 // 重构后的停用请求

View File

@@ -3,7 +3,7 @@
ProjectL = omc ProjectL = omc
ProjectU = OMC ProjectU = OMC
PROJECT = $(ProjectL) PROJECT = $(ProjectL)
VERSION = 1.2507.1 VERSION = 1.2508.1
RelDate = `date +%Y%m%d` RelDate = `date +%Y%m%d`
Release = $(RelDate) Release = $(RelDate)
RelVer = $(VERSION)-$(RelDate) RelVer = $(VERSION)-$(RelDate)

View File

@@ -2,7 +2,7 @@
ProcList="restagent sshsvc" ProcList="restagent sshsvc"
ProjectL=omc ProjectL=omc
VERSION=1.2507.1 VERSION=1.2508.1
RelDate=`date +%Y%m%d` RelDate=`date +%Y%m%d`
Release=${RelDate} Release=${RelDate}
RelVer=${VERSION}-${RelDate} RelVer=${VERSION}-${RelDate}

View File

@@ -1,7 +1,7 @@
# Makefile for rest agent project # Makefile for rest agent project
PROJECT = OMC PROJECT = OMC
VERSION = 1.2507.1 VERSION = 1.2508.1
PLATFORM = amd64 PLATFORM = amd64
ARMPLATFORM = aarch64 ARMPLATFORM = aarch64
BUILDDIR = ../../build BUILDDIR = ../../build

View File

@@ -1,7 +1,7 @@
# Makefile for OMC-OMC-crontask project # Makefile for OMC-OMC-crontask project
PROJECT = OMC PROJECT = OMC
VERSION = 1.2507.1 VERSION = 1.2508.1
LIBDIR = be.ems/lib LIBDIR = be.ems/lib
BINNAME = sshsvc BINNAME = sshsvc