createPlaylist

This commit is contained in:
Deluan
2016-03-24 12:06:39 -04:00
parent 5b2ecc39ca
commit 52850c6ef0
4 changed files with 48 additions and 2 deletions
+11
View File
@@ -56,6 +56,17 @@ func (c *PlaylistsController) Get() {
c.SendResponse(response)
}
func (c *PlaylistsController) Create() {
songIds := c.RequiredParamStrings("songId", "Required parameter songId is missing")
name := c.RequiredParamString("name", "Required parameter name is missing")
err := c.pls.Create(name, songIds)
if err != nil {
beego.Error(err)
c.SendError(responses.ErrorGeneric, "Internal Error")
}
c.SendEmptyResponse()
}
func (c *PlaylistsController) buildPlaylist(d *engine.PlaylistInfo) *responses.PlaylistWithSongs {
pls := &responses.PlaylistWithSongs{}
pls.Id = d.Id