Skip to content

Commit 34c3a9f

Browse files
committed
修复5.0.9
增加清除缓存时将注册路由缓存一并清除 修复模型注解对自定义解析无效问题
1 parent c09c9f4 commit 34c3a9f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Controller.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ public function createGenerator(){
205205
public function cancelAllCache(){
206206
$this->init(true);
207207
$config = $this->config;
208-
$res = DirAndFile::deleteDir(APIDOC_STORAGE_PATH . $config['cache']['folder'].'/'.'apis');
209-
return Helper::showJson(0,"",$res);
208+
$path = APIDOC_STORAGE_PATH . $config['cache']['folder'];
209+
$res = DirAndFile::deleteDir($path);
210+
return Helper::showJson(0,"",$path);
210211
}
211212

212213
public function createAllCache(){

src/parses/ParseModel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ public function parseModelTable($model,$classReflect,$methodName=""){
6262
if (!empty($fieldItem['md'])){
6363
$fieldItem['md'] = ParseMarkdown::getContent("",$fieldItem['md']);
6464
}
65+
// 自定义解析
66+
if (!empty($config['parsesAnnotation'])){
67+
$callback = $config['parsesAnnotation']($fieldItem);
68+
if (!empty($callback)){
69+
$fieldItem = $callback;
70+
}
71+
}
6572
$addFieldList[]=$fieldItem;
6673
}
6774
$table = Helper::arrayMergeAndUnique("name",$table,$addFieldList);

0 commit comments

Comments
 (0)