File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,20 @@ public function renderApiMenus(string $appKey): array
43
43
$ currentApp = $ currentAppConfig ['appConfig ' ];
44
44
$ this ->currentApp = $ currentApp ;
45
45
46
+ $ controllers = [];
46
47
if (!empty ($ currentApp ['controllers ' ]) && count ($ currentApp ['controllers ' ]) > 0 ) {
47
48
// 配置的控制器列表
48
49
$ controllers = $ this ->getConfigControllers ($ currentApp ['path ' ],$ currentApp ['controllers ' ]);
49
- } else {
50
- // 默认读取所有的
50
+ }else if (!empty ($ currentApp ['path ' ]) && is_array ($ currentApp ['path ' ]) && count ($ currentApp ['path ' ])){
51
+ // 读取paths的
52
+ foreach ($ currentApp ['path ' ] as $ path ) {
53
+ $ controllersList = $ this ->getDirControllers ($ path );
54
+ $ controllers = array_merge ($ controllers ,$ controllersList );
55
+ }
56
+ } else if (!empty ($ currentApp ['path ' ]) && is_string ($ currentApp ['path ' ])){
57
+ // 默认读取path下所有的
51
58
$ controllers = $ this ->getDirControllers ($ currentApp ['path ' ]);
52
59
}
53
-
54
60
$ apiData = [];
55
61
if (!empty ($ controllers ) && count ($ controllers ) > 0 ) {
56
62
foreach ($ controllers as $ class ) {
Original file line number Diff line number Diff line change @@ -52,10 +52,17 @@ public function getAppsApis(){
52
52
*/
53
53
public function getAppApis ($ app )
54
54
{
55
+ $ controllers = [];
55
56
if (!empty ($ app ['controllers ' ]) && count ($ app ['controllers ' ]) > 0 ) {
56
57
// 配置的控制器列表
57
58
$ controllers = (new ParseApiMenus ($ this ->config ))->getConfigControllers ($ app ['path ' ],$ app ['controllers ' ]);
58
- } else {
59
+ }else if (!empty ($ app ['path ' ]) && is_array ($ app ['path ' ]) && count ($ app ['path ' ])){
60
+ $ parseApiMenus = new ParseApiMenus ($ this ->config );
61
+ foreach ($ app ['path ' ] as $ path ) {
62
+ $ controllersList = $ parseApiMenus ->getDirControllers ($ path );
63
+ $ controllers = array_merge ($ controllers ,$ controllersList );
64
+ }
65
+ } else if (!empty ($ app ['path ' ]) && is_string ($ app ['path ' ])) {
59
66
// 默认读取所有的
60
67
$ controllers = (new ParseApiMenus ($ this ->config ))->getDirControllers ($ app ['path ' ]);
61
68
}
You can’t perform that action at this time.
0 commit comments