blog/app/controller/DepartmentController.php

26 lines
583 B
PHP
Raw Normal View History

2024-06-08 15:54:41 +08:00
<?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']));
}
}