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
+6 -6
View File
@@ -10,7 +10,7 @@ import (
"github.com/grafana/grafana/pkg/util"
)
func GetFolders(c *m.Context) Response {
func GetFolders(c *m.ReqContext) Response {
s := dashboards.NewFolderService(c.OrgId, c.SignedInUser)
folders, err := s.GetFolders(c.QueryInt("limit"))
@@ -31,7 +31,7 @@ func GetFolders(c *m.Context) Response {
return Json(200, result)
}
func GetFolderByUid(c *m.Context) Response {
func GetFolderByUid(c *m.ReqContext) Response {
s := dashboards.NewFolderService(c.OrgId, c.SignedInUser)
folder, err := s.GetFolderByUid(c.Params(":uid"))
@@ -43,7 +43,7 @@ func GetFolderByUid(c *m.Context) Response {
return Json(200, toFolderDto(g, folder))
}
func GetFolderById(c *m.Context) Response {
func GetFolderById(c *m.ReqContext) Response {
s := dashboards.NewFolderService(c.OrgId, c.SignedInUser)
folder, err := s.GetFolderById(c.ParamsInt64(":id"))
if err != nil {
@@ -54,7 +54,7 @@ func GetFolderById(c *m.Context) Response {
return Json(200, toFolderDto(g, folder))
}
func CreateFolder(c *m.Context, cmd m.CreateFolderCommand) Response {
func CreateFolder(c *m.ReqContext, cmd m.CreateFolderCommand) Response {
s := dashboards.NewFolderService(c.OrgId, c.SignedInUser)
err := s.CreateFolder(&cmd)
if err != nil {
@@ -65,7 +65,7 @@ func CreateFolder(c *m.Context, cmd m.CreateFolderCommand) Response {
return Json(200, toFolderDto(g, cmd.Result))
}
func UpdateFolder(c *m.Context, cmd m.UpdateFolderCommand) Response {
func UpdateFolder(c *m.ReqContext, cmd m.UpdateFolderCommand) Response {
s := dashboards.NewFolderService(c.OrgId, c.SignedInUser)
err := s.UpdateFolder(c.Params(":uid"), &cmd)
if err != nil {
@@ -76,7 +76,7 @@ func UpdateFolder(c *m.Context, cmd m.UpdateFolderCommand) Response {
return Json(200, toFolderDto(g, cmd.Result))
}
func DeleteFolder(c *m.Context) Response {
func DeleteFolder(c *m.ReqContext) Response {
s := dashboards.NewFolderService(c.OrgId, c.SignedInUser)
f, err := s.DeleteFolder(c.Params(":uid"))
if err != nil {