revt: 回退网元软件包类型字段变更
This commit is contained in:
@@ -71,7 +71,7 @@ func (s *NeSoftwareController) Add(c *gin.Context) {
|
||||
|
||||
// 找到已存在的删除后重新添加
|
||||
neSoftwares := s.neSoftwareService.SelectList(model.NeSoftware{
|
||||
Type: body.Type,
|
||||
NeType: body.NeType,
|
||||
Name: body.Name,
|
||||
Version: body.Version,
|
||||
})
|
||||
@@ -111,7 +111,7 @@ func (s *NeSoftwareController) Edit(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 检查属性值唯一
|
||||
uniqueSoftware := s.neSoftwareService.CheckUniqueTypeAndNameAndVersion(body.Type, body.Name, body.Version, body.ID)
|
||||
uniqueSoftware := s.neSoftwareService.CheckUniqueTypeAndNameAndVersion(body.NeType, body.Name, body.Version, body.ID)
|
||||
if !uniqueSoftware {
|
||||
// 网元软件包操作【%s】失败,网元类型与文件名版本已存在
|
||||
msg := i18n.TTemplate(language, "neSoftware.errKeyExists", map[string]any{"name": body.Name})
|
||||
@@ -176,14 +176,14 @@ func (s *NeSoftwareController) NewNeVersion(c *gin.Context) {
|
||||
|
||||
// 找到已存在的软件包信息
|
||||
neSoftwares := s.neSoftwareService.SelectList(model.NeSoftware{
|
||||
Type: body.Type,
|
||||
NeType: body.NeType,
|
||||
Name: body.Name,
|
||||
Version: body.Version,
|
||||
})
|
||||
if len(neSoftwares) > 0 {
|
||||
neSoftware := neSoftwares[0]
|
||||
s.neSoftwareService.UpdateVersions(neSoftware, model.NeVersion{
|
||||
NeType: neSoftware.Type,
|
||||
NeType: neSoftware.NeType,
|
||||
UpdateBy: ctx.LoginUserToUserName(c),
|
||||
})
|
||||
c.JSON(200, result.Ok(nil))
|
||||
|
||||
Reference in New Issue
Block a user