Skip to content
Snippets Groups Projects
Commit 84fb64d6 authored by phatpnh's avatar phatpnh
Browse files

Fix bug CSM

parent dfd5470f
No related branches found
Tags 3.0.9
No related merge requests found
......@@ -33,41 +33,43 @@ class Utils
foreach ($verbs as $verb) {
foreach ($rule->controller as $plural => $single) {
$controllerClassName = "app\controllers\\" . Inflector::id2camel($single) . "Controller";
$classObject = new $controllerClassName($single, false);
$controllerKey = str_replace("\\", '.', $controllerClassName);
$controllerName = Inflector::id2camel($single) . "Controller";
if (!isset($routes[$controllerKey])) {
$routes[$controllerKey] = [
if(class_exists($controllerClassName)){
$classObject = new $controllerClassName($single, false);
$controllerKey = str_replace("\\", '.', $controllerClassName);
$controllerName = Inflector::id2camel($single) . "Controller";
if (!isset($routes[$controllerKey])) {
$routes[$controllerKey] = [
'id' => null,
'applicationName' => $service,
'aliasName' => $controllerName,
'serviceClassName' => $controllerKey,
'servicePath' => "/" . $plural,
'description' => 'Các APIs của ' . $controllerName,
'listSmtmServiceMethods' => []
];
}
$methodName = Inflector::id2camel($action) . ucfirst($single);
$routes[$controllerKey]['listSmtmServiceMethods'][] = [
'id' => null,
'applicationName' => $service,
'aliasName' => $controllerName,
'serviceClassName' => $controllerKey,
'servicePath' => "/" . $plural,
'description' => 'Các APIs của ' . $controllerName,
'listSmtmServiceMethods' => []
'aliasName' => "/" . implode("/", $pattern ? [
$plural,
$pattern
] : [
$plural
]),
'serviceMethodName' => $methodName,
'serviceMethodType' => $verb,
'description' => "Mô tả method $verb - $methodName",
'fullPath' => "/services/" . implode("/", $pattern ? [
$service,
$plural,
$pattern
] : [
$service,
$plural
]),
];
}
$methodName = Inflector::id2camel($action) . ucfirst($single);
$routes[$controllerKey]['listSmtmServiceMethods'][] = [
'id' => null,
'aliasName' => "/" . implode("/", $pattern ? [
$plural,
$pattern
] : [
$plural
]),
'serviceMethodName' => $methodName,
'serviceMethodType' => $verb,
'description' => "Mô tả method $verb - $methodName",
'fullPath' => "/services/" . implode("/", $pattern ? [
$service,
$plural,
$pattern
] : [
$service,
$plural
]),
];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment