fix: 软件报直装记录版本号

This commit is contained in:
TsMask
2024-04-12 17:27:12 +08:00
parent e87e5c3664
commit 2cb4c2fc9b
3 changed files with 34 additions and 24 deletions

View File

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