This commit is contained in:
2024-10-13 01:21:13 +08:00
parent 915d3f3716
commit 18e4a8080d
6 changed files with 48 additions and 20 deletions

View File

@@ -22,10 +22,13 @@ func FLXG3D56Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
l := FLXG.NewFLXG3D56Logic(r.Context(), svcCtx)
resp, err := l.FLXG3D56(&req)
ctx := r.Context()
if err != nil {
response.Fail(r.Context(), w, err)
r = r.WithContext(ctx)
response.Fail(ctx, w, err)
} else {
response.Success(r.Context(), w, resp)
r = r.WithContext(ctx)
response.Success(ctx, w, resp)
}
}
}

View File

@@ -19,7 +19,7 @@ import (
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor, serverCtx.ApiMqsInterceptor},
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
@@ -78,7 +78,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor, serverCtx.ApiMqsInterceptor},
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
@@ -117,7 +117,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor, serverCtx.ApiMqsInterceptor},
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
@@ -146,7 +146,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor, serverCtx.ApiMqsInterceptor},
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
@@ -180,7 +180,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor, serverCtx.ApiMqsInterceptor},
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,