This commit is contained in:
2024-07-16 10:59:09 +08:00
parent 67c2905c93
commit 55e6c7fb9c
2 changed files with 25 additions and 6 deletions

View File

@@ -9,6 +9,7 @@
namespace app\api\controller;
use app\api\logic\TychatLogic;
use app\api\logic\UserOfflinePrizeLogic;
use app\common\model\TabConf;
use GatewayWorker\Lib\Gateway;
@@ -170,4 +171,22 @@ class Users extends BaseHttpApi
});
}
/**
* desc保存听译聊天记录
*
* api/Users/saveChatHistory
*
* authorwh
*/
function saveChatHistory(){
return Mmodel::catchJson(function (){
$obj = new TychatLogic();
$chat_content = input('chat_content');
if(empty($chat_content)){
return Tools::set_fail('参数错误');
}
$res = $obj->saveChatHistory($chat_content);
return Tools::set_ok('ok',$res);
});
}
}

View File

@@ -38,23 +38,23 @@ class TychatLogic extends BaseLogic
]
];
*/
function saveChatHistory($client_id,$res){
$items = $res['items'];
function saveChatHistory($chat_content){
$data = [
'username'=>$items['username'],
'chat_msg'=>$items['content'],
'chat_msg'=>$chat_content,
];
Db::table('fa_ty_chathistory')->insert($data);
//这里做健康小洞察
//$this->getHealthInsight();
$json = BaseWssApi::json_wss('ok','保存成功');
Gateway::sendToClient($client_id, $json);
return Tools::set_ok();
}
/**
* desc健康洞察
*
* api/HealthInsights/getHealthInsight
*
* authorwh
*/
function getHealthInsight(){