revt: 回退网元软件包类型字段变更

This commit is contained in:
TsMask
2024-05-27 19:02:33 +08:00
parent 83192c3172
commit 57a18656df
6 changed files with 33 additions and 34 deletions

View File

@@ -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))