Skip to content

Commit

Permalink
修复5.0.9
Browse files Browse the repository at this point in the history
增加清除缓存时将注册路由缓存一并清除
修复模型注解对自定义解析无效问题
  • Loading branch information
HGthecode committed May 2, 2023
1 parent c09c9f4 commit 34c3a9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ public function createGenerator(){
public function cancelAllCache(){
$this->init(true);
$config = $this->config;
$res = DirAndFile::deleteDir(APIDOC_STORAGE_PATH . $config['cache']['folder'].'/'.'apis');
return Helper::showJson(0,"",$res);
$path = APIDOC_STORAGE_PATH . $config['cache']['folder'];
$res = DirAndFile::deleteDir($path);
return Helper::showJson(0,"",$path);
}

public function createAllCache(){
Expand Down
7 changes: 7 additions & 0 deletions src/parses/ParseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ public function parseModelTable($model,$classReflect,$methodName=""){
if (!empty($fieldItem['md'])){
$fieldItem['md'] = ParseMarkdown::getContent("",$fieldItem['md']);
}
// 自定义解析
if (!empty($config['parsesAnnotation'])){
$callback = $config['parsesAnnotation']($fieldItem);
if (!empty($callback)){
$fieldItem = $callback;
}
}
$addFieldList[]=$fieldItem;
}
$table = Helper::arrayMergeAndUnique("name",$table,$addFieldList);
Expand Down

0 comments on commit 34c3a9f

Please sign in to comment.