|
...
|
...
|
@@ -2,8 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Helper;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Models\AiCommand as AiCommandModel;
|
|
|
|
use App\Models\Ai\AiCommand as AiCommandModel;
|
|
|
|
use App\Models\User\UserLog as UserLogModel;
|
|
|
|
use App\Models\User\UserLogin as UserLoginModel;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
...
|
...
|
@@ -47,8 +46,7 @@ class Common |
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function send_openai_msg($url){
|
|
|
|
$param = request()->post();
|
|
|
|
public static function send_openai_msg($url,$param){
|
|
|
|
$url = HTTP_OPENAI_URL.$url;
|
|
|
|
$aiCommandModel = New AiCommandModel();
|
|
|
|
//指定库获取指令
|
|
...
|
...
|
@@ -75,7 +73,7 @@ class Common |
|
|
|
*/
|
|
|
|
public static function get_user_cache($table,$id,$type = 'B'){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
$lists = Cache::get($key);
|
|
|
|
$lists = Cache::store('file')->get($key);
|
|
|
|
return $lists;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -86,18 +84,22 @@ class Common |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function set_user_cache($data = [],$table,$id,$type = 'B'){
|
|
|
|
$user_cache = config('cache.user_is_cache');
|
|
|
|
if(!empty($user_cache) && $user_cache['is_cache'] == true){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
return Cache::add($key,$data);
|
|
|
|
Cache::store('file')->set($key,$data);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :清楚缓存
|
|
|
|
* @name :清除缓存
|
|
|
|
* @return bool
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function del_user_cache($data = [],$rule,$project_id,$type = 'B'){
|
|
|
|
$key = 'cache_user_'.$rule.'_'.$project_id.'_'.$type;
|
|
|
|
return Cache::add($key,$data);
|
|
|
|
public static function del_user_cache($table,$id,$type = 'B'){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
return Cache::store('file')->pull($key);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|