mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-21 03:17:05 +08:00
52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Api\Controllers;
|
|
|
|
use App\Services\Logic\Im\GroupInfo as GroupInfoService;
|
|
use App\Services\Logic\Im\GroupList as GroupListService;
|
|
use App\Services\Logic\Im\GroupUserList as GroupUserListService;
|
|
|
|
/**
|
|
* @RoutePrefix("/api/im/group")
|
|
*/
|
|
class ImGroupController extends Controller
|
|
{
|
|
|
|
/**
|
|
* @Get("/list", name="api.im_group.list")
|
|
*/
|
|
public function listAction()
|
|
{
|
|
$service = new GroupListService();
|
|
|
|
$pager = $service->handle();
|
|
|
|
return $this->jsonSuccess(['pager' => $pager]);
|
|
}
|
|
|
|
/**
|
|
* @Get("/{id:[0-9]+}/info", name="api.im_group.info")
|
|
*/
|
|
public function infoAction($id)
|
|
{
|
|
$service = new GroupInfoService();
|
|
|
|
$group = $service->handle($id);
|
|
|
|
return $this->jsonSuccess(['group' => $group]);
|
|
}
|
|
|
|
/**
|
|
* @Get("/{id:[0-9]+}/users", name="api.im_group.users")
|
|
*/
|
|
public function usersAction($id)
|
|
{
|
|
$service = new GroupUserListService();
|
|
|
|
$pager = $service->handle($id);
|
|
|
|
return $this->jsonSuccess(['pager' => $pager]);
|
|
}
|
|
|
|
}
|