From 1c81ad9e55c9c76171a22a8c2b34d746adb62ce3 Mon Sep 17 00:00:00 2001 From: Bjverde Date: Sat, 30 Jul 2022 14:19:30 -0300 Subject: [PATCH] :hammer: #270 update retorno msg json --- .../api/api_controllers/Acesso_menuAPI.class.php | 11 +++++++---- .../api/api_controllers/Acesso_perfilAPI.class.php | 13 ++++++++----- .../api_controllers/Acesso_perfil_menuAPI.class.php | 13 ++++++++----- .../api_controllers/Acesso_perfil_userAPI.class.php | 13 ++++++++----- .../api/api_controllers/Acesso_userAPI.class.php | 13 ++++++++----- .../api/api_controllers/AutoridadeAPI.class.php | 13 ++++++++----- 6 files changed, 47 insertions(+), 29 deletions(-) diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php index d1756a4b..3216c735 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php @@ -31,7 +31,8 @@ public static function selectAll(Request $request, Response $response, array $ar $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -52,7 +53,8 @@ public static function selectById(Request $request, Response $response, array $a $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -73,7 +75,7 @@ public static function save(Request $request, Response $response, array $args) $controller = new \Acesso_menu; $controller->save($vo); - $response = $response->withJson($msg); + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -83,7 +85,8 @@ public static function delete(Request $request, Response $response, array $args) $id = $args['id']; $controller = new \Acesso_menu; $msg = $controller->delete($id); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } } \ No newline at end of file diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php index b725c5b8..0f32dd9f 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php @@ -31,7 +31,8 @@ public static function selectAll(Request $request, Response $response, array $ar $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -52,7 +53,8 @@ public static function selectById(Request $request, Response $response, array $a $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -72,8 +74,8 @@ public static function save(Request $request, Response $response, array $args) $controller = new \Acesso_perfil; $controller->save($vo); - - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -83,7 +85,8 @@ public static function delete(Request $request, Response $response, array $args) $id = $args['id']; $controller = new \Acesso_perfil; $msg = $controller->delete($id); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } } \ No newline at end of file diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php index e4d177b4..1cb8f247 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_menuAPI.class.php @@ -31,7 +31,8 @@ public static function selectAll(Request $request, Response $response, array $ar $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -52,7 +53,8 @@ public static function selectById(Request $request, Response $response, array $a $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -72,8 +74,8 @@ public static function save(Request $request, Response $response, array $args) $controller = new \Acesso_perfil_menu; $controller->save($vo); - - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -83,7 +85,8 @@ public static function delete(Request $request, Response $response, array $args) $id = $args['id']; $controller = new \Acesso_perfil_menu; $msg = $controller->delete($id); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } } \ No newline at end of file diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php index 15299b08..75273a58 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_perfil_userAPI.class.php @@ -31,7 +31,8 @@ public static function selectAll(Request $request, Response $response, array $ar $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -52,7 +53,8 @@ public static function selectById(Request $request, Response $response, array $a $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -72,8 +74,8 @@ public static function save(Request $request, Response $response, array $args) $controller = new \Acesso_perfil_user; $controller->save($vo); - - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -83,7 +85,8 @@ public static function delete(Request $request, Response $response, array $args) $id = $args['id']; $controller = new \Acesso_perfil_user; $msg = $controller->delete($id); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } } \ No newline at end of file diff --git a/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php b/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php index babdbbc9..bd8804b8 100644 --- a/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php @@ -31,7 +31,8 @@ public static function selectAll(Request $request, Response $response, array $ar $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -52,7 +53,8 @@ public static function selectById(Request $request, Response $response, array $a $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -72,8 +74,8 @@ public static function save(Request $request, Response $response, array $args) $controller = new \Acesso_user; $controller->save($vo); - - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -83,7 +85,8 @@ public static function delete(Request $request, Response $response, array $args) $id = $args['id']; $controller = new \Acesso_user; $msg = $controller->delete($id); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } } \ No newline at end of file diff --git a/appexemplo_v2.0/api/api_controllers/AutoridadeAPI.class.php b/appexemplo_v2.0/api/api_controllers/AutoridadeAPI.class.php index 29633565..ad509b7a 100644 --- a/appexemplo_v2.0/api/api_controllers/AutoridadeAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/AutoridadeAPI.class.php @@ -31,7 +31,8 @@ public static function selectAll(Request $request, Response $response, array $ar $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -52,7 +53,8 @@ public static function selectById(Request $request, Response $response, array $a $msg = array( 'qtd'=> \CountHelper::count($result) , 'result'=>$result ); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -72,8 +74,8 @@ public static function save(Request $request, Response $response, array $args) $controller = new \Autoridade; $controller->save($vo); - - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } @@ -83,7 +85,8 @@ public static function delete(Request $request, Response $response, array $args) $id = $args['id']; $controller = new \Autoridade; $msg = $controller->delete($id); - $response = $response->withJson($msg); + + $response = TGenericAPI::getBodyJson($msg,$response); return $response; } } \ No newline at end of file