hyperf-chat/app/Controller/Api/V1/Group/GroupController.php

79 lines
1.4 KiB
PHP
Raw Normal View History

2022-01-16 10:29:16 +08:00
<?php
declare(strict_types=1);
namespace App\Controller\Api\V1\Group;
use App\Controller\Api\V1\CController;
use App\Service\Group\GroupMemberService;
use App\Service\Group\GroupService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\HttpServer\Annotation\Middleware;
use App\Middleware\JWTAuthMiddleware;
use Psr\Http\Message\ResponseInterface;
/**
* Class GroupController
*
* @Controller(prefix="/api/v1/group")
* @Middleware(JWTAuthMiddleware::class)
*
* @package App\Controller\Api\V1\Group
*/
class GroupController extends CController
{
/**
* @Inject
* @var GroupService
*/
private $groupService;
/**
* @inject
* @var GroupMemberService
*/
private $groupMemberService;
/**
* 获取群组列表
* @RequestMapping(path="list", methods="get")
*/
public function list(): ResponseInterface
{
return $this->response->success([
"rows" => $this->groupService->getUserGroups($this->uid()),
]);
}
// public function Detail()
// {
//
// }
//
// public function Create()
// {
//
// }
//
// public function Dismiss()
// {
//
// }
//
// public function Invite()
// {
//
// }
//
// public function SignOut()
// {
//
// }
//
// public function Setting()
// {
//
// }
}