切换OPENAI
This commit is contained in:
@@ -6,7 +6,7 @@ use think\console\Input;
|
|||||||
use think\console\Output;
|
use think\console\Output;
|
||||||
use think\Config;
|
use think\Config;
|
||||||
use think\Request;
|
use think\Request;
|
||||||
|
use app\common\QueueJob;
|
||||||
class Queueinfo extends Base
|
class Queueinfo extends Base
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -144,4 +144,63 @@ echo '<pre>';var_dump($counts);
|
|||||||
echo '<pre>';var_dump($sQueueInfo,$sKey,$iNum);exit;
|
echo '<pre>';var_dump($sQueueInfo,$sKey,$iNum);exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getKey(){
|
||||||
|
|
||||||
|
$aParam = $this->request->post();
|
||||||
|
if(empty($aParam['key_name'])){
|
||||||
|
exit('非法操作');
|
||||||
|
}
|
||||||
|
|
||||||
|
$config = \think\Config::get('queue');
|
||||||
|
|
||||||
|
$sQueueName = empty($aParam['queue_name']) ? 'ArticleAiCreateContent' : $aParam['queue_name'];
|
||||||
|
$redis = new \Redis();
|
||||||
|
$redis->connect($config['host'], $config['port']);
|
||||||
|
|
||||||
|
if (!empty($config['password'])) {
|
||||||
|
$redis->auth($config['password']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$redis->select($config['select']);
|
||||||
|
|
||||||
|
$sKey = $redis->hGetAll($aParam['key_name']);
|
||||||
|
echo '我是HgetAll';
|
||||||
|
var_dump($sKey);
|
||||||
|
|
||||||
|
$sKey = $redis->get($aParam['key_name']);
|
||||||
|
var_dump($sKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeKey1(){
|
||||||
|
|
||||||
|
$aParam = $this->request->post();
|
||||||
|
if(empty($aParam['key_name'])){
|
||||||
|
exit('非法操作');
|
||||||
|
}
|
||||||
|
|
||||||
|
$config = \think\Config::get('queue');
|
||||||
|
|
||||||
|
$sQueueName = empty($aParam['queue_name']) ? 'ArticleAiCreateContent' : $aParam['queue_name'];
|
||||||
|
$redis = new \Redis();
|
||||||
|
$redis->connect($config['host'], $config['port']);
|
||||||
|
|
||||||
|
if (!empty($config['password'])) {
|
||||||
|
$redis->auth($config['password']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$redis->select($config['select']);
|
||||||
|
|
||||||
|
$sKey = $redis->hGetAll($aParam['key_name']);
|
||||||
|
echo '我是HgetAll';
|
||||||
|
var_dump($sKey);
|
||||||
|
$result = $redis->del($aParam['key_name']);
|
||||||
|
var_dump($result);
|
||||||
|
echo '我是get';
|
||||||
|
$sKey = $redis->get($aParam['key_name']);
|
||||||
|
var_dump($sKey);
|
||||||
|
$result = $redis->del($aParam['key_name']);
|
||||||
|
var_dump($result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user