Chore: Move ReqContext to contexthandler service (#62102)

* Chore: Move ReqContext to contexthandler service

* Rename package to contextmodel

* Generate ngalert files

* Remove unused imports
This commit is contained in:
idafurjes
2023-01-27 08:50:36 +01:00
committed by GitHub
parent 8379a29b53
commit 6c5a573772
180 changed files with 1208 additions and 1182 deletions
@@ -11,14 +11,15 @@ import (
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
"github.com/grafana/grafana/pkg/services/ngalert/metrics"
"github.com/grafana/grafana/pkg/middleware"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
)
type {{classname}} interface { {{#operation}}
{{nickname}}(*models.ReqContext) response.Response{{/operation}}
{{nickname}}(*contextmodel.ReqContext) response.Response{{/operation}}
}
{{#operations}}{{#operation}}
func (f *{{classname}}Handler) {{nickname}}(ctx *models.ReqContext) response.Response { {{#hasPathParams}}
func (f *{{classname}}Handler) {{nickname}}(ctx *contextmodel.ReqContext) response.Response { {{#hasPathParams}}
// Parse Path Parameters{{/hasPathParams}}{{#pathParams}}
{{paramName}}Param := web.Params(ctx.Req)[":{{baseName}}"]{{/pathParams}}
{{#bodyParams}}