This commit is contained in:
2025-03-29 14:00:36 +08:00
parent 744815db87
commit 54e1e0c937
9 changed files with 18 additions and 18 deletions

View File

@@ -9,7 +9,7 @@
namespace app\admin\controller; namespace app\admin\controller;
use app\api\logic\GechatroomLogic; use app\api\logic\GechatroomWechatLogic;
use think\Controller; use think\Controller;
class Gechatroom extends Controller class Gechatroom extends Controller
@@ -37,7 +37,7 @@ class Gechatroom extends Controller
if(empty($ai_config_id)){ if(empty($ai_config_id)){
throw new \Exception('ai_config_id不能为空'); throw new \Exception('ai_config_id不能为空');
} }
$logic = new GechatroomLogic(); $logic = new GechatroomWechatLogic();
$data = $logic->getChatroomList($ai_config_id); $data = $logic->getChatroomList($ai_config_id);
//dump($data);die; //dump($data);die;
//缓存群成员列表 //缓存群成员列表
@@ -65,7 +65,7 @@ class Gechatroom extends Controller
if(empty($ai_config_id)){ if(empty($ai_config_id)){
throw new \Exception('ai_config_id不能为空'); throw new \Exception('ai_config_id不能为空');
} }
$data = (new GechatroomLogic())->getChatroomList($ai_config_id); $data = (new GechatroomWechatLogic())->getChatroomList($ai_config_id);
//缓存群成员列表 //缓存群成员列表
cache('cache_getChatroomList_data'.session_admin_firm_id(),$data['memberList'],86400); cache('cache_getChatroomList_data'.session_admin_firm_id(),$data['memberList'],86400);
$memberList = $data[$chatroom_id]['memberList']; $memberList = $data[$chatroom_id]['memberList'];

View File

@@ -9,7 +9,7 @@
namespace app\admin\controller; namespace app\admin\controller;
use app\api\logic\GewechatFriendsLogic; use app\api\logic\GewechatFriendsWechatLogic;
use think\Controller; use think\Controller;
class Gewechatfriends extends Controller class Gewechatfriends extends Controller
@@ -32,7 +32,7 @@ class Gewechatfriends extends Controller
$data = cache('cache_getFriendDetailList_data'.session_admin_firm_id()); $data = cache('cache_getFriendDetailList_data'.session_admin_firm_id());
return json(['list' => $data, 'total' => count($data)]); return json(['list' => $data, 'total' => count($data)]);
} }
$obj_logic = new GewechatFriendsLogic(); $obj_logic = new GewechatFriendsWechatLogic();
$ai_config_id = input('ai_config_id'); $ai_config_id = input('ai_config_id');
if(empty($ai_config_id)){ if(empty($ai_config_id)){
throw new \Exception('请先配置AI客服'); throw new \Exception('请先配置AI客服');
@@ -54,7 +54,7 @@ class Gewechatfriends extends Controller
$data = cache('cache_getFriendDetailList_data'.session_admin_firm_id()); $data = cache('cache_getFriendDetailList_data'.session_admin_firm_id());
return json(['list' => $data, 'total' => count($data)]); return json(['list' => $data, 'total' => count($data)]);
} }
$obj_logic = new GewechatFriendsLogic(); $obj_logic = new GewechatFriendsWechatLogic();
$ai_config_id = input('ai_config_id'); $ai_config_id = input('ai_config_id');
$obj_logic->setBaseUrlByAiCustmerConfig($ai_config_id); $obj_logic->setBaseUrlByAiCustmerConfig($ai_config_id);
$res = $obj_logic->getFriendDetailList(); $res = $obj_logic->getFriendDetailList();

View File

