fix: 软件报直装记录版本号
This commit is contained in:
@@ -157,9 +157,8 @@ func (s *NeSoftwareController) Remove(c *gin.Context) {
|
||||
func (s *NeSoftwareController) Install(c *gin.Context) {
|
||||
language := ctx.AcceptLanguage(c)
|
||||
var body struct {
|
||||
Action string `json:"action" binding:"required,oneof=install upgrade"` // 安装行为
|
||||
Software model.NeSoftware `json:"software" binding:"required"` // 软件包信息
|
||||
Preinput map[string]string `json:"preinput" binding:"required"` // 预先输入参数
|
||||
Software model.NeSoftware `json:"software" binding:"required"` // 软件包信息
|
||||
Preinput map[string]string `json:"preinput" binding:"required"` // 预先输入参数
|
||||
}
|
||||
err := c.ShouldBindBodyWith(&body, binding.JSON)
|
||||
if err != nil || body.Software.NeId == "" {
|
||||
@@ -184,8 +183,8 @@ func (s *NeSoftwareController) Install(c *gin.Context) {
|
||||
s.neSoftwareService.Update(neSoftware)
|
||||
}
|
||||
|
||||
// 进行安装检查
|
||||
output, err := s.neSoftwareService.InstallToNeHost(body.Action, body.Software, body.Preinput)
|
||||
// 进行安装
|
||||
output, err := s.neSoftwareService.InstallToNeHost(body.Software, body.Preinput)
|
||||
if err != nil {
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, err.Error())))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user