Compare commits

..

No commits in common. "d9a8da6a846ce7279d8ba6155372db151d732044" and "db70b1ad47dc4680e0ee11c473ce6b6a51aa24c9" have entirely different histories.

11 changed files with 50 additions and 54 deletions

View File

@ -127,11 +127,7 @@
<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 <a-select v-model:value="formData.packageType" @change="handlePackageTypeChange">
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 = "教师端 - 课程管理", description = "教师端课程 API") @Tag(name = "Teacher - Course", description = "Course APIs for Teacher")
@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 = "获取教师的班级列表") @Operation(summary = "Get teacher's classes")
@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 = "根据 ID 获取课程") @Operation(summary = "Get course by 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 = "获取课程分页列表") @Operation(summary = "Get course page")
@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 = "获取所有课程") @Operation(summary = "Get all courses")
@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 = "获取教师教授的所有学生") @Operation(summary = "Get all students of teacher")
@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 = "获取班级学生列表") @Operation(summary = "Get students of class")
@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 = "获取班级教师列表") @Operation(summary = "Get teachers of class")
@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 = "教师端反馈 API") @Tag(name = "教师端 - 反馈管理", description = "Teacher Feedback APIs")
@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 = "教师端 - 成长记录", description = "教师端成长记录 API") @Tag(name = "Teacher - Growth Record", description = "Growth Record APIs for Teacher")
@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 = "创建成长记录") @Operation(summary = "Create growth record")
@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 = "更新成长记录") @Operation(summary = "Update growth record")
@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 = "根据 ID 获取成长记录") @Operation(summary = "Get growth record by 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 = "获取成长记录分页列表") @Operation(summary = "Get growth record page")
@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 = "删除成长记录") @Operation(summary = "Delete growth record")
@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 = "教师端 - 课时管理", description = "教师端课时 API") @Tag(name = "Teacher - Lesson", description = "Lesson APIs for Teacher")
@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 = "创建课时") @Operation(summary = "Create lesson")
@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 = "更新课时") @Operation(summary = "Update lesson")
@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 = "根据 ID 获取课时(含课程、班级,供上课页面使用)") @Operation(summary = "Get lesson by 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 = "获取我的课时列表") @Operation(summary = "Get my lessons")
@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 = "开始上课") @Operation(summary = "Start lesson")
@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 = "完成课时") @Operation(summary = "Complete lesson")
@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 = "取消课时") @Operation(summary = "Cancel lesson")
@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 = "获取今日课程") @Operation(summary = "Get today's lessons")
@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 = "获取学生记录") @Operation(summary = "Get student records")
@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 = "保存学生记录") @Operation(summary = "Save student record")
@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 = "批量保存学生记录") @Operation(summary = "Batch save student records")
@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 = "获取课时反馈") @Operation(summary = "Get lesson feedback")
@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 = "提交课时反馈") @Operation(summary = "Submit lesson feedback")
@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 = "保存课时进度") @Operation(summary = "Save lesson progress")
@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 = "获取课时进度") @Operation(summary = "Get lesson progress")
@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 = "从排课开始上课") @Operation(summary = "Start lesson from schedule")
@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 = "从排课创建课时") @Operation(summary = "Create lesson from schedule")
@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 = "教师端 - 通知管理", description = "教师端通知 API") @Tag(name = "Teacher - Notification", description = "Notification APIs for Teacher")
@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 = "根据 ID 获取通知") @Operation(summary = "Get notification by 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 = "获取我的通知列表") @Operation(summary = "Get my notifications")
@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 = "标记通知为已读") @Operation(summary = "Mark notification as read")
@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 = "标记所有通知为已读") @Operation(summary = "Mark all notifications as read")
@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 = "获取未读数量") @Operation(summary = "Get unread count")
@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 = "教师端排课 API") @Tag(name = "教师端 - 排课管理", description = "Teacher Schedule APIs")
@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 = "教师端 - 统计数据", description = "教师端统计数据 API") @Tag(name = "教师端 - 统计数据")
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 = "教师端 - 任务管理", description = "教师端任务 API") @Tag(name = "Teacher - Task", description = "Task APIs for Teacher")
@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 = "创建任务") @Operation(summary = "Create task")
@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 = "更新任务") @Operation(summary = "Update task")
@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 = "根据 ID 获取任务") @Operation(summary = "Get task by 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 = "获取任务分页列表") @Operation(summary = "Get task page")
@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 = "删除任务") @Operation(summary = "Delete task")
@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 = "教师端任务模板 API") @Tag(name = "教师端 - 任务模板", description = "Teacher Task Template APIs")
@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, null, null); return getTenantPackageCourses(tenantId);
} }
@Override @Override