@@ -9,7 +9,7 @@
namespace app\admin\controller; namespace app\admin\controller;
use app\api\logic\PersonalLogic; use app\api\logic\PersonalWechatLogic;
use think\Controller; use think\Controller;
use wanghua\general_utility_tools_php\tool\Tools; use wanghua\general_utility_tools_php\tool\Tools;
@@ -21,7 +21,7 @@ class Wxperson extends Controller
public function getProfile() public function getProfile()
{ {
Tools::log_to_write_txt(['查询个人信息,入参:'=>input()]); Tools::log_to_write_txt(['查询个人信息,入参:'=>input()]);
$logic = new PersonalLogic(); $logic = new PersonalWechatLogic();
$base_url = input('base_url'); $base_url = input('base_url');
if(empty($base_url)){ if(empty($base_url)){
throw new \Exception('请先配置AI客服'); throw new \Exception('请先配置AI客服');

View File

@@ -4,7 +4,7 @@ namespace app\admin\controller\auth;
use app\admin\model\AuthGroup; use app\admin\model\AuthGroup;
use app\admin\model\AuthGroupAccess; use app\admin\model\AuthGroupAccess;
use app\api\logic\GewechatFriendsLogic; use app\api\logic\GewechatFriendsWechatLogic;
use app\common\controller\Backend; use app\common\controller\Backend;
use fast\Random; use fast\Random;
use fast\Tree; use fast\Tree;
@@ -299,7 +299,7 @@ class Admin extends Backend
} }
function getRelWxids(){ function getRelWxids(){
$friends = (new GewechatFriendsLogic())->getFriendDetailList(); $friends = (new GewechatFriendsWechatLogic())->getFriendDetailList();
return json(['data'=>$friends,'total'=>count($friends)]); return json(['data'=>$friends,'total'=>count($friends)]);
} }

View File

@@ -37,7 +37,7 @@ class BaseLogic
if(empty($this->base_url)){ if(empty($this->base_url)){
throw new \Exception('请先设置ai客服配置'); throw new \Exception('请先设置ai客服配置');
} }
$tokenArr = (new TokenLogic())->getToken(); $tokenArr = (new TokenWechatLogic())->getToken();
$postdata['appId'] = $tokenArr['appId']; $postdata['appId'] = $tokenArr['appId'];
$domain = $this->base_url; $domain = $this->base_url;
$timeout = 4; $timeout = 4;

View File

@@ -11,7 +11,7 @@ namespace app\api\logic;
use wanghua\general_utility_tools_php\tool\Tools; use wanghua\general_utility_tools_php\tool\Tools;
class GechatroomLogic extends BaseLogic class GechatroomWechatLogic extends BaseWechatLogic
{ {
/** /**
@@ -26,7 +26,7 @@ class GechatroomLogic extends BaseLogic
//$this->getChatroomMemberList();die; //$this->getChatroomMemberList();die;
//$base_url = config('gewechat.base_url'); //$base_url = config('gewechat.base_url');
//去查询群名称 //去查询群名称
$logic = new GewechatFriendsLogic(); $logic = new GewechatFriendsWechatLogic();
$logic->setBaseUrlByAiCustmerConfig($ai_config_id); $logic->setBaseUrlByAiCustmerConfig($ai_config_id);
$wxids_arr = $logic->getFriendWxIdsList(); $wxids_arr = $logic->getFriendWxIdsList();
$chatrooms = $wxids_arr['data']['chatrooms']; $chatrooms = $wxids_arr['data']['chatrooms'];
@@ -49,7 +49,7 @@ class GechatroomLogic extends BaseLogic
function getChatroomMemberList(){ function getChatroomMemberList(){
//去查询群名称 //去查询群名称
$wxids_arr = (new GewechatFriendsLogic())->getFriendWxIdsList(); $wxids_arr = (new GewechatFriendsWechatLogic())->getFriendWxIdsList();
$chatrooms = $wxids_arr['data']['chatrooms']; $chatrooms = $wxids_arr['data']['chatrooms'];
dump($chatrooms); dump($chatrooms);
$url = '/group/getChatroomMemberDetail'; $url = '/group/getChatroomMemberDetail';
@@ -75,7 +75,7 @@ class GechatroomLogic extends BaseLogic
*/ */
function getChatroomMemberDetail(){ function getChatroomMemberDetail(){
//去查询群名称 //去查询群名称
$wxids_arr = (new GewechatFriendsLogic())->getFriendWxIdsList(); $wxids_arr = (new GewechatFriendsWechatLogic())->getFriendWxIdsList();
$chatrooms = $wxids_arr['data']['chatrooms']; $chatrooms = $wxids_arr['data']['chatrooms'];
dump($chatrooms); dump($chatrooms);
$url = '/group/getChatroomMemberDetail'; $url = '/group/getChatroomMemberDetail';

View File

@@ -11,7 +11,7 @@ namespace app\api\logic;
use wanghua\general_utility_tools_php\tool\Tools; use wanghua\general_utility_tools_php\tool\Tools;
class GewechatFriendsLogic extends BaseLogic class GewechatFriendsWechatLogic extends BaseWechatLogic
{ {

View File

@@ -11,7 +11,7 @@ namespace app\api\logic;
use wanghua\general_utility_tools_php\tool\Tools; use wanghua\general_utility_tools_php\tool\Tools;
class PersonalLogic extends BaseLogic class PersonalWechatLogic extends BaseWechatLogic
{ {
function getProfile() function getProfile()
{ {

View File

@@ -7,7 +7,7 @@
*/ */
namespace app\api\logic; namespace app\api\logic;
class TokenLogic extends BaseLogic class TokenWechatLogic extends BaseWechatLogic
{ {
public function __construct() public function __construct()
{ {