refactor(teacher): 教师端 Controller 注释中文化

将教师端所有 Controller 的 @Tag 和 @Operation 注释从英文改为中文,提升代码可读性和一致性。

涉及的 Controller:
- TeacherCourseController
- TeacherFeedbackController
- TeacherGrowthController
- TeacherLessonController
- TeacherNotificationController
- TeacherScheduleController
- TeacherStatsController
- TeacherTaskController
- TeacherTaskTemplateController

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
En 2026-03-18 15:10:01 +08:00
parent c85a3fd195
commit db508dc2b6
10 changed files with 49 additions and 48 deletions

View File

@ -11,6 +11,7 @@ declare module 'vue' {
AAvatar: typeof import('ant-design-vue/es')['Avatar']
ABadge: typeof import('ant-design-vue/es')['Badge']
AButton: typeof import('ant-design-vue/es')['Button']
AButtonGroup: typeof import('ant-design-vue/es')['ButtonGroup']
ACard: typeof import('ant-design-vue/es')['Card']
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
ACol: typeof import('ant-design-vue/es')['Col']

View File

@ -32,7 +32,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Tag(name = "Teacher - Course", description = "Course APIs for Teacher")
@Tag(name = "教师端 - 课程管理", description = "教师端课程 API")
@RestController
@RequestMapping("/api/v1/teacher")
@RequiredArgsConstructor
@ -47,7 +47,7 @@ public class TeacherCourseController {
private final StudentMapper studentMapper;
private final TeacherMapper teacherMapper;
@Operation(summary = "Get teacher's classes")
@Operation(summary = "获取教师的班级列表")
@GetMapping("/classes")
public Result<List<ClassResponse>> getClasses() {
Long tenantId = SecurityUtils.getCurrentTenantId();
@ -55,13 +55,13 @@ public class TeacherCourseController {
return Result.success(classMapper.toVO(classes));
}
@Operation(summary = "Get course by ID")
@Operation(summary = "根据 ID 获取课程")
@GetMapping("/courses/{id}")
public Result<CourseResponse> getCourse(@PathVariable Long id) {
return Result.success(courseService.getCourseByIdWithLessons(id));
}
@Operation(summary = "Get course page")
@Operation(summary = "获取课程分页列表")
@GetMapping("/courses")
public Result<PageResult<CourseResponse>> getCoursePage(
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
@ -74,7 +74,7 @@ public class TeacherCourseController {
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
}
@Operation(summary = "Get all courses")
@Operation(summary = "获取所有课程")
@GetMapping("/courses/all")
public Result<List<CourseResponse>> getAllCourses() {
Long tenantId = SecurityUtils.getCurrentTenantId();
@ -82,7 +82,7 @@ public class TeacherCourseController {
return Result.success(courseMapper.toVO(courses));
}
@Operation(summary = "Get all students of teacher")
@Operation(summary = "获取教师教授的所有学生")
@GetMapping("/students")
public Result<PageResult<StudentResponse>> getAllStudents(
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
@ -114,7 +114,7 @@ public class TeacherCourseController {
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
}
@Operation(summary = "Get students of class")
@Operation(summary = "获取班级学生列表")
@GetMapping("/classes/{id}/students")
public Result<PageResult<StudentResponse>> getClassStudents(
@PathVariable Long id,
@ -126,7 +126,7 @@ public class TeacherCourseController {
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
}
@Operation(summary = "Get teachers of class")
@Operation(summary = "获取班级教师列表")
@GetMapping("/classes/{id}/teachers")
public Result<List<TeacherResponse>> getClassTeachers(@PathVariable Long id) {
List<Long> teacherIds = classService.getTeacherIdsByClassId(id);

View File

@ -21,7 +21,7 @@ import java.util.Map;
/**
* 教师端 - 反馈管理
*/
@Tag(name = "教师端 - 反馈管理", description = "Teacher Feedback APIs")
@Tag(name = "教师端 - 反馈管理", description = "教师端反馈 API")
@RestController
@RequestMapping("/api/v1/teacher/feedbacks")
@RequiredArgsConstructor

View File

@ -14,7 +14,7 @@ import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@Tag(name = "Teacher - Growth Record", description = "Growth Record APIs for Teacher")
@Tag(name = "教师端 - 成长记录", description = "教师端成长记录 API")
@RestController
@RequestMapping("/api/v1/teacher/growth-records")
@RequiredArgsConstructor
@ -22,7 +22,7 @@ public class TeacherGrowthController {
private final GrowthRecordService growthRecordService;
@Operation(summary = "Create growth record")
@Operation(summary = "创建成长记录")
@PostMapping
public Result<GrowthRecord> createGrowthRecord(@Valid @RequestBody GrowthRecordCreateRequest request) {
Long tenantId = SecurityUtils.getCurrentTenantId();
@ -30,19 +30,19 @@ public class TeacherGrowthController {
return Result.success(growthRecordService.createGrowthRecord(tenantId, userId, "teacher", request));
}
@Operation(summary = "Update growth record")
@Operation(summary = "更新成长记录")
@PutMapping("/{id}")
public Result<GrowthRecord> updateGrowthRecord(@PathVariable Long id, @RequestBody GrowthRecordUpdateRequest request) {
return Result.success(growthRecordService.updateGrowthRecord(id, request));
}
@Operation(summary = "Get growth record by ID")
@Operation(summary = "根据 ID 获取成长记录")
@GetMapping("/{id}")
public Result<GrowthRecord> getGrowthRecord(@PathVariable Long id) {
return Result.success(growthRecordService.getGrowthRecordById(id));
}
@Operation(summary = "Get growth record page")
@Operation(summary = "获取成长记录分页列表")
@GetMapping
public Result<PageResult<GrowthRecord>> getGrowthRecordPage(
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
@ -54,7 +54,7 @@ public class TeacherGrowthController {
return Result.success(PageResult.of(page));
}
@Operation(summary = "Delete growth record")
@Operation(summary = "删除成长记录")
@DeleteMapping("/{id}")
public Result<Void> deleteGrowthRecord(@PathVariable Long id) {
growthRecordService.deleteGrowthRecord(id);

View File

@ -37,7 +37,7 @@ import org.springframework.web.bind.annotation.*;
import java.time.LocalDate;
import java.util.List;
@Tag(name = "Teacher - Lesson", description = "Lesson APIs for Teacher")
@Tag(name = "教师端 - 课时管理", description = "教师端课时 API")
@RestController
@RequestMapping("/api/v1/teacher/lessons")
@RequiredArgsConstructor
@ -52,7 +52,7 @@ public class TeacherLessonController {
private final CourseService courseService;
private final SchoolScheduleService schoolScheduleService;
@Operation(summary = "Create lesson")
@Operation(summary = "创建课时")
@PostMapping
public Result<LessonResponse> createLesson(@Valid @RequestBody LessonCreateRequest request) {
Long tenantId = SecurityUtils.getCurrentTenantId();
@ -62,14 +62,14 @@ public class TeacherLessonController {
return Result.success(vo);
}
@Operation(summary = "Update lesson")
@Operation(summary = "更新课时")
@PutMapping("/{id}")
public Result<LessonResponse> updateLesson(@PathVariable Long id, @RequestBody LessonUpdateRequest request) {
Lesson lesson = lessonService.updateLesson(id, request);
return Result.success(lessonMapper.toVO(lesson));
}
@Operation(summary = "Get lesson by ID(含课程、班级,供上课页面使用)")
@Operation(summary = "根据 ID 获取课时(含课程、班级,供上课页面使用)")
@GetMapping("/{id}")
public Result<LessonDetailResponse> getLesson(@PathVariable Long id) {
Lesson lesson = lessonService.getLessonById(id);
@ -96,7 +96,7 @@ public class TeacherLessonController {
return Result.success(detail);
}
@Operation(summary = "Get my lessons")
@Operation(summary = "获取我的课时列表")
@GetMapping
public Result<PageResult<LessonResponse>> getMyLessons(
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
@ -111,28 +111,28 @@ public class TeacherLessonController {
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
}
@Operation(summary = "Start lesson")
@Operation(summary = "开始上课")
@PostMapping("/{id}/start")
public Result<Void> startLesson(@PathVariable Long id) {
lessonService.startLesson(id);
return Result.success();
}
@Operation(summary = "Complete lesson")
@Operation(summary = "完成课时")
@PostMapping("/{id}/complete")
public Result<Void> completeLesson(@PathVariable Long id) {
lessonService.completeLesson(id);
return Result.success();
}
@Operation(summary = "Cancel lesson")
@Operation(summary = "取消课时")
@PostMapping("/{id}/cancel")
public Result<Void> cancelLesson(@PathVariable Long id) {
lessonService.cancelLesson(id);
return Result.success();
}
@Operation(summary = "Get today's lessons")
@Operation(summary = "获取今日课程")
@GetMapping("/today")
public Result<List<LessonResponse>> getTodayLessons() {
Long tenantId = SecurityUtils.getCurrentTenantId();
@ -142,7 +142,7 @@ public class TeacherLessonController {
return Result.success(voList);
}
@Operation(summary = "Get student records")
@Operation(summary = "获取学生记录")
@GetMapping("/{id}/students/records")
public Result<List<StudentRecordResponse>> getStudentRecords(@PathVariable Long id) {
List<StudentRecord> records = lessonService.getStudentRecords(id);
@ -150,7 +150,7 @@ public class TeacherLessonController {
return Result.success(voList);
}
@Operation(summary = "Save student record")
@Operation(summary = "保存学生记录")
@PostMapping("/{id}/students/{studentId}/record")
public Result<StudentRecordResponse> saveStudentRecord(
@PathVariable Long id,
@ -160,7 +160,7 @@ public class TeacherLessonController {
return Result.success(studentRecordMapper.toVO(record));
}
@Operation(summary = "Batch save student records")
@Operation(summary = "批量保存学生记录")
@PostMapping("/{id}/students/batch-records")
public Result<List<StudentRecordResponse>> batchSaveStudentRecords(
@PathVariable Long id,
@ -170,14 +170,14 @@ public class TeacherLessonController {
return Result.success(voList);
}
@Operation(summary = "Get lesson feedback")
@Operation(summary = "获取课时反馈")
@GetMapping("/{id}/feedback")
public Result<LessonFeedback> getLessonFeedback(@PathVariable Long id) {
LessonFeedback feedback = lessonService.getLessonFeedback(id);
return Result.success(feedback != null ? feedback : null);
}
@Operation(summary = "Submit lesson feedback")
@Operation(summary = "提交课时反馈")
@PostMapping("/{id}/feedback")
public Result<LessonFeedback> submitFeedback(
@PathVariable Long id,
@ -187,7 +187,7 @@ public class TeacherLessonController {
return Result.success(feedback);
}
@Operation(summary = "Save lesson progress")
@Operation(summary = "保存课时进度")
@PutMapping("/{id}/progress")
public Result<Void> saveLessonProgress(
@PathVariable Long id,
@ -196,7 +196,7 @@ public class TeacherLessonController {
return Result.success();
}
@Operation(summary = "Get lesson progress")
@Operation(summary = "获取课时进度")
@GetMapping("/{id}/progress")
public Result<LessonResponse> getLessonProgress(@PathVariable Long id) {
Lesson lesson = lessonService.getLessonProgress(id);
@ -220,7 +220,7 @@ public class TeacherLessonController {
}
}
@Operation(summary = "Start lesson from schedule")
@Operation(summary = "从排课开始上课")
@PostMapping("/from-schedule/{schedulePlanId}/start")
public Result<LessonResponse> startLessonFromSchedule(@PathVariable Long schedulePlanId) {
Long teacherId = SecurityUtils.getCurrentUserId();
@ -234,7 +234,7 @@ public class TeacherLessonController {
return Result.success(lessonMapper.toVO(lesson));
}
@Operation(summary = "Create lesson from schedule")
@Operation(summary = "从排课创建课时")
@PostMapping("/from-schedule/{schedulePlanId}")
public Result<LessonResponse> createLessonFromSchedule(@PathVariable Long schedulePlanId) {
Long teacherId = SecurityUtils.getCurrentUserId();

View File

@ -11,7 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@Tag(name = "Teacher - Notification", description = "Notification APIs for Teacher")
@Tag(name = "教师端 - 通知管理", description = "教师端通知 API")
@RestController
@RequestMapping("/api/v1/teacher/notifications")
@RequiredArgsConstructor
@ -19,13 +19,13 @@ public class TeacherNotificationController {
private final NotificationService notificationService;
@Operation(summary = "Get notification by ID")
@Operation(summary = "根据 ID 获取通知")
@GetMapping("/{id}")
public Result<Notification> getNotification(@PathVariable Long id) {
return Result.success(notificationService.getNotificationById(id));
}
@Operation(summary = "Get my notifications")
@Operation(summary = "获取我的通知列表")
@GetMapping
public Result<PageResult<Notification>> getMyNotifications(
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
@ -36,14 +36,14 @@ public class TeacherNotificationController {
return Result.success(PageResult.of(page));
}
@Operation(summary = "Mark notification as read")
@Operation(summary = "标记通知为已读")
@PostMapping("/{id}/read")
public Result<Void> markAsRead(@PathVariable Long id) {
notificationService.markAsRead(id);
return Result.success();
}
@Operation(summary = "Mark all notifications as read")
@Operation(summary = "标记所有通知为已读")
@PostMapping("/read-all")
public Result<Void> markAllAsRead() {
Long userId = SecurityUtils.getCurrentUserId();
@ -51,7 +51,7 @@ public class TeacherNotificationController {
return Result.success();
}
@Operation(summary = "Get unread count")
@Operation(summary = "获取未读数量")
@GetMapping("/unread-count")
public Result<Long> getUnreadCount() {
Long userId = SecurityUtils.getCurrentUserId();

View File

@ -26,7 +26,7 @@ import java.util.List;
/**
* 教师端 - 排课管理
*/
@Tag(name = "教师端 - 排课管理", description = "Teacher Schedule APIs")
@Tag(name = "教师端 - 排课管理", description = "教师端排课 API")
@RestController
@RequestMapping("/api/v1/teacher/schedules")
@RequiredArgsConstructor

View File

@ -19,7 +19,7 @@ import java.util.Map;
@RestController
@RequestMapping("/api/v1/teacher")
@RequiredArgsConstructor
@Tag(name = "教师端 - 统计数据")
@Tag(name = "教师端 - 统计数据", description = "教师端统计数据 API")
public class TeacherStatsController {
private final TeacherStatsService teacherStatsService;

View File

@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
@Tag(name = "Teacher - Task", description = "Task APIs for Teacher")
@Tag(name = "教师端 - 任务管理", description = "教师端任务 API")
@RestController
@RequestMapping("/api/v1/teacher/tasks")
@RequiredArgsConstructor
@ -27,7 +27,7 @@ public class TeacherTaskController {
private final TaskService taskService;
private final TaskMapper taskMapper;
@Operation(summary = "Create task")
@Operation(summary = "创建任务")
@PostMapping
public Result<TaskResponse> createTask(@Valid @RequestBody TaskCreateRequest request) {
Long tenantId = SecurityUtils.getCurrentTenantId();
@ -36,21 +36,21 @@ public class TeacherTaskController {
return Result.success(taskMapper.toVO(task));
}
@Operation(summary = "Update task")
@Operation(summary = "更新任务")
@PutMapping("/{id}")
public Result<TaskResponse> updateTask(@PathVariable Long id, @RequestBody TaskUpdateRequest request) {
Task task = taskService.updateTask(id, request);
return Result.success(taskMapper.toVO(task));
}
@Operation(summary = "Get task by ID")
@Operation(summary = "根据 ID 获取任务")
@GetMapping("/{id}")
public Result<TaskResponse> getTask(@PathVariable Long id) {
Task task = taskService.getTaskById(id);
return Result.success(taskMapper.toVO(task));
}
@Operation(summary = "Get task page")
@Operation(summary = "获取任务分页列表")
@GetMapping
public Result<PageResult<TaskResponse>> getTaskPage(
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
@ -64,7 +64,7 @@ public class TeacherTaskController {
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
}
@Operation(summary = "Delete task")
@Operation(summary = "删除任务")
@DeleteMapping("/{id}")
public Result<Void> deleteTask(@PathVariable Long id) {
taskService.deleteTask(id);

View File

@ -24,7 +24,7 @@ import java.util.List;
/**
* 教师端 - 任务模板
*/
@Tag(name = "教师端 - 任务模板", description = "Teacher Task Template APIs")
@Tag(name = "教师端 - 任务模板", description = "教师端任务模板 API")
@RestController
@RequestMapping("/api/v1/teacher/task-templates")
@RequiredArgsConstructor