|
...
|
...
|
@@ -6,6 +6,7 @@ use App\Enums\Common\Code; |
|
|
|
use App\Models\AiCommand as AiCommandModel;
|
|
|
|
use App\Models\User\UserLog as UserLogModel;
|
|
|
|
use App\Models\User\UserLogin as UserLoginModel;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
|
|
|
|
class Common
|
|
|
|
{
|
|
...
|
...
|
@@ -47,6 +48,7 @@ class Common |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function send_openai_msg($url){
|
|
|
|
$this->param = request()->post();
|
|
|
|
$url = HTTP_OPENAI_URL.$url;
|
|
|
|
$aiCommandModel = New AiCommandModel();
|
|
|
|
//指定库获取指令
|
|
...
|
...
|
@@ -64,4 +66,38 @@ class Common |
|
|
|
];
|
|
|
|
return http_post($url,json_encode($data));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :获取缓存
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function get_user_cache($table,$id,$type = 'B'){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
$lists = Cache::get($key);
|
|
|
|
return $lists;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :写入缓存
|
|
|
|
* @return bool
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function set_user_cache($data = [],$table,$id,$type = 'B'){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
return Cache::add($key,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|