1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-20 19:07:03 +08:00
course-tencent-cloud/app/Http/Home/Controllers/ImGroupManageController.php
koogua cbc2e5762a !11 阶段性合并
* 根据app需要作出相应调整
* 路由增加命名name,增加app应用管理
* 完成基本API,增加h5和小程序支付定义
2020-11-10 10:25:16 +08:00

74 lines
1.6 KiB
PHP

<?php
namespace App\Http\Home\Controllers;
use App\Http\Home\Services\ImGroup as ImGroupService;
/**
* @RoutePrefix("/igm")
*/
class ImGroupManageController extends Controller
{
/**
* @Get("/{id:[0-9]+}/users", name="home.igm.users")
*/
public function usersAction($id)
{
$service = new ImGroupService();
$group = $service->getGroup($id);
$pager = $service->getGroupUsers($id);
$this->view->pick('im/group/manage/users');
$this->view->setVar('group', $group);
$this->view->setVar('pager', $pager);
}
/**
* @Get("/{id:[0-9]+}/edit", name="home.igm.edit")
*/
public function editAction($id)
{
$service = new ImGroupService();
$group = $service->getGroup($id);
$this->view->pick('im/group/manage/edit');
$this->view->setVar('group', $group);
}
/**
* @Post("/{id:[0-9]+}/update", name="home.igm.update")
*/
public function updateAction($id)
{
$service = new ImGroupService();
$service->updateGroup($id);
return $this->jsonSuccess(['msg' => '更新群组成功']);
}
/**
* @Post("/{gid:[0-9]+}/user/{uid:[0-9]+}/delete", name="home.igm.delete_user")
*/
public function deleteGroupUserAction($gid, $uid)
{
$service = new ImGroupService();
$service->deleteGroupUser($gid, $uid);
$location = $this->request->getHTTPReferer();
$content = [
'location' => $location,
'msg' => '移除用户成功',
];
return $this->jsonSuccess($content);
}
}