Compare commits

...

6 Commits

Author SHA1 Message Date
En
d9a8da6a84 Merge remote-tracking branch 'origin/master' 2026-03-18 15:30:14 +08:00
En
e08530c04b fix: 修复 CourseServiceImpl 编译错误
修复 getCoursesByTenantId 方法调用 getTenantPackageCourses 时参数不足的问题。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 15:24:57 +08:00
En
aff8162180 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	reading-platform-frontend/src/components.d.ts
2026-03-18 15:14:01 +08:00
En
db508dc2b6 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>
2026-03-18 15:10:01 +08:00
En
c85a3fd195 Merge remote-tracking branch 'origin/master' 2026-03-18 10:02:26 +08:00
En
ad249d0392 租户编辑,暂时不能更换套餐 2026-03-18 10:01:50 +08:00
11 changed files with 54 additions and 50 deletions

View File

@ -127,7 +127,11 @@
<a-input v-model:value="formData.address" placeholder="请输入学习地址" /> <a-input v-model:value="formData.address" placeholder="请输入学习地址" />
</a-form-item> </a-form-item>
<a-form-item label="套餐类型" name="packageType"> <a-form-item label="套餐类型" name="packageType">
<a-select v-model:value="formData.packageType" @change="handlePackageTypeChange"> <a-select
v-model:value="formData.packageType"
:disabled="isEdit"
@change="handlePackageTypeChange"
>
<a-select-option value="">请选择套餐</a-select-option> <a-select-option value="">请选择套餐</a-select-option>
<a-select-option v-for="pkg in packageList" :key="pkg.id" :value="pkg.name"> <a-select-option v-for="pkg in packageList" :key="pkg.id" :value="pkg.name">
{{ pkg.name }} ({{ formatPackagePrice(pkg.discountPrice || pkg.price) }}) {{ pkg.name }} ({{ formatPackagePrice(pkg.discountPrice || pkg.price) }})

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -551,7 +551,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course>
public List<Course> getCoursesByTenantId(Long tenantId) { public List<Course> getCoursesByTenantId(Long tenantId) {
log.info("查询租户课程列表tenantId={}", tenantId); log.info("查询租户课程列表tenantId={}", tenantId);
// 使用三层架构查询租户 课程套餐 课程包 课程 // 使用三层架构查询租户 课程套餐 课程包 课程
return getTenantPackageCourses(tenantId); return getTenantPackageCourses(tenantId, null, null);
} }
@Override @Override