Files
panchengyong c1e74d8e68 chore(php): 统一 ScottPan 文件头与注释域名替换
- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明

Made-with: Cursor
2026-03-29 11:22:58 +08:00

114 lines
3.7 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace crmeb\services\wechat\client\work;
use crmeb\services\wechat\client\BaseClient;
use EasyWeChat\Kernel\HttpClient\Response;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* 客户群聊配置
* Class GroupChatClient
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
* @package crmeb\services\wechat\client\work
*/
class GroupChatClient extends BaseClient
{
/**
* 更新客户群进群方式配置
* @param string $configId
* @param string $roomBaseName
* @param array $chatIdList
* @param string $state
* @param int $autoCreateRoom
* @param int $roomBaseId
* @param string|null $remark
* @param int $scene
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function updateJoinWay(string $configId, string $roomBaseName, array $chatIdList, string $state, int $autoCreateRoom = 1, int $roomBaseId = 1, string $remark = null, int $scene = 2): ResponseInterface|Response
{
$data = [
'config_id' => $configId,
'scene' => $scene,
'remark' => $remark,
'auto_create_room' => $autoCreateRoom,
'room_base_name' => $roomBaseName,
'room_base_id' => $roomBaseId,
'chat_id_list' => $chatIdList,
'state' => $state,
];
return $this->api->postJson('cgi-bin/externalcontact/groupchat/update_join_way', $data);
}
/**
* 配置客户群进群方式
* @param string $roomName
* @param array $chatIdList
* @param string $state
* @param int $autoCreateRoom
* @param int $roomBaseId
* @param string|null $remark
* @param int $scene
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function addJoinWay(string $roomName, array $chatIdList, string $state, int $autoCreateRoom = 1, int $roomBaseId = 1, string $remark = null, int $scene = 2): ResponseInterface|Response
{
$data = [
'scene' => $scene,
'remark' => $remark,
'chat_id_list' => $chatIdList,
'auto_create_room' => $autoCreateRoom,
'room_base_name' => $roomName,
'room_base_id' => $roomBaseId,
'state' => $state
];
return $this->api->postJson('cgi-bin/externalcontact/groupchat/add_join_way', $data);
}
/**
* 获取客户群进群方式配置
* @param string $configId
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function getJoinWay(string $configId): ResponseInterface|Response
{
return $this->api->postJson('cgi-bin/externalcontact/groupchat/get_join_way', ['config_id' => $configId]);
}
/**
* 删除客户群进群方式配置
* @param string $configId
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function deleteJoinWay(string $configId): ResponseInterface|Response
{
return $this->api->postJson('cgi-bin/externalcontact/groupchat/del_join_way', ['config_id' => $configId]);
}
}