ref: 多core表结构和代码调整修改

This commit is contained in:
TsMask
2025-06-10 17:50:54 +08:00
parent c7501a952d
commit cfe6ab61e3
189 changed files with 2159 additions and 3195 deletions

View File

@@ -137,10 +137,10 @@ func (s NeConfigBackupController) Remove(c *gin.Context) {
func (s NeConfigBackupController) Import(c *gin.Context) {
language := reqctx.AcceptLanguage(c)
var body struct {
NeType string `json:"neType" binding:"required"`
NeId string `json:"neId" binding:"required"`
Type string `json:"type" binding:"required,oneof=backup upload"` // 导入类型
Path string `json:"path" binding:"required"` // 文件路径
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
Type string `json:"type" binding:"required,oneof=backup upload"` // 导入类型
Path string `json:"path" binding:"required"` // 文件路径
}
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
@@ -153,8 +153,8 @@ func (s NeConfigBackupController) Import(c *gin.Context) {
}
// 查网元
neInfo := s.neInfoService.FindByNeTypeAndNeID(body.NeType, body.NeId)
if neInfo.NeId != body.NeId || neInfo.IP == "" {
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -176,8 +176,8 @@ func (s NeConfigBackupController) Import(c *gin.Context) {
func (s NeConfigBackupController) Export(c *gin.Context) {
language := reqctx.AcceptLanguage(c)
var body struct {
NeType string `json:"neType" binding:"required"`
NeId string `json:"neId" binding:"required"`
CoreUID string `json:"coreUid" binding:"required"` // 核心网唯一标识
NeUID string `json:"neUid" binding:"required"` // 网元唯一标识
}
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
@@ -185,8 +185,8 @@ func (s NeConfigBackupController) Export(c *gin.Context) {
return
}
// 查网元
neInfo := s.neInfoService.FindByNeTypeAndNeID(body.NeType, body.NeId)
if neInfo.NeId != body.NeId || neInfo.IP == "" {
neInfo := s.neInfoService.FindByCoreUidAndNeUid(body.CoreUID, body.NeUID)
if neInfo.CoreUID != body.CoreUID || neInfo.NeUID != body.NeUID {
c.JSON(200, resp.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -198,8 +198,9 @@ func (s NeConfigBackupController) Export(c *gin.Context) {
}
// 新增备份记录
item := model.NeConfigBackup{
CoreUID: neInfo.CoreUID,
NeUID: neInfo.NeUID,
NeType: neInfo.NeType,
NeId: neInfo.NeId,
Name: filepath.Base(zipFilePath),
Path: zipFilePath,
CreateBy: reqctx.LoginUserToUserName(c),