This commit is contained in:
Aether
2025-09-29 10:15:17 +08:00
parent e7c5d7d098
commit 9a1c120c4f
7 changed files with 107 additions and 183 deletions

View File

@@ -18,13 +18,12 @@ class TeacherValidator extends AetherValidator
'gender' => 'nullable|integer|in:1,2',
'avatar' => 'nullable|url|max:255',
'title' => 'nullable|string|max:100',
'major_subject' => 'required|string|max:100',
'teaching_style' => 'nullable|string',
'teach_subject' => 'nullable|string|max:100',
'style' => 'nullable|string',
'introduction' => 'nullable|string',
],
'messages' => [
'name.required' => '教师姓名不能为空',
'major_subject.required' => '主讲科目不能为空',
'age.min' => '年龄不能小于18岁',
'age.max' => '年龄不能大于65岁',
'gender.in' => '性别只能是1(男)或2(女)',
@@ -39,7 +38,7 @@ class TeacherValidator extends AetherValidator
'gender' => 'nullable|integer|in:1,2',
'avatar' => 'nullable|url|max:255',
'title' => 'nullable|string|max:100',
'major_subject' => 'nullable|string|max:100',
'teach_subject' => 'nullable|string|max:100',
],
'messages' => [
'id.required' => '教师ID不能为空',
@@ -54,7 +53,7 @@ class TeacherValidator extends AetherValidator
'id' => 'nullable|integer|min:1',
'name' => 'nullable|string|max:50',
'campus_id' => 'nullable|integer|min:0',
'major_subject' => 'nullable|string|max:100',
'teach_subject' => 'nullable|string|max:100',
'status' => 'nullable|integer|in:0,1',
'page' => 'nullable|integer|min:1',
'size' => 'nullable|integer|min:1|max',