Refactored responses, implemented getLicense

This commit is contained in:
Deluan
2016-02-24 11:29:26 -05:00
parent ed1a132d8e
commit 1a3f370ea6
9 changed files with 116 additions and 58 deletions
+19
View File
@@ -0,0 +1,19 @@
package controllers
import (
"github.com/astaxie/beego"
"encoding/xml"
"github.com/deluan/gosonic/responses"
)
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)))
}