layout refact

This commit is contained in:
2026-01-29 20:47:18 +01:00
parent 44700d51cb
commit 27131b3029
10 changed files with 150 additions and 55 deletions
+11 -4
View File
@@ -8,11 +8,18 @@ import (
)
type SoftwareUpdaterController struct {
service domain.SoftwareUpdaterServiceInterface
softwareUpdaterService domain.SoftwareUpdaterServiceInterface
softwareService domain.SoftwareServiceInterface
}
func NewSoftwareUpdaterController(service domain.SoftwareUpdaterServiceInterface) *SoftwareUpdaterController {
return &SoftwareUpdaterController{service: service}
func NewSoftwareUpdaterController(
softwareUpdaterService domain.SoftwareUpdaterServiceInterface,
softwareService domain.SoftwareServiceInterface,
) *SoftwareUpdaterController {
return &SoftwareUpdaterController{
softwareUpdaterService: softwareUpdaterService,
softwareService: softwareService,
}
}
func (c *SoftwareUpdaterController) Update(w http.ResponseWriter, r *http.Request) {
@@ -31,7 +38,7 @@ func (c *SoftwareUpdaterController) Update(w http.ResponseWriter, r *http.Reques
return
}
if err := c.service.Update(platform, name, version); err != nil {
if err := c.softwareUpdaterService.Update(platform, name, version); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}