|
|
|
|
@ -2396,4 +2396,28 @@ class OtherController extends CommonController
|
|
|
|
|
return $this->success($all);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Post(
|
|
|
|
|
* path="/api/admin/other/clear-cache",
|
|
|
|
|
* tags={"其他"},
|
|
|
|
|
* summary="清除缓存",
|
|
|
|
|
* description="清除系统所有缓存",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="清除缓存成功"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function clearCache()
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
// 清除所有缓存
|
|
|
|
|
Cache::flush();
|
|
|
|
|
return $this->success(['message' => '缓存清除成功']);
|
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '清除缓存失败:' . $exception->getMessage()]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|