Refactored responses again

This commit is contained in:
Deluan
2016-02-24 12:00:55 -05:00
parent 1a3f370ea6
commit c6dfea51ff
4 changed files with 18 additions and 20 deletions
+2 -4
View File
@@ -2,7 +2,6 @@ package controllers
import (
"github.com/astaxie/beego"
"encoding/xml"
"github.com/deluan/gosonic/responses"
)
@@ -10,9 +9,8 @@ type GetLicenseController struct{ beego.Controller }
// @router /rest/getLicense.view [get]
func (this *GetLicenseController) Get() {
response := responses.NewGetLicense(true)
xmlBody, _ := xml.Marshal(response)
this.Ctx.Output.Body([]byte(xml.Header + string(xmlBody)))
response := responses.NewXML(&responses.License{Valid: true})
this.Ctx.Output.Body(response)
}