26 lines
583 B
PHP
26 lines
583 B
PHP
|
<?php
|
||
|
namespace app\controller;
|
||
|
|
||
|
use app\service\DepartmentService;
|
||
|
use app\util\Result;
|
||
|
use support\Request;
|
||
|
|
||
|
class DepartmentController
|
||
|
{
|
||
|
/**
|
||
|
* @Inject
|
||
|
* @var Result
|
||
|
*/
|
||
|
private $result;
|
||
|
/**
|
||
|
* @Inject
|
||
|
* @var DepartmentService
|
||
|
*/
|
||
|
private $departmentService;
|
||
|
public function list(Request $request)
|
||
|
{
|
||
|
$info = $this->departmentService->allList();
|
||
|
if ($info['result']) return json(retData($this->result::SUCCESS, $info['msg'], $info['data']));
|
||
|
return json(retData($this->result::ERROR, $info['msg']));
|
||
|
}
|
||
|
}
|