jimmyyem 6 mesi fa
parent
commit
cb666e9eae
1 ha cambiato i file con 17 aggiunte e 30 eliminazioni
  1. 17 30
      internal/handler/routes.go

+ 17 - 30
internal/handler/routes.go

@@ -737,22 +737,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 	)
 
 	server.AddRoutes(
-		rest.WithMiddlewares(
-			[]rest.Middleware{serverCtx.Miniprogram},
-			[]rest.Route{
-				{
-					Method:  http.MethodPost,
-					Path:    "/api/employee/list",
-					Handler: employee.GetApiEmployeeListHandler(serverCtx),
-				},
-				{
-					Method:  http.MethodPost,
-					Path:    "/api/employee/detail",
-					Handler: employee.GetApiEmployeeDetailHandler(serverCtx),
-				},
-			}...,
-		),
-		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+		[]rest.Route{
+			{
+				Method:  http.MethodPost,
+				Path:    "/api/employee/list",
+				Handler: employee.GetApiEmployeeListHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/api/employee/detail",
+				Handler: employee.GetApiEmployeeDetailHandler(serverCtx),
+			},
+		},
 	)
 
 	server.AddRoutes(
@@ -936,20 +932,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 	)
 
 	server.AddRoutes(
-		rest.WithMiddlewares(
-			[]rest.Middleware{serverCtx.Miniprogram},
-			[]rest.Route{
-				{
-					Method:  http.MethodPost,
-					Path:    "/api/category/list",
-					Handler: category.GetApiCategoryListHandler(serverCtx),
-				},
-			}...,
-		),
-		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
-	)
-
-	server.AddRoutes(
 		[]rest.Route{
 			{
 				Method:  http.MethodPost,
@@ -961,6 +943,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/category",
 				Handler: category.GetCategoryByIdHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/api/category/list",
+				Handler: category.GetApiCategoryListHandler(serverCtx),
+			},
 		},
 	)