feat: 网元软件包设为网元新版本的更新接口

This commit is contained in:
TsMask
2024-04-30 19:52:18 +08:00
parent 10ac5629a8
commit 4bbfc12c71
3 changed files with 51 additions and 0 deletions

View File

@@ -127,6 +127,24 @@ func (r *NeSoftwareImpl) CheckUniqueTypeAndNameAndVersion(neType, name, version,
return uniqueId == ""
}
// UpdateVersions 更新软件包对应网元的新版本
func (r *NeSoftwareImpl) UpdateVersions(neSoftware model.NeSoftware, neVersion model.NeVersion) int64 {
var rows int64 = 0
// 更新同类型的新包版本
neVersions := NewNeVersionImpl.SelectList(neVersion)
if len(neVersions) > 0 {
for _, v := range neVersions {
v.NewName = neSoftware.Name
v.NewVersion = neSoftware.Version
v.NewPath = neSoftware.Path
v.Status = "3"
v.UpdateBy = neVersion.UpdateBy
rows += NewNeVersionImpl.Update(v)
}
}
return rows
}
// InstallToNeHost 安装包上传到网元主机执行安装命令
func (r *NeSoftwareImpl) InstallToNeHost(neSoftware model.NeSoftware, preinput map[string]string) (string, error) {
// 检查文件是否存在