This commit is contained in:
2025-12-07 14:54:35 +01:00
parent ac6a4fd6d3
commit d18a72d492
18 changed files with 725 additions and 307 deletions
+6 -2
View File
@@ -8,7 +8,11 @@ import (
)
type SoftwareUpdaterController struct {
softwareUpdaterService domain.SoftwareUpdaterService
service domain.SoftwareUpdaterServiceInterface
}
func NewSoftwareUpdaterController(service domain.SoftwareUpdaterServiceInterface) *SoftwareUpdaterController {
return &SoftwareUpdaterController{service: service}
}
func (c *SoftwareUpdaterController) update(w http.ResponseWriter, r *http.Request) {
@@ -21,7 +25,7 @@ func (c *SoftwareUpdaterController) update(w http.ResponseWriter, r *http.Reques
platform := r.URL.Query().Get("platform")
name := r.URL.Query().Get("name")
if err := c.softwareUpdaterService.UpdateSoftware(platform, name); err != nil {
if err := c.service.Update(platform, name); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}