|
@@ -519,43 +519,47 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|
|
|
- []rest.Route{
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/sop_stage/create",
|
|
|
- Handler: sop_stage.CreateSopStageHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/sop_stage/update",
|
|
|
- Handler: sop_stage.UpdateSopStageHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/sop_stage/delete",
|
|
|
- Handler: sop_stage.DeleteSopStageHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/sop_stage/list",
|
|
|
- Handler: sop_stage.GetSopStageListHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/sop_stage",
|
|
|
- Handler: sop_stage.GetSopStageByIdHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/sop_stage/detail",
|
|
|
- Handler: sop_stage.GetSopStageDetailHandler(serverCtx),
|
|
|
- },
|
|
|
- {
|
|
|
- Method: http.MethodPost,
|
|
|
- Path: "/sop_stage/move",
|
|
|
- Handler: sop_stage.MoveSopStageHandler(serverCtx),
|
|
|
- },
|
|
|
- },
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Authority},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/sop_stage/create",
|
|
|
+ Handler: sop_stage.CreateSopStageHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/sop_stage/update",
|
|
|
+ Handler: sop_stage.UpdateSopStageHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/sop_stage/delete",
|
|
|
+ Handler: sop_stage.DeleteSopStageHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/sop_stage/list",
|
|
|
+ Handler: sop_stage.GetSopStageListHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/sop_stage",
|
|
|
+ Handler: sop_stage.GetSopStageByIdHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/sop_stage/detail",
|
|
|
+ Handler: sop_stage.GetSopStageDetailHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/sop_stage/move",
|
|
|
+ Handler: sop_stage.MoveSopStageHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
|
|
|
server.AddRoutes(
|