..
This commit is contained in:
@@ -8,6 +8,8 @@ use Aether\Exception\BusinessException;
|
|||||||
use App\Model\Campus;
|
use App\Model\Campus;
|
||||||
use App\Model\Teacher;
|
use App\Model\Teacher;
|
||||||
use App\Validator\CampusValidator;
|
use App\Validator\CampusValidator;
|
||||||
|
use App\Validator\TeacherValidator;
|
||||||
|
use Exception;
|
||||||
use Hyperf\Di\Annotation\Inject;
|
use Hyperf\Di\Annotation\Inject;
|
||||||
use Hyperf\RpcServer\Annotation\RpcService;
|
use Hyperf\RpcServer\Annotation\RpcService;
|
||||||
use MicroService\Contract\DataServiceInterface;
|
use MicroService\Contract\DataServiceInterface;
|
||||||
@@ -21,12 +23,24 @@ class DataService implements DataServiceInterface
|
|||||||
#[Inject]
|
#[Inject]
|
||||||
protected CampusValidator $campusValidator;
|
protected CampusValidator $campusValidator;
|
||||||
|
|
||||||
|
#[Inject]
|
||||||
|
protected Teacher $teacherModel;
|
||||||
|
|
||||||
|
#[Inject]
|
||||||
|
protected TeacherValidator $teacherValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取校区列表.
|
||||||
|
*/
|
||||||
public function getCampuses(array $data): array
|
public function getCampuses(array $data): array
|
||||||
{
|
{
|
||||||
// TODO list 方法存在问题
|
|
||||||
return $this->campusModel->list($data);
|
return $this->campusModel->list($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取校区详情.
|
||||||
|
* @throws BusinessException
|
||||||
|
*/
|
||||||
public function getCampusBy(int $id): array
|
public function getCampusBy(int $id): array
|
||||||
{
|
{
|
||||||
$campus = $this->campusModel->find($id);
|
$campus = $this->campusModel->find($id);
|
||||||
@@ -36,6 +50,10 @@ class DataService implements DataServiceInterface
|
|||||||
return $campus->toArray();
|
return $campus->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建校区.
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public function createCampus(array $data): int
|
public function createCampus(array $data): int
|
||||||
{
|
{
|
||||||
$this->campusValidator->scene('create', $data)->check();
|
$this->campusValidator->scene('create', $data)->check();
|
||||||
@@ -43,54 +61,44 @@ class DataService implements DataServiceInterface
|
|||||||
return $campus->id;
|
return $campus->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校区.
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public function updateCampus(int $id, array $data): int
|
public function updateCampus(int $id, array $data): int
|
||||||
{
|
{
|
||||||
$this->campusValidator->scene('update', $data)->check();
|
$this->campusValidator->scene('update', $data)->check();
|
||||||
return $this->campusModel->updateById($id, $data);
|
return $this->campusModel->updateById($id, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除校区.
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public function deleteCampus(int $id): bool
|
public function deleteCampus(int $id): bool
|
||||||
{
|
{
|
||||||
return $this->campusModel->deleteById($id);
|
return $this->campusModel->deleteById($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCampusById(int $id): array
|
/**
|
||||||
{
|
* 获取省份列表.
|
||||||
$campus = Campus::find($id);
|
*/
|
||||||
if (! $campus || $campus->status != 1) {
|
|
||||||
throw new BusinessException('校区不存在或已禁用', 10001);
|
|
||||||
}
|
|
||||||
return $campus->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCampusesByIds(array $ids): array
|
|
||||||
{
|
|
||||||
return Campus::whereIn('id', $ids)
|
|
||||||
->enabled()
|
|
||||||
->get()
|
|
||||||
->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCampusesByParentId(int $parentId): array
|
|
||||||
{
|
|
||||||
return Campus::where('parent_id', $parentId)
|
|
||||||
->enabled()
|
|
||||||
->get()
|
|
||||||
->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getProvinces(): array
|
public function getProvinces(): array
|
||||||
{
|
{
|
||||||
return Campus::level(1)
|
return $this->campusModel->level(1)
|
||||||
->enabled()
|
->enabled()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->get(['id', 'name', 'province'])
|
->get(['id', 'name', 'province'])
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据省份获取城市列表.
|
||||||
|
* @throws BusinessException
|
||||||
|
*/
|
||||||
public function getCitiesByProvince(string $province): array
|
public function getCitiesByProvince(string $province): array
|
||||||
{
|
{
|
||||||
return Campus::level(2)
|
return $this->campusModel->level(2)
|
||||||
->province($province)
|
->province($province)
|
||||||
->enabled()
|
->enabled()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
@@ -98,97 +106,54 @@ class DataService implements DataServiceInterface
|
|||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTeacherById(int $id): array
|
/**
|
||||||
|
* 获取教师列表.
|
||||||
|
*/
|
||||||
|
public function getTeachers(array $data): array
|
||||||
{
|
{
|
||||||
$teacher = Teacher::find($id);
|
return $this->teacherModel->list($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取教师详情.
|
||||||
|
* @throws BusinessException
|
||||||
|
*/
|
||||||
|
public function getTeacherBy(int $id): array
|
||||||
|
{
|
||||||
|
$teacher = $this->teacherModel->find($id);
|
||||||
if (! $teacher || $teacher->status != 1) {
|
if (! $teacher || $teacher->status != 1) {
|
||||||
throw new BusinessException('教师不存在或已禁用', 10101);
|
throw new BusinessException('教师不存在或已禁用', 10001);
|
||||||
}
|
}
|
||||||
return $teacher->toArray();
|
return $teacher->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTeachersByIds(array $ids): array
|
/**
|
||||||
{
|
* 创建教师.
|
||||||
return Teacher::whereIn('id', $ids)
|
* @throws Exception
|
||||||
->enabled()
|
*/
|
||||||
->orderBy('sort_order', 'asc')
|
|
||||||
->get()
|
|
||||||
->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTeachersByCampusId(int $campusId, int $page = 1, int $size = 20): array
|
|
||||||
{
|
|
||||||
$query = Teacher::campusId($campusId)
|
|
||||||
->enabled()
|
|
||||||
->orderBy('sort_order', 'asc');
|
|
||||||
|
|
||||||
$total = $query->count();
|
|
||||||
$list = $query->forPage($page, $size)->get()->toArray();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'total' => $total,
|
|
||||||
'page' => $page,
|
|
||||||
'size' => $size,
|
|
||||||
'list' => $list,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTeachersBySubject(string $subject, int $page = 1, int $size = 20): array
|
|
||||||
{
|
|
||||||
$query = Teacher::subject($subject)
|
|
||||||
->enabled()
|
|
||||||
->orderBy('sort_order', 'asc');
|
|
||||||
|
|
||||||
$total = $query->count();
|
|
||||||
$list = $query->forPage($page, $size)->get()->toArray();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'total' => $total,
|
|
||||||
'page' => $page,
|
|
||||||
'size' => $size,
|
|
||||||
'list' => $list,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function searchTeachers(string $keyword, int $page = 1, int $size = 20): array
|
|
||||||
{
|
|
||||||
$query = Teacher::search($keyword)
|
|
||||||
->enabled()
|
|
||||||
->orderBy('sort_order', 'asc');
|
|
||||||
|
|
||||||
$total = $query->count();
|
|
||||||
$list = $query->forPage($page, $size)->get()->toArray();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'total' => $total,
|
|
||||||
'page' => $page,
|
|
||||||
'size' => $size,
|
|
||||||
'list' => $list,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTeachers(): array
|
|
||||||
{
|
|
||||||
// TODO: Implement getTeachers() method.
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTeacherBy(int $id): array
|
|
||||||
{
|
|
||||||
// TODO: Implement getTeacherBy() method.
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createTeacher(array $data): int
|
public function createTeacher(array $data): int
|
||||||
{
|
{
|
||||||
// TODO: Implement createTeacher() method.
|
$this->teacherValidator->scene('create', $data)->check();
|
||||||
|
$teacher = $this->teacherModel->create($data);
|
||||||
|
return $teacher->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新教师.
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public function updateTeacher(int $id, array $data): int
|
public function updateTeacher(int $id, array $data): int
|
||||||
{
|
{
|
||||||
// TODO: Implement updateTeacher() method.
|
$this->teacherValidator->scene('update', $data)->check();
|
||||||
|
return $this->teacherModel->updateById($id, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除教师.
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public function deleteTeacher(int $id): bool
|
public function deleteTeacher(int $id): bool
|
||||||
{
|
{
|
||||||
// TODO: Implement deleteTeacher() method.
|
return $this->teacherModel->deleteById($id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class Teacher extends AetherModel
|
|||||||
'introduction',
|
'introduction',
|
||||||
'campus_id',
|
'campus_id',
|
||||||
'status',
|
'status',
|
||||||
'sort_order',
|
'sort',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected array $casts = [
|
protected array $casts = [
|
||||||
@@ -51,12 +51,19 @@ class Teacher extends AetherModel
|
|||||||
'gender' => 'integer',
|
'gender' => 'integer',
|
||||||
'campus_id' => 'integer',
|
'campus_id' => 'integer',
|
||||||
'status' => 'integer',
|
'status' => 'integer',
|
||||||
'sort_order' => 'integer',
|
'sort' => 'integer',
|
||||||
'created_at' => 'datetime',
|
'created_at' => 'datetime',
|
||||||
'updated_at' => 'datetime',
|
'updated_at' => 'datetime',
|
||||||
'deleted_at' => 'datetime',
|
'deleted_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected array|bool|string $sortable = 'sort';
|
||||||
|
|
||||||
|
protected array $search = [
|
||||||
|
'name' => 'like',
|
||||||
|
'campus_id' => '=',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属校区.
|
* 所属校区.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,13 +18,12 @@ class TeacherValidator extends AetherValidator
|
|||||||
'gender' => 'nullable|integer|in:1,2',
|
'gender' => 'nullable|integer|in:1,2',
|
||||||
'avatar' => 'nullable|url|max:255',
|
'avatar' => 'nullable|url|max:255',
|
||||||
'title' => 'nullable|string|max:100',
|
'title' => 'nullable|string|max:100',
|
||||||
'major_subject' => 'required|string|max:100',
|
'teach_subject' => 'nullable|string|max:100',
|
||||||
'teaching_style' => 'nullable|string',
|
'style' => 'nullable|string',
|
||||||
'introduction' => 'nullable|string',
|
'introduction' => 'nullable|string',
|
||||||
],
|
],
|
||||||
'messages' => [
|
'messages' => [
|
||||||
'name.required' => '教师姓名不能为空',
|
'name.required' => '教师姓名不能为空',
|
||||||
'major_subject.required' => '主讲科目不能为空',
|
|
||||||
'age.min' => '年龄不能小于18岁',
|
'age.min' => '年龄不能小于18岁',
|
||||||
'age.max' => '年龄不能大于65岁',
|
'age.max' => '年龄不能大于65岁',
|
||||||
'gender.in' => '性别只能是1(男)或2(女)',
|
'gender.in' => '性别只能是1(男)或2(女)',
|
||||||
@@ -39,7 +38,7 @@ class TeacherValidator extends AetherValidator
|
|||||||
'gender' => 'nullable|integer|in:1,2',
|
'gender' => 'nullable|integer|in:1,2',
|
||||||
'avatar' => 'nullable|url|max:255',
|
'avatar' => 'nullable|url|max:255',
|
||||||
'title' => 'nullable|string|max:100',
|
'title' => 'nullable|string|max:100',
|
||||||
'major_subject' => 'nullable|string|max:100',
|
'teach_subject' => 'nullable|string|max:100',
|
||||||
],
|
],
|
||||||
'messages' => [
|
'messages' => [
|
||||||
'id.required' => '教师ID不能为空',
|
'id.required' => '教师ID不能为空',
|
||||||
@@ -54,7 +53,7 @@ class TeacherValidator extends AetherValidator
|
|||||||
'id' => 'nullable|integer|min:1',
|
'id' => 'nullable|integer|min:1',
|
||||||
'name' => 'nullable|string|max:50',
|
'name' => 'nullable|string|max:50',
|
||||||
'campus_id' => 'nullable|integer|min:0',
|
'campus_id' => 'nullable|integer|min:0',
|
||||||
'major_subject' => 'nullable|string|max:100',
|
'teach_subject' => 'nullable|string|max:100',
|
||||||
'status' => 'nullable|integer|in:0,1',
|
'status' => 'nullable|integer|in:0,1',
|
||||||
'page' => 'nullable|integer|min:1',
|
'page' => 'nullable|integer|min:1',
|
||||||
'size' => 'nullable|integer|min:1|max',
|
'size' => 'nullable|integer|min:1|max',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use Hyperf\Contract\ContainerInterface;
|
|||||||
use Hyperf\Di\Annotation\Inject;
|
use Hyperf\Di\Annotation\Inject;
|
||||||
use Hyperf\HttpServer\Contract\RequestInterface;
|
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||||
use Hyperf\HttpServer\Contract\ResponseInterface;
|
use Hyperf\HttpServer\Contract\ResponseInterface;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
abstract class AetherController
|
abstract class AetherController
|
||||||
{
|
{
|
||||||
@@ -41,6 +42,7 @@ abstract class AetherController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建资源 (RESTFul: POST resources).
|
* 创建资源 (RESTFul: POST resources).
|
||||||
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function create(): array
|
public function create(): array
|
||||||
{
|
{
|
||||||
@@ -51,6 +53,7 @@ abstract class AetherController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新资源 (RESTFul: PUT resources/{id}).
|
* 更新资源 (RESTFul: PUT resources/{id}).
|
||||||
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function update(int $id): array
|
public function update(int $id): array
|
||||||
{
|
{
|
||||||
@@ -61,6 +64,7 @@ abstract class AetherController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除资源 (RESTFul: DELETE resources/{id}).
|
* 删除资源 (RESTFul: DELETE resources/{id}).
|
||||||
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
public function delete(int $id): array
|
public function delete(int $id): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,10 +6,6 @@ namespace Aether;
|
|||||||
|
|
||||||
class AetherResponse
|
class AetherResponse
|
||||||
{
|
{
|
||||||
public const SUCCESS = 0;
|
|
||||||
|
|
||||||
public const ERROR = 1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成功响应.
|
* 成功响应.
|
||||||
* @param null|mixed $data 数据
|
* @param null|mixed $data 数据
|
||||||
@@ -18,10 +14,9 @@ class AetherResponse
|
|||||||
public static function success(mixed $data = null, string $message = '操作成功'): array
|
public static function success(mixed $data = null, string $message = '操作成功'): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'code' => self::SUCCESS,
|
Config::RESPONSE_FIELD_KEY_DATA => $data,
|
||||||
'message' => $message,
|
Config::RESPONSE_FIELD_KEY_CODE => Config::RESPONSE_SUCCESS_CODE,
|
||||||
'data' => $data,
|
Config::RESPONSE_FIELD_KEY_MESSAGE => $message ?: Config::RESPONSE_SUCCESS_MESSAGE,
|
||||||
'timestamp' => time(),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,29 +26,27 @@ class AetherResponse
|
|||||||
* @param string $message 错误消息
|
* @param string $message 错误消息
|
||||||
* @param null|mixed $data 附加数据
|
* @param null|mixed $data 附加数据
|
||||||
*/
|
*/
|
||||||
public static function error(string $message = '', int $code = self::ERROR, mixed $data = null): array
|
public static function error(string $message = '', int $code = Config::RESPONSE_FAIL_CODE, mixed $data = null): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'code' => $code,
|
Config::RESPONSE_FIELD_KEY_CODE => $code,
|
||||||
'message' => $message ?: self::getDefaultMessage($code),
|
Config::RESPONSE_FIELD_KEY_DATA => $data,
|
||||||
'data' => $data,
|
Config::RESPONSE_FIELD_KEY_MESSAGE => $message ?: self::getDefaultMessage($code),
|
||||||
'timestamp' => time(),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function page($list, int $total, int $page, int $size): array
|
public static function page($list, int $total, int $page, int $size): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'code' => self::SUCCESS,
|
Config::RESPONSE_FIELD_KEY_CODE => Config::RESPONSE_SUCCESS_CODE,
|
||||||
'message' => 'success',
|
Config::RESPONSE_FIELD_KEY_MESSAGE => 'success',
|
||||||
'data' => [
|
Config::RESPONSE_FIELD_KEY_LIST => [
|
||||||
'list' => $list,
|
'list' => $list,
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
'size' => $size,
|
'size' => $size,
|
||||||
'total' => $total,
|
'total' => $total,
|
||||||
'pages' => (int) ceil($total / $size),
|
'pages' => (int) ceil($total / $size),
|
||||||
],
|
],
|
||||||
'timestamp' => time(),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,4 +11,14 @@ class Config
|
|||||||
public const RESPONSE_FIELD_KEY_DATA = 'data';
|
public const RESPONSE_FIELD_KEY_DATA = 'data';
|
||||||
|
|
||||||
public const RESPONSE_FIELD_KEY_MESSAGE = 'message';
|
public const RESPONSE_FIELD_KEY_MESSAGE = 'message';
|
||||||
|
|
||||||
|
public const RESPONSE_FIELD_KEY_LIST = 'list';
|
||||||
|
|
||||||
|
public const RESPONSE_SUCCESS_CODE = 200;
|
||||||
|
|
||||||
|
public const RESPONSE_SUCCESS_MESSAGE = 'success';
|
||||||
|
|
||||||
|
public const RESPONSE_FAIL_CODE = -1;
|
||||||
|
|
||||||
|
public const RESPONSE_FAIL_MESSAGE = 'fail';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,24 +18,6 @@ interface DataServiceInterface
|
|||||||
|
|
||||||
public function deleteCampus(int $id): bool;
|
public function deleteCampus(int $id): bool;
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取校区详情.
|
|
||||||
* @param int $id 校区ID
|
|
||||||
*/
|
|
||||||
public function getCampusById(int $id): array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量获取校区信息.
|
|
||||||
* @param array $ids 校区ID列表
|
|
||||||
*/
|
|
||||||
public function getCampusesByIds(array $ids): array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据父ID获取子校区.
|
|
||||||
* @param int $parentId 父级ID
|
|
||||||
*/
|
|
||||||
public function getCampusesByParentId(int $parentId): array;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取省份列表.
|
* 获取省份列表.
|
||||||
*/
|
*/
|
||||||
@@ -49,7 +31,7 @@ interface DataServiceInterface
|
|||||||
|
|
||||||
// ----------------- 教师服务 -----------------
|
// ----------------- 教师服务 -----------------
|
||||||
|
|
||||||
public function getTeachers(): array;
|
public function getTeachers(array $data): array;
|
||||||
|
|
||||||
public function getTeacherBy(int $id): array;
|
public function getTeacherBy(int $id): array;
|
||||||
|
|
||||||
@@ -58,40 +40,4 @@ interface DataServiceInterface
|
|||||||
public function updateTeacher(int $id, array $data): int;
|
public function updateTeacher(int $id, array $data): int;
|
||||||
|
|
||||||
public function deleteTeacher(int $id): bool;
|
public function deleteTeacher(int $id): bool;
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取教师详情.
|
|
||||||
* @param int $id 教师ID
|
|
||||||
*/
|
|
||||||
public function getTeacherById(int $id): array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量获取教师信息.
|
|
||||||
* @param array $ids 教师ID列表
|
|
||||||
*/
|
|
||||||
public function getTeachersByIds(array $ids): array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据校区获取教师列表.
|
|
||||||
* @param int $campusId 校区ID
|
|
||||||
* @param int $page 页码
|
|
||||||
* @param int $size 每页条数
|
|
||||||
*/
|
|
||||||
public function getTeachersByCampusId(int $campusId, int $page = 1, int $size = 20): array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据科目获取教师列表.
|
|
||||||
* @param string $subject 科目名称
|
|
||||||
* @param int $page 页码
|
|
||||||
* @param int $size 每页条数
|
|
||||||
*/
|
|
||||||
public function getTeachersBySubject(string $subject, int $page = 1, int $size = 20): array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 搜索教师.
|
|
||||||
* @param string $keyword 搜索关键词
|
|
||||||
* @param int $page 页码
|
|
||||||
* @param int $size 每页条数
|
|
||||||
*/
|
|
||||||
public function searchTeachers(string $keyword, int $page = 1, int $size = 20): array;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user