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

94 lines
2.4 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 DepartmentClient
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
* @package crmeb\services\wechat\client\work
*/
class DepartmentClient extends BaseClient
{
/**
* 获取部门信息
* @param int $id
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function get(int $id): ResponseInterface|Response
{
return $this->api->get('cgi-bin/department/get', compact('id'));
}
/**
* 获取部门列表
* @param int|null $id
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function list(?int $id = null): ResponseInterface|Response
{
return $this->api->get('cgi-bin/department/list', compact('id'));
}
/**
* 获取子部门ID列表
* @param int|null $id
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function simpleList(?int $id = null): ResponseInterface|Response
{
return $this->api->get('cgi-bin/department/simplelist', compact('id'));
}
/**
* 获取成员ID列表
* @param int $limit
* @param string $cursor
* @return Response|ResponseInterface
* @throws TransportExceptionInterface
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/15
*/
public function getUserListIds(int $limit = 0, string $cursor = ''): ResponseInterface|Response
{
$data = [];
if ($limit) {
$data['limit'] = $limit;
}
if ($cursor) {
$data['cursor'] = $cursor;
}
return $this->api->postJson('cgi-bin/user/list_id', $data);
}
}