rename Context to ReqContext

This commit is contained in:
Dan Cech
2018-03-07 11:54:50 -05:00
parent 338655dd37
commit c0ecdee375
63 changed files with 241 additions and 241 deletions
+8 -8
View File
@@ -6,7 +6,7 @@ import (
m "github.com/grafana/grafana/pkg/models"
)
func ValidateOrgPlaylist(c *m.Context) {
func ValidateOrgPlaylist(c *m.ReqContext) {
id := c.ParamsInt64(":id")
query := m.GetPlaylistByIdQuery{Id: id}
err := bus.Dispatch(&query)
@@ -39,7 +39,7 @@ func ValidateOrgPlaylist(c *m.Context) {
}
}
func SearchPlaylists(c *m.Context) Response {
func SearchPlaylists(c *m.ReqContext) Response {
query := c.Query("query")
limit := c.QueryInt("limit")
@@ -61,7 +61,7 @@ func SearchPlaylists(c *m.Context) Response {
return Json(200, searchQuery.Result)
}
func GetPlaylist(c *m.Context) Response {
func GetPlaylist(c *m.ReqContext) Response {
id := c.ParamsInt64(":id")
cmd := m.GetPlaylistByIdQuery{Id: id}
@@ -114,7 +114,7 @@ func LoadPlaylistItems(id int64) ([]m.PlaylistItem, error) {
return *itemQuery.Result, nil
}
func GetPlaylistItems(c *m.Context) Response {
func GetPlaylistItems(c *m.ReqContext) Response {
id := c.ParamsInt64(":id")
playlistDTOs, err := LoadPlaylistItemDTOs(id)
@@ -126,7 +126,7 @@ func GetPlaylistItems(c *m.Context) Response {
return Json(200, playlistDTOs)
}
func GetPlaylistDashboards(c *m.Context) Response {
func GetPlaylistDashboards(c *m.ReqContext) Response {
playlistId := c.ParamsInt64(":id")
playlists, err := LoadPlaylistDashboards(c.OrgId, c.SignedInUser, playlistId)
@@ -137,7 +137,7 @@ func GetPlaylistDashboards(c *m.Context) Response {
return Json(200, playlists)
}
func DeletePlaylist(c *m.Context) Response {
func DeletePlaylist(c *m.ReqContext) Response {
id := c.ParamsInt64(":id")
cmd := m.DeletePlaylistCommand{Id: id, OrgId: c.OrgId}
@@ -148,7 +148,7 @@ func DeletePlaylist(c *m.Context) Response {
return Json(200, "")
}
func CreatePlaylist(c *m.Context, cmd m.CreatePlaylistCommand) Response {
func CreatePlaylist(c *m.ReqContext, cmd m.CreatePlaylistCommand) Response {
cmd.OrgId = c.OrgId
if err := bus.Dispatch(&cmd); err != nil {
@@ -158,7 +158,7 @@ func CreatePlaylist(c *m.Context, cmd m.CreatePlaylistCommand) Response {
return Json(200, cmd.Result)
}
func UpdatePlaylist(c *m.Context, cmd m.UpdatePlaylistCommand) Response {
func UpdatePlaylist(c *m.ReqContext, cmd m.UpdatePlaylistCommand) Response {
cmd.OrgId = c.OrgId
if err := bus.Dispatch(&cmd); err != nil {