Skip to content

Commit

Permalink
🔨 #270 update retorno msg json
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Jul 30, 2022
1 parent f8436a0 commit 1c81ad9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 29 deletions.
11 changes: 7 additions & 4 deletions appexemplo_v2.0/api/api_controllers/Acesso_menuAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
}
13 changes: 8 additions & 5 deletions appexemplo_v2.0/api/api_controllers/Acesso_perfilAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
}
13 changes: 8 additions & 5 deletions appexemplo_v2.0/api/api_controllers/Acesso_userAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
}
13 changes: 8 additions & 5 deletions appexemplo_v2.0/api/api_controllers/AutoridadeAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
}

0 comments on commit 1c81ad9

Please sign in to comment.