feat: 家长端任务、教师端统计、数据库迁移等
- 家长端阅读任务:从 task_target 获取任务(学生+班级),支持家长关联孩子查看 - 家长端提交任务:修复照片上传,使用 uploadFile(file, poster) 符合 API 规范 - 教师端任务列表:TaskResponse 新增 targetCount、completionCount,填充目标人数与完成人数 - 数据库迁移:V45 添加 task_completion.photos,V46 添加 submitted_at、reviewed_at - 其他:班级学生、家长孩子、学校班级统计等修复 Made-with: Cursor
This commit is contained in:
parent
c93d325cee
commit
5cb903d7ed
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,7 @@
|
||||
*/
|
||||
import type {
|
||||
BasicSettingsUpdateRequest,
|
||||
BatchStudentRecordsRequest,
|
||||
BindStudentParams,
|
||||
ChangePasswordParams,
|
||||
CheckConflictParams,
|
||||
@ -29,8 +30,10 @@ import type {
|
||||
GenerateReadOnlyTokenParams,
|
||||
GetActiveTeachersParams,
|
||||
GetActiveTenantsParams,
|
||||
GetAllCoursesParams,
|
||||
GetAllStudentsParams,
|
||||
GetCalendarViewDataParams,
|
||||
GetChildLessonsParams,
|
||||
GetClassPageParams,
|
||||
GetClassStudents1Params,
|
||||
GetClassStudentsParams,
|
||||
@ -57,8 +60,11 @@ import type {
|
||||
GetSchedules1Params,
|
||||
GetSchedulesParams,
|
||||
GetSchoolCoursesParams,
|
||||
GetStatisticsParams,
|
||||
GetStudentPageParams,
|
||||
GetTaskPage1Params,
|
||||
GetTaskCompletions1Params,
|
||||
GetTaskCompletionsParams,
|
||||
GetTaskListParams,
|
||||
GetTaskPageParams,
|
||||
GetTasksByStudentParams,
|
||||
GetTeacherPageParams,
|
||||
@ -82,7 +88,6 @@ import type {
|
||||
RefreshTokenRequest,
|
||||
RenewRequest,
|
||||
ResetPassword1Params,
|
||||
ResetPasswordParams,
|
||||
ResourceItemCreateRequest,
|
||||
ResourceItemUpdateRequest,
|
||||
ResourceLibraryCreateRequest,
|
||||
@ -95,7 +100,10 @@ import type {
|
||||
StudentCreateRequest,
|
||||
StudentRecordRequest,
|
||||
StudentUpdateRequest,
|
||||
TaskCompleteRequest,
|
||||
TaskCreateRequest,
|
||||
TaskFeedbackRequest,
|
||||
TaskSubmitRequest,
|
||||
TaskTemplateCreateRequest,
|
||||
TaskUpdateRequest,
|
||||
TeacherCreateRequest,
|
||||
@ -162,6 +170,38 @@ const deleteTask = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 修改评价
|
||||
*/
|
||||
const updateFeedback = (
|
||||
completionId: number,
|
||||
taskFeedbackRequest: TaskFeedbackRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/teacher/tasks/completions/${completionId}/feedback`, method: 'PUT',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: taskFeedbackRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 提交评价
|
||||
*/
|
||||
const submitFeedback = (
|
||||
completionId: number,
|
||||
taskFeedbackRequest: TaskFeedbackRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/teacher/tasks/completions/${completionId}/feedback`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: taskFeedbackRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取模板详情
|
||||
*/
|
||||
@ -388,48 +428,6 @@ const deleteTeacher = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get task by ID
|
||||
*/
|
||||
const getTask1 = (
|
||||
id: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/tasks/${id}`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Update task
|
||||
*/
|
||||
const updateTask1 = (
|
||||
id: number,
|
||||
taskUpdateRequest: TaskUpdateRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/tasks/${id}`, method: 'PUT',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: taskUpdateRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Delete task
|
||||
*/
|
||||
const deleteTask1 = (
|
||||
id: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/tasks/${id}`, method: 'DELETE',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取模板详情
|
||||
*/
|
||||
@ -826,42 +824,32 @@ const removeClassTeacher = (
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get growth record by ID
|
||||
* @summary 修改任务提交
|
||||
*/
|
||||
const getGrowthRecord2 = (
|
||||
id: number,
|
||||
const updateSubmission = (
|
||||
taskId: number,
|
||||
taskSubmitRequest: TaskSubmitRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/growth-records/${id}`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Update growth record
|
||||
*/
|
||||
const updateGrowthRecord2 = (
|
||||
id: number,
|
||||
growthRecordUpdateRequest: GrowthRecordUpdateRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/growth-records/${id}`, method: 'PUT',
|
||||
{url: `/v1/parent/tasks/${taskId}/submit`, method: 'PUT',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: growthRecordUpdateRequest,
|
||||
data: taskSubmitRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Delete growth record
|
||||
* @summary 提交任务完成
|
||||
*/
|
||||
const deleteGrowthRecord2 = (
|
||||
id: number,
|
||||
const submitTask = (
|
||||
taskId: number,
|
||||
taskSubmitRequest: TaskSubmitRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/growth-records/${id}`, method: 'DELETE',
|
||||
{url: `/v1/parent/tasks/${taskId}/submit`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: taskSubmitRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
@ -1610,12 +1598,12 @@ const saveStudentRecord = (
|
||||
*/
|
||||
const batchSaveStudentRecords = (
|
||||
id: number,
|
||||
studentRecordRequest: StudentRecordRequest[],
|
||||
batchStudentRecordsRequest: BatchStudentRecordsRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/teacher/lessons/${id}/students/batch-records`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: studentRecordRequest,
|
||||
data: batchStudentRecordsRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
@ -1650,7 +1638,7 @@ const getLessonFeedback = (
|
||||
/**
|
||||
* @summary 提交课时反馈
|
||||
*/
|
||||
const submitFeedback = (
|
||||
const submitFeedback1 = (
|
||||
id: number,
|
||||
lessonFeedbackRequest: LessonFeedbackRequest,
|
||||
) => {
|
||||
@ -1778,40 +1766,9 @@ const createTeacher = (
|
||||
*/
|
||||
const resetPassword = (
|
||||
id: number,
|
||||
params: ResetPasswordParams,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/teachers/${id}/reset-password`, method: 'POST',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get task page
|
||||
*/
|
||||
const getTaskPage1 = (
|
||||
params?: GetTaskPage1Params,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/tasks`, method: 'GET',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Create task
|
||||
*/
|
||||
const createTask1 = (
|
||||
taskCreateRequest: TaskCreateRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/tasks`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: taskCreateRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
@ -2157,14 +2114,17 @@ const assignStudents = (
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Complete task
|
||||
* @summary 完成任务(旧接口,兼容使用,支持 JSON body)
|
||||
*/
|
||||
const completeTask = (
|
||||
id: number,
|
||||
params: CompleteTaskParams,
|
||||
taskCompleteRequest: TaskCompleteRequest,
|
||||
params?: CompleteTaskParams,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/tasks/${id}/complete`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: taskCompleteRequest,
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
@ -2197,21 +2157,6 @@ const markAllAsRead1 = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Create growth record
|
||||
*/
|
||||
const createGrowthRecord2 = (
|
||||
growthRecordCreateRequest: GrowthRecordCreateRequest,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/growth-records`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: growthRecordCreateRequest,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当 Token 即将过期时刷新
|
||||
* @summary 刷新 WebOffice Token
|
||||
@ -2723,6 +2668,34 @@ const getTodayLessons = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取任务完成情况列表
|
||||
*/
|
||||
const getTaskCompletions = (
|
||||
taskId: number,
|
||||
params?: GetTaskCompletionsParams,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/teacher/tasks/${taskId}/completions`, method: 'GET',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取提交详情
|
||||
*/
|
||||
const getCompletionDetail = (
|
||||
completionId: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/teacher/tasks/completions/${completionId}`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取默认模板
|
||||
*/
|
||||
@ -2941,10 +2914,11 @@ const getCourse = (
|
||||
* @summary 获取所有课程
|
||||
*/
|
||||
const getAllCourses = (
|
||||
|
||||
params?: GetAllCoursesParams,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/teacher/courses/all`, method: 'GET',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
@ -3191,6 +3165,75 @@ const getCourseReports = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取任务列表(支持多维度筛选)
|
||||
*/
|
||||
const getTaskList = (
|
||||
params?: GetTaskListParams,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/reading-tasks`, method: 'GET',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取任务详情
|
||||
*/
|
||||
const getTaskDetail = (
|
||||
taskId: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/reading-tasks/${taskId}`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取任务完成情况列表
|
||||
*/
|
||||
const getTaskCompletions1 = (
|
||||
taskId: number,
|
||||
params?: GetTaskCompletions1Params,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/reading-tasks/${taskId}/completions`, method: 'GET',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取统计数据
|
||||
*/
|
||||
const getStatistics = (
|
||||
params?: GetStatisticsParams,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/reading-tasks/statistics`, method: 'GET',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取学生提交详情
|
||||
*/
|
||||
const getCompletionDetail1 = (
|
||||
completionId: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/school/reading-tasks/completions/${completionId}`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get children of parent
|
||||
*/
|
||||
@ -3418,7 +3461,7 @@ const getSchoolCourse = (
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get my tasks
|
||||
* @summary 获取我的任务列表(聚合多孩子任务)
|
||||
*/
|
||||
const getMyTasks = (
|
||||
params?: GetMyTasksParams,
|
||||
@ -3432,9 +3475,9 @@ const getMyTasks = (
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get task by ID
|
||||
* @summary 获取任务详情
|
||||
*/
|
||||
const getTask2 = (
|
||||
const getTask1 = (
|
||||
id: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
@ -3445,7 +3488,7 @@ const getTask2 = (
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get tasks by student ID
|
||||
* @summary 获取孩子的任务列表(含完成信息与教师评价)
|
||||
*/
|
||||
const getTasksByStudent = (
|
||||
studentId: number,
|
||||
@ -3459,6 +3502,32 @@ const getTasksByStudent = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取提交详情
|
||||
*/
|
||||
const getCompletionDetail2 = (
|
||||
completionId: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/tasks/completions/${completionId}`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 获取教师评价
|
||||
*/
|
||||
const getFeedback = (
|
||||
completionId: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/tasks/completions/${completionId}/feedback`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get my notifications
|
||||
*/
|
||||
@ -3499,6 +3568,19 @@ const getUnreadCount1 = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get growth record by ID
|
||||
*/
|
||||
const getGrowthRecord2 = (
|
||||
id: number,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/growth-records/${id}`, method: 'GET',
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get growth records by student ID
|
||||
*/
|
||||
@ -3555,6 +3637,21 @@ const getChild = (
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get child lesson records (reading history)
|
||||
*/
|
||||
const getChildLessons = (
|
||||
id: number,
|
||||
params?: GetChildLessonsParams,
|
||||
) => {
|
||||
return customMutator<Blob>(
|
||||
{url: `/v1/parent/children/${id}/lessons`, method: 'GET',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get child growth records
|
||||
*/
|
||||
@ -3800,10 +3897,12 @@ const deleteFile = (
|
||||
);
|
||||
}
|
||||
|
||||
return {getTask,updateTask,deleteTask,getTemplate,updateTemplate,deleteTemplate,getSchedule,updateSchedule,cancelSchedule,getLesson,updateLesson,getLessonProgress,saveLessonProgress,getGrowthRecord,updateGrowthRecord,deleteGrowthRecord,getTeacher,updateTeacher,deleteTeacher,getTask1,updateTask1,deleteTask1,getTemplate1,updateTemplate1,deleteTemplate1,getStudent,updateStudent,deleteStudent,getSettings,updateSettings,getSecuritySettings,updateSecuritySettings,getNotificationSettings,updateNotificationSettings,getBasicSettings,updateBasicSettings,getSchedule1,updateSchedule1,cancelSchedule1,getParent,updateParent,deleteParent,getGrowthRecord1,updateGrowthRecord1,deleteGrowthRecord1,getClass,updateClass,deleteClass,updateClassTeacher,removeClassTeacher,getGrowthRecord2,updateGrowthRecord2,deleteGrowthRecord2,findOne,update,_delete,reorder,getTenant,updateTenant,deleteTenant,updateTenantStatus,updateTenantQuota,getAllSettings,updateSettings1,getStorageSettings,updateStorageSettings,getSecuritySettings1,updateSecuritySettings1,getNotificationSettings1,updateNotificationSettings1,getBasicSettings1,updateBasicSettings1,findLibrary,updateLibrary,deleteLibrary,findItem,updateItem,deleteItem,getCourse1,updateCourse,deleteCourse,reorderSteps,findOne1,update1,delete1,updateStep,removeStep,reorder1,findOne2,update2,delete2,setPackages,getTaskPage,createTask,getTemplates,createTemplate,createFromTemplate,getSchedules,createSchedule,markAsRead,markAllAsRead,getMyLessons,createLesson,saveStudentRecord,batchSaveStudentRecords,startLesson,getLessonFeedback,submitFeedback,completeLesson,cancelLesson,createLessonFromSchedule,startLessonFromSchedule,getGrowthRecordPage,createGrowthRecord,getTeacherPage,createTeacher,resetPassword,getTaskPage1,createTask1,getTemplates1,createTemplate1,getStudentPage,createStudent,getSchedules1,createSchedule1,checkConflict,batchCreateSchedules,createSchedulesByClasses,getParentPage,createParent,bindStudent,unbindStudent,resetPassword1,renewCollection,getGrowthRecordPage1,createGrowthRecord1,getClassPage,createClass,getClassTeachers1,assignTeachers,getClassStudents1,assignStudents,completeTask,markAsRead1,markAllAsRead1,createGrowthRecord2,refreshToken,uploadFile,refreshToken1,logout,login,changePassword,findAll,create,getTenantPage,createTenant,resetTenantPassword,findAllLibraries,createLibrary,findAllItems,createItem,batchDeleteItems,getCoursePage1,createCourse,submitCourse,rejectCourse,publishCourse,archiveCourse,findAll1,create1,findSteps,createStep,page,create2,withdraw,submit,republish,reject,publish,archive,getWeeklyStats,getTodayLessons,getDefaultTemplate,getAllStudents,getTodaySchedules,getTimetable,getRecommendedCourses,getMyNotifications,getNotification,getUnreadCount,getStudentRecords,getTodayLessons1,getLessonTrend,getFeedbacks,getFeedbackStats,getDashboard,getCoursePage,getCourse,getAllCourses,getCourseUsage,getClasses,getClassTeachers,getClassStudents,getDefaultTemplate1,getSchoolStats,getActiveTeachers,getLessonTrend1,getCourseUsageStats,getCourseDistribution,getRecentActivities,getTimetable1,getCoursePackageLessonTypes,getCalendarViewData,getTeacherReports,getStudentReports,getOverview,getCourseReports,getParentChildren,findTenantCollections,getPackagesByCollection,getPackageCourses,getPackageInfo,getPackageUsage,getLogList,getLogDetail,getLogStats,getFeedbacks1,getFeedbackStats1,exportTeacherStats,exportStudentStats,exportLessons,exportGrowthRecords,getSchoolCourses,getSchoolCourse,getMyTasks,getTask2,getTasksByStudent,getMyNotifications1,getNotification1,getUnreadCount1,getGrowthRecordsByStudent,getRecentGrowthRecords,getMyChildren,getChild,getChildGrowth,generateEditToken,generateReadOnlyToken,getOssToken,getCurrentUser,getTenantStats,getAllActiveTenants,getStats,getTrendData,getActiveTenants,getPopularCourses,getRecentActivities1,getTenantDefaults,getStats1,getAllPublishedCourses,findByType,getAllPublishedCollections,deleteFile}};
|
||||
return {getTask,updateTask,deleteTask,updateFeedback,submitFeedback,getTemplate,updateTemplate,deleteTemplate,getSchedule,updateSchedule,cancelSchedule,getLesson,updateLesson,getLessonProgress,saveLessonProgress,getGrowthRecord,updateGrowthRecord,deleteGrowthRecord,getTeacher,updateTeacher,deleteTeacher,getTemplate1,updateTemplate1,deleteTemplate1,getStudent,updateStudent,deleteStudent,getSettings,updateSettings,getSecuritySettings,updateSecuritySettings,getNotificationSettings,updateNotificationSettings,getBasicSettings,updateBasicSettings,getSchedule1,updateSchedule1,cancelSchedule1,getParent,updateParent,deleteParent,getGrowthRecord1,updateGrowthRecord1,deleteGrowthRecord1,getClass,updateClass,deleteClass,updateClassTeacher,removeClassTeacher,updateSubmission,submitTask,findOne,update,_delete,reorder,getTenant,updateTenant,deleteTenant,updateTenantStatus,updateTenantQuota,getAllSettings,updateSettings1,getStorageSettings,updateStorageSettings,getSecuritySettings1,updateSecuritySettings1,getNotificationSettings1,updateNotificationSettings1,getBasicSettings1,updateBasicSettings1,findLibrary,updateLibrary,deleteLibrary,findItem,updateItem,deleteItem,getCourse1,updateCourse,deleteCourse,reorderSteps,findOne1,update1,delete1,updateStep,removeStep,reorder1,findOne2,update2,delete2,setPackages,getTaskPage,createTask,getTemplates,createTemplate,createFromTemplate,getSchedules,createSchedule,markAsRead,markAllAsRead,getMyLessons,createLesson,saveStudentRecord,batchSaveStudentRecords,startLesson,getLessonFeedback,submitFeedback1,completeLesson,cancelLesson,createLessonFromSchedule,startLessonFromSchedule,getGrowthRecordPage,createGrowthRecord,getTeacherPage,createTeacher,resetPassword,getTemplates1,createTemplate1,getStudentPage,createStudent,getSchedules1,createSchedule1,checkConflict,batchCreateSchedules,createSchedulesByClasses,getParentPage,createParent,bindStudent,unbindStudent,resetPassword1,renewCollection,getGrowthRecordPage1,createGrowthRecord1,getClassPage,createClass,getClassTeachers1,assignTeachers,getClassStudents1,assignStudents,completeTask,markAsRead1,markAllAsRead1,refreshToken,uploadFile,refreshToken1,logout,login,changePassword,findAll,create,getTenantPage,createTenant,resetTenantPassword,findAllLibraries,createLibrary,findAllItems,createItem,batchDeleteItems,getCoursePage1,createCourse,submitCourse,rejectCourse,publishCourse,archiveCourse,findAll1,create1,findSteps,createStep,page,create2,withdraw,submit,republish,reject,publish,archive,getWeeklyStats,getTodayLessons,getTaskCompletions,getCompletionDetail,getDefaultTemplate,getAllStudents,getTodaySchedules,getTimetable,getRecommendedCourses,getMyNotifications,getNotification,getUnreadCount,getStudentRecords,getTodayLessons1,getLessonTrend,getFeedbacks,getFeedbackStats,getDashboard,getCoursePage,getCourse,getAllCourses,getCourseUsage,getClasses,getClassTeachers,getClassStudents,getDefaultTemplate1,getSchoolStats,getActiveTeachers,getLessonTrend1,getCourseUsageStats,getCourseDistribution,getRecentActivities,getTimetable1,getCoursePackageLessonTypes,getCalendarViewData,getTeacherReports,getStudentReports,getOverview,getCourseReports,getTaskList,getTaskDetail,getTaskCompletions1,getStatistics,getCompletionDetail1,getParentChildren,findTenantCollections,getPackagesByCollection,getPackageCourses,getPackageInfo,getPackageUsage,getLogList,getLogDetail,getLogStats,getFeedbacks1,getFeedbackStats1,exportTeacherStats,exportStudentStats,exportLessons,exportGrowthRecords,getSchoolCourses,getSchoolCourse,getMyTasks,getTask1,getTasksByStudent,getCompletionDetail2,getFeedback,getMyNotifications1,getNotification1,getUnreadCount1,getGrowthRecord2,getGrowthRecordsByStudent,getRecentGrowthRecords,getMyChildren,getChild,getChildLessons,getChildGrowth,generateEditToken,generateReadOnlyToken,getOssToken,getCurrentUser,getTenantStats,getAllActiveTenants,getStats,getTrendData,getActiveTenants,getPopularCourses,getRecentActivities1,getTenantDefaults,getStats1,getAllPublishedCourses,findByType,getAllPublishedCollections,deleteFile}};
|
||||
export type GetTaskResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTask']>>>
|
||||
export type UpdateTaskResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateTask']>>>
|
||||
export type DeleteTaskResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['deleteTask']>>>
|
||||
export type UpdateFeedbackResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateFeedback']>>>
|
||||
export type SubmitFeedbackResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['submitFeedback']>>>
|
||||
export type GetTemplateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTemplate']>>>
|
||||
export type UpdateTemplateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateTemplate']>>>
|
||||
export type DeleteTemplateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['deleteTemplate']>>>
|
||||
@ -3820,9 +3919,6 @@ export type DeleteGrowthRecordResult = NonNullable<Awaited<ReturnType<ReturnType
|
||||
export type GetTeacherResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTeacher']>>>
|
||||
export type UpdateTeacherResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateTeacher']>>>
|
||||
export type DeleteTeacherResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['deleteTeacher']>>>
|
||||
export type GetTask1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTask1']>>>
|
||||
export type UpdateTask1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateTask1']>>>
|
||||
export type DeleteTask1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['deleteTask1']>>>
|
||||
export type GetTemplate1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTemplate1']>>>
|
||||
export type UpdateTemplate1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateTemplate1']>>>
|
||||
export type DeleteTemplate1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['deleteTemplate1']>>>
|
||||
@ -3851,9 +3947,8 @@ export type UpdateClassResult = NonNullable<Awaited<ReturnType<ReturnType<typeof
|
||||
export type DeleteClassResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['deleteClass']>>>
|
||||
export type UpdateClassTeacherResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateClassTeacher']>>>
|
||||
export type RemoveClassTeacherResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['removeClassTeacher']>>>
|
||||
export type GetGrowthRecord2Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getGrowthRecord2']>>>
|
||||
export type UpdateGrowthRecord2Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateGrowthRecord2']>>>
|
||||
export type DeleteGrowthRecord2Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['deleteGrowthRecord2']>>>
|
||||
export type UpdateSubmissionResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['updateSubmission']>>>
|
||||
export type SubmitTaskResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['submitTask']>>>
|
||||
export type FindOneResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['findOne']>>>
|
||||
export type UpdateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['update']>>>
|
||||
export type _DeleteResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['_delete']>>>
|
||||
@ -3908,7 +4003,7 @@ export type SaveStudentRecordResult = NonNullable<Awaited<ReturnType<ReturnType<
|
||||
export type BatchSaveStudentRecordsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['batchSaveStudentRecords']>>>
|
||||
export type StartLessonResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['startLesson']>>>
|
||||
export type GetLessonFeedbackResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getLessonFeedback']>>>
|
||||
export type SubmitFeedbackResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['submitFeedback']>>>
|
||||
export type SubmitFeedback1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['submitFeedback1']>>>
|
||||
export type CompleteLessonResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['completeLesson']>>>
|
||||
export type CancelLessonResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['cancelLesson']>>>
|
||||
export type CreateLessonFromScheduleResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['createLessonFromSchedule']>>>
|
||||
@ -3918,8 +4013,6 @@ export type CreateGrowthRecordResult = NonNullable<Awaited<ReturnType<ReturnType
|
||||
export type GetTeacherPageResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTeacherPage']>>>
|
||||
export type CreateTeacherResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['createTeacher']>>>
|
||||
export type ResetPasswordResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['resetPassword']>>>
|
||||
export type GetTaskPage1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTaskPage1']>>>
|
||||
export type CreateTask1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['createTask1']>>>
|
||||
export type GetTemplates1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTemplates1']>>>
|
||||
export type CreateTemplate1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['createTemplate1']>>>
|
||||
export type GetStudentPageResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getStudentPage']>>>
|
||||
@ -3946,7 +4039,6 @@ export type AssignStudentsResult = NonNullable<Awaited<ReturnType<ReturnType<typ
|
||||
export type CompleteTaskResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['completeTask']>>>
|
||||
export type MarkAsRead1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['markAsRead1']>>>
|
||||
export type MarkAllAsRead1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['markAllAsRead1']>>>
|
||||
export type CreateGrowthRecord2Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['createGrowthRecord2']>>>
|
||||
export type RefreshTokenResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['refreshToken']>>>
|
||||
export type UploadFileResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['uploadFile']>>>
|
||||
export type RefreshToken1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['refreshToken1']>>>
|
||||
@ -3983,6 +4075,8 @@ export type PublishResult = NonNullable<Awaited<ReturnType<ReturnType<typeof get
|
||||
export type ArchiveResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['archive']>>>
|
||||
export type GetWeeklyStatsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getWeeklyStats']>>>
|
||||
export type GetTodayLessonsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTodayLessons']>>>
|
||||
export type GetTaskCompletionsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTaskCompletions']>>>
|
||||
export type GetCompletionDetailResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getCompletionDetail']>>>
|
||||
export type GetDefaultTemplateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getDefaultTemplate']>>>
|
||||
export type GetAllStudentsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getAllStudents']>>>
|
||||
export type GetTodaySchedulesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTodaySchedules']>>>
|
||||
@ -4018,6 +4112,11 @@ export type GetTeacherReportsResult = NonNullable<Awaited<ReturnType<ReturnType<
|
||||
export type GetStudentReportsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getStudentReports']>>>
|
||||
export type GetOverviewResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getOverview']>>>
|
||||
export type GetCourseReportsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getCourseReports']>>>
|
||||
export type GetTaskListResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTaskList']>>>
|
||||
export type GetTaskDetailResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTaskDetail']>>>
|
||||
export type GetTaskCompletions1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTaskCompletions1']>>>
|
||||
export type GetStatisticsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getStatistics']>>>
|
||||
export type GetCompletionDetail1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getCompletionDetail1']>>>
|
||||
export type GetParentChildrenResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getParentChildren']>>>
|
||||
export type FindTenantCollectionsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['findTenantCollections']>>>
|
||||
export type GetPackagesByCollectionResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getPackagesByCollection']>>>
|
||||
@ -4036,15 +4135,19 @@ export type ExportGrowthRecordsResult = NonNullable<Awaited<ReturnType<ReturnTyp
|
||||
export type GetSchoolCoursesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getSchoolCourses']>>>
|
||||
export type GetSchoolCourseResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getSchoolCourse']>>>
|
||||
export type GetMyTasksResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getMyTasks']>>>
|
||||
export type GetTask2Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTask2']>>>
|
||||
export type GetTask1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTask1']>>>
|
||||
export type GetTasksByStudentResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getTasksByStudent']>>>
|
||||
export type GetCompletionDetail2Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getCompletionDetail2']>>>
|
||||
export type GetFeedbackResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getFeedback']>>>
|
||||
export type GetMyNotifications1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getMyNotifications1']>>>
|
||||
export type GetNotification1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getNotification1']>>>
|
||||
export type GetUnreadCount1Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getUnreadCount1']>>>
|
||||
export type GetGrowthRecord2Result = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getGrowthRecord2']>>>
|
||||
export type GetGrowthRecordsByStudentResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getGrowthRecordsByStudent']>>>
|
||||
export type GetRecentGrowthRecordsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getRecentGrowthRecords']>>>
|
||||
export type GetMyChildrenResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getMyChildren']>>>
|
||||
export type GetChildResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getChild']>>>
|
||||
export type GetChildLessonsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getChildLessons']>>>
|
||||
export type GetChildGrowthResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['getChildGrowth']>>>
|
||||
export type GenerateEditTokenResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['generateEditToken']>>>
|
||||
export type GenerateReadOnlyTokenResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getReadingPlatformAPI>['generateReadOnlyToken']>>>
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { StudentRecordRequest } from './studentRecordRequest';
|
||||
|
||||
/**
|
||||
* 批量保存学生记录请求
|
||||
*/
|
||||
export interface BatchStudentRecordsRequest {
|
||||
/** 记录列表 */
|
||||
records: StudentRecordRequest[];
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { ClassInfo } from './classInfo';
|
||||
|
||||
/**
|
||||
* 家长端孩子列表响应
|
||||
*/
|
||||
export interface ChildInfoResponse {
|
||||
/** 学生ID */
|
||||
id?: number;
|
||||
/** 姓名 */
|
||||
name?: string;
|
||||
/** 性别 */
|
||||
gender?: string;
|
||||
/** 出生日期 */
|
||||
birthDate?: string;
|
||||
/** 与家长关系:FATHER/MOTHER/GRANDFATHER/GRANDMOTHER/OTHER */
|
||||
relationship?: string;
|
||||
/** 阅读次数(student_record 数量) */
|
||||
readingCount?: number;
|
||||
/** 上课次数(lesson 记录数) */
|
||||
lessonCount?: number;
|
||||
class?: ClassInfo;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { ClassInfo } from './classInfo';
|
||||
import type { StatsInfo } from './statsInfo';
|
||||
|
||||
/**
|
||||
* 家长端孩子详情响应
|
||||
*/
|
||||
export interface ChildProfileResponse {
|
||||
/** 学生ID */
|
||||
id?: number;
|
||||
/** 姓名 */
|
||||
name?: string;
|
||||
/** 性别 */
|
||||
gender?: string;
|
||||
/** 出生日期 */
|
||||
birthDate?: string;
|
||||
/** 与家长关系 */
|
||||
relationship?: string;
|
||||
/** 阅读次数 */
|
||||
readingCount?: number;
|
||||
/** 上课次数 */
|
||||
lessonCount?: number;
|
||||
stats?: StatsInfo;
|
||||
class?: ClassInfo;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 班级信息
|
||||
*/
|
||||
export interface ClassInfo {
|
||||
/** 班级ID */
|
||||
id?: number;
|
||||
/** 班级名称 */
|
||||
name?: string;
|
||||
/** 年级 */
|
||||
grade?: string;
|
||||
}
|
||||
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
export type CompleteTaskParams = {
|
||||
studentId: number;
|
||||
studentId?: number;
|
||||
content?: string;
|
||||
attachments?: string;
|
||||
};
|
||||
|
||||
@ -16,4 +16,6 @@ export interface CourseCollectionPageQueryRequest {
|
||||
pageSize?: number;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 年级(支持多个,逗号分隔) */
|
||||
gradeLevels?: string;
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 关联课程信息
|
||||
*/
|
||||
export interface CourseInfo {
|
||||
/** 课程ID */
|
||||
id?: number;
|
||||
/** 课程名称 */
|
||||
name?: string;
|
||||
}
|
||||
@ -20,6 +20,8 @@ export interface CoursePageQueryRequest {
|
||||
category?: string;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 年级(支持多个,逗号分隔) */
|
||||
gradeTags?: string;
|
||||
/** 是否仅查询待审核 */
|
||||
reviewOnly?: boolean;
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { CourseLessonResponse } from './courseLessonResponse';
|
||||
import type { LessonTagResponse } from './lessonTagResponse';
|
||||
|
||||
/**
|
||||
* 课程响应
|
||||
@ -89,10 +90,10 @@ export interface CourseResponse {
|
||||
activitiesData?: string;
|
||||
/** 评估数据 */
|
||||
assessmentData?: string;
|
||||
/** 年级标签 */
|
||||
gradeTags?: string;
|
||||
/** 领域标签 */
|
||||
domainTags?: string;
|
||||
/** 年级标签(规范为数组,与套餐管理适用年级对齐) */
|
||||
gradeTags?: string[];
|
||||
/** 领域标签(规范为数组) */
|
||||
domainTags?: string[];
|
||||
/** 是否有集体课 */
|
||||
hasCollectiveLesson?: number;
|
||||
/** 版本号 */
|
||||
@ -129,4 +130,6 @@ export interface CourseResponse {
|
||||
updatedAt?: string;
|
||||
/** 关联的课程环节 */
|
||||
courseLessons?: CourseLessonResponse[];
|
||||
/** 课程环节标签(列表展示用,仅 name 和 lessonType) */
|
||||
lessonTags?: LessonTagResponse[];
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@ export interface DayScheduleItem {
|
||||
className?: string;
|
||||
/** 课程包名称 */
|
||||
coursePackageName?: string;
|
||||
/** 课程类型代码 (如 DOMAIN_HEALTH) */
|
||||
lessonType?: string;
|
||||
/** 课程类型名称 */
|
||||
lessonTypeName?: string;
|
||||
/** 教师名称 */
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
export type GetAllCoursesParams = {
|
||||
keyword?: string;
|
||||
grade?: string;
|
||||
domain?: string;
|
||||
};
|
||||
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
export type GetChildLessonsParams = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
};
|
||||
@ -10,5 +10,7 @@ export type GetCoursePageParams = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
keyword?: string;
|
||||
category?: string;
|
||||
grade?: string;
|
||||
domain?: string;
|
||||
lessonType?: string;
|
||||
};
|
||||
|
||||
@ -10,4 +10,5 @@ export type GetMyNotifications1Params = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
isRead?: number;
|
||||
notificationType?: string;
|
||||
};
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
export type GetStatisticsParams = {
|
||||
dateType?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
};
|
||||
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
export type GetTaskCompletions1Params = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
status?: string;
|
||||
};
|
||||
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
export type GetTaskCompletionsParams = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
status?: string;
|
||||
};
|
||||
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
export type GetTaskListParams = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
keyword?: string;
|
||||
type?: string;
|
||||
status?: string;
|
||||
classIds?: number[];
|
||||
teacherIds?: number[];
|
||||
dateType?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
completionRate?: string;
|
||||
sortBy?: string;
|
||||
sortOrder?: string;
|
||||
};
|
||||
@ -11,5 +11,6 @@ pageNum?: number;
|
||||
pageSize?: number;
|
||||
keyword?: string;
|
||||
type?: string;
|
||||
taskType?: string;
|
||||
status?: string;
|
||||
};
|
||||
|
||||
@ -10,4 +10,6 @@ export type GetTemplates1Params = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
type?: string;
|
||||
taskType?: string;
|
||||
keyword?: string;
|
||||
};
|
||||
|
||||
@ -10,4 +10,5 @@ export type GetTemplatesParams = {
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
type?: string;
|
||||
keyword?: string;
|
||||
};
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { ClassInfo } from './classInfo';
|
||||
|
||||
/**
|
||||
* 家长端成长档案响应
|
||||
*/
|
||||
export interface GrowthRecordForParentResponse {
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 标题 */
|
||||
title?: string;
|
||||
/** 内容 */
|
||||
content?: string;
|
||||
/** 图片URL列表 */
|
||||
images?: string[];
|
||||
/** 记录日期 */
|
||||
recordDate?: string;
|
||||
/** 记录类型 */
|
||||
recordType?: string;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
class?: ClassInfo;
|
||||
}
|
||||
@ -20,12 +20,16 @@ export * from './basicSettingsUpdateRequest';
|
||||
export * from './batchCreateSchedulesBody';
|
||||
export * from './batchStudentRecordsDto';
|
||||
export * from './batchStudentRecordsDtoRecordsItem';
|
||||
export * from './batchStudentRecordsRequest';
|
||||
export * from './bindStudentParams';
|
||||
export * from './calendarViewResponse';
|
||||
export * from './calendarViewResponseSchedules';
|
||||
export * from './changePasswordParams';
|
||||
export * from './checkConflictParams';
|
||||
export * from './childInfoResponse';
|
||||
export * from './childProfileResponse';
|
||||
export * from './classCreateRequest';
|
||||
export * from './classInfo';
|
||||
export * from './classResponse';
|
||||
export * from './classTeacherResponse';
|
||||
export * from './classUpdateRequest';
|
||||
@ -40,6 +44,7 @@ export * from './courseCollectionResponse';
|
||||
export * from './courseControllerFindAllParams';
|
||||
export * from './courseControllerGetReviewListParams';
|
||||
export * from './courseCreateRequest';
|
||||
export * from './courseInfo';
|
||||
export * from './courseLesson';
|
||||
export * from './courseLessonCreateRequest';
|
||||
export * from './courseLessonResponse';
|
||||
@ -95,8 +100,10 @@ export * from './getActiveTeachersParams';
|
||||
export * from './getActiveTenants200';
|
||||
export * from './getActiveTenants200DataItem';
|
||||
export * from './getActiveTenantsParams';
|
||||
export * from './getAllCoursesParams';
|
||||
export * from './getAllStudentsParams';
|
||||
export * from './getCalendarViewDataParams';
|
||||
export * from './getChildLessonsParams';
|
||||
export * from './getClassPageParams';
|
||||
export * from './getClassStudents1Params';
|
||||
export * from './getClassStudentsParams';
|
||||
@ -127,7 +134,11 @@ export * from './getRecentGrowthRecordsParams';
|
||||
export * from './getSchedules1Params';
|
||||
export * from './getSchedulesParams';
|
||||
export * from './getSchoolCoursesParams';
|
||||
export * from './getStatisticsParams';
|
||||
export * from './getStudentPageParams';
|
||||
export * from './getTaskCompletions1Params';
|
||||
export * from './getTaskCompletionsParams';
|
||||
export * from './getTaskListParams';
|
||||
export * from './getTaskPage1Params';
|
||||
export * from './getTaskPageParams';
|
||||
export * from './getTasksByStudentParams';
|
||||
@ -141,6 +152,7 @@ export * from './grantCollectionRequest';
|
||||
export * from './grantRequest';
|
||||
export * from './growthRecord';
|
||||
export * from './growthRecordCreateRequest';
|
||||
export * from './growthRecordForParentResponse';
|
||||
export * from './growthRecordResponse';
|
||||
export * from './growthRecordUpdateRequest';
|
||||
export * from './immTokenVo';
|
||||
@ -156,14 +168,17 @@ export * from './lessonFeedbackDtoActivitiesDone';
|
||||
export * from './lessonFeedbackDtoStepFeedbacks';
|
||||
export * from './lessonFeedbackRequest';
|
||||
export * from './lessonFeedbackResponse';
|
||||
export * from './lessonInfo';
|
||||
export * from './lessonProgressDto';
|
||||
export * from './lessonProgressDtoProgressData';
|
||||
export * from './lessonProgressRequest';
|
||||
export * from './lessonProgressRequestProgressData';
|
||||
export * from './lessonRecordResponse';
|
||||
export * from './lessonResponse';
|
||||
export * from './lessonStep';
|
||||
export * from './lessonStepCreateRequest';
|
||||
export * from './lessonStepResponse';
|
||||
export * from './lessonTagResponse';
|
||||
export * from './lessonTypeInfo';
|
||||
export * from './lessonUpdateRequest';
|
||||
export * from './libraryCreateRequest';
|
||||
@ -174,6 +189,7 @@ export * from './loginDto';
|
||||
export * from './loginRequest';
|
||||
export * from './loginResponse';
|
||||
export * from './notification';
|
||||
export * from './notificationForParentResponse';
|
||||
export * from './notificationResponse';
|
||||
export * from './notificationSettingsResponse';
|
||||
export * from './notificationSettingsUpdateRequest';
|
||||
@ -197,11 +213,14 @@ export * from './pageResultCourseCollectionResponse';
|
||||
export * from './pageResultCoursePackageResponse';
|
||||
export * from './pageResultCourseResponse';
|
||||
export * from './pageResultGrowthRecord';
|
||||
export * from './pageResultGrowthRecordForParentResponse';
|
||||
export * from './pageResultGrowthRecordResponse';
|
||||
export * from './pageResultLesson';
|
||||
export * from './pageResultLessonFeedbackResponse';
|
||||
export * from './pageResultLessonRecordResponse';
|
||||
export * from './pageResultLessonResponse';
|
||||
export * from './pageResultNotification';
|
||||
export * from './pageResultNotificationForParentResponse';
|
||||
export * from './pageResultNotificationResponse';
|
||||
export * from './pageResultOperationLogResponse';
|
||||
export * from './pageResultParent';
|
||||
@ -211,11 +230,14 @@ export * from './pageResultResourceItemResponse';
|
||||
export * from './pageResultResourceLibrary';
|
||||
export * from './pageResultResourceLibraryResponse';
|
||||
export * from './pageResultSchedulePlanResponse';
|
||||
export * from './pageResultSchoolCourseResponse';
|
||||
export * from './pageResultStudent';
|
||||
export * from './pageResultStudentResponse';
|
||||
export * from './pageResultTask';
|
||||
export * from './pageResultTaskCompletionDetailResponse';
|
||||
export * from './pageResultTaskResponse';
|
||||
export * from './pageResultTaskTemplateResponse';
|
||||
export * from './pageResultTaskWithCompletionResponse';
|
||||
export * from './pageResultTeacher';
|
||||
export * from './pageResultTeacherResponse';
|
||||
export * from './pageResultTenant';
|
||||
@ -247,6 +269,7 @@ export * from './resourceLibraryResponse';
|
||||
export * from './resourceLibraryUpdateRequest';
|
||||
export * from './resultBasicSettingsResponse';
|
||||
export * from './resultCalendarViewResponse';
|
||||
export * from './resultChildProfileResponse';
|
||||
export * from './resultClassResponse';
|
||||
export * from './resultClazz';
|
||||
export * from './resultConflictCheckResult';
|
||||
@ -260,6 +283,7 @@ export * from './resultCourseResponse';
|
||||
export * from './resultDto';
|
||||
export * from './resultDtoData';
|
||||
export * from './resultGrowthRecord';
|
||||
export * from './resultGrowthRecordForParentResponse';
|
||||
export * from './resultGrowthRecordResponse';
|
||||
export * from './resultImmTokenVo';
|
||||
export * from './resultLesson';
|
||||
@ -269,6 +293,7 @@ export * from './resultLessonResponse';
|
||||
export * from './resultLessonStep';
|
||||
export * from './resultLessonStepResponse';
|
||||
export * from './resultListActiveTenantItemResponse';
|
||||
export * from './resultListChildInfoResponse';
|
||||
export * from './resultListClassResponse';
|
||||
export * from './resultListClassTeacherResponse';
|
||||
export * from './resultListClazz';
|
||||
@ -281,6 +306,7 @@ export * from './resultListCoursePackageResponse';
|
||||
export * from './resultListCourseReportResponse';
|
||||
export * from './resultListCourseResponse';
|
||||
export * from './resultListGrowthRecord';
|
||||
export * from './resultListGrowthRecordForParentResponse';
|
||||
export * from './resultListGrowthRecordResponse';
|
||||
export * from './resultListLesson';
|
||||
export * from './resultListLessonResponse';
|
||||
@ -308,7 +334,10 @@ export * from './resultLoginResponse';
|
||||
export * from './resultLong';
|
||||
export * from './resultMapStringObject';
|
||||
export * from './resultMapStringObjectData';
|
||||
export * from './resultMapStringString';
|
||||
export * from './resultMapStringStringData';
|
||||
export * from './resultNotification';
|
||||
export * from './resultNotificationForParentResponse';
|
||||
export * from './resultNotificationResponse';
|
||||
export * from './resultNotificationSettingsResponse';
|
||||
export * from './resultObject';
|
||||
@ -327,11 +356,14 @@ export * from './resultPageResultCourseCollectionResponse';
|
||||
export * from './resultPageResultCoursePackageResponse';
|
||||
export * from './resultPageResultCourseResponse';
|
||||
export * from './resultPageResultGrowthRecord';
|
||||
export * from './resultPageResultGrowthRecordForParentResponse';
|
||||
export * from './resultPageResultGrowthRecordResponse';
|
||||
export * from './resultPageResultLesson';
|
||||
export * from './resultPageResultLessonFeedbackResponse';
|
||||
export * from './resultPageResultLessonRecordResponse';
|
||||
export * from './resultPageResultLessonResponse';
|
||||
export * from './resultPageResultNotification';
|
||||
export * from './resultPageResultNotificationForParentResponse';
|
||||
export * from './resultPageResultNotificationResponse';
|
||||
export * from './resultPageResultOperationLogResponse';
|
||||
export * from './resultPageResultParent';
|
||||
@ -341,11 +373,14 @@ export * from './resultPageResultResourceItemResponse';
|
||||
export * from './resultPageResultResourceLibrary';
|
||||
export * from './resultPageResultResourceLibraryResponse';
|
||||
export * from './resultPageResultSchedulePlanResponse';
|
||||
export * from './resultPageResultSchoolCourseResponse';
|
||||
export * from './resultPageResultStudent';
|
||||
export * from './resultPageResultStudentResponse';
|
||||
export * from './resultPageResultTask';
|
||||
export * from './resultPageResultTaskCompletionDetailResponse';
|
||||
export * from './resultPageResultTaskResponse';
|
||||
export * from './resultPageResultTaskTemplateResponse';
|
||||
export * from './resultPageResultTaskWithCompletionResponse';
|
||||
export * from './resultPageResultTeacher';
|
||||
export * from './resultPageResultTeacherResponse';
|
||||
export * from './resultPageResultTenant';
|
||||
@ -358,6 +393,7 @@ export * from './resultResourceItemResponse';
|
||||
export * from './resultResourceLibrary';
|
||||
export * from './resultResourceLibraryResponse';
|
||||
export * from './resultSchedulePlanResponse';
|
||||
export * from './resultSchoolCourseResponse';
|
||||
export * from './resultSchoolSettingsResponse';
|
||||
export * from './resultSecuritySettingsResponse';
|
||||
export * from './resultStatsResponse';
|
||||
@ -365,8 +401,11 @@ export * from './resultStatsTrendResponse';
|
||||
export * from './resultString';
|
||||
export * from './resultStudent';
|
||||
export * from './resultStudentRecordResponse';
|
||||
export * from './resultStudentRecordsResponse';
|
||||
export * from './resultStudentResponse';
|
||||
export * from './resultTask';
|
||||
export * from './resultTaskCompletionDetailResponse';
|
||||
export * from './resultTaskFeedbackResponse';
|
||||
export * from './resultTaskResponse';
|
||||
export * from './resultTaskTemplateResponse';
|
||||
export * from './resultTeacher';
|
||||
@ -387,6 +426,7 @@ export * from './schedulePlanCreateRequest';
|
||||
export * from './schedulePlanResponse';
|
||||
export * from './schedulePlanUpdateRequest';
|
||||
export * from './schoolControllerImportStudentsParams';
|
||||
export * from './schoolCourseResponse';
|
||||
export * from './schoolFeedbackControllerFindAllParams';
|
||||
export * from './schoolSettingsResponse';
|
||||
export * from './schoolSettingsUpdateRequest';
|
||||
@ -396,24 +436,35 @@ export * from './securitySettingsUpdateRequest';
|
||||
export * from './statsControllerGetActiveTeachersParams';
|
||||
export * from './statsControllerGetLessonTrendParams';
|
||||
export * from './statsControllerGetRecentActivitiesParams';
|
||||
export * from './statsInfo';
|
||||
export * from './statsResponse';
|
||||
export * from './statsTrendResponse';
|
||||
export * from './stepCreateRequest';
|
||||
export * from './student';
|
||||
export * from './studentCreateRequest';
|
||||
export * from './studentInfo';
|
||||
export * from './studentRecordDto';
|
||||
export * from './studentRecordRequest';
|
||||
export * from './studentRecordResponse';
|
||||
export * from './studentRecordsResponse';
|
||||
export * from './studentReportResponse';
|
||||
export * from './studentResponse';
|
||||
export * from './studentUpdateRequest';
|
||||
export * from './studentWithRecordResponse';
|
||||
export * from './submitCourseDto';
|
||||
export * from './task';
|
||||
export * from './taskCompleteRequest';
|
||||
export * from './taskCompletionDetailResponse';
|
||||
export * from './taskCreateRequest';
|
||||
export * from './taskFeedbackRequest';
|
||||
export * from './taskFeedbackResponse';
|
||||
export * from './taskInfo';
|
||||
export * from './taskResponse';
|
||||
export * from './taskSubmitRequest';
|
||||
export * from './taskTemplateCreateRequest';
|
||||
export * from './taskTemplateResponse';
|
||||
export * from './taskUpdateRequest';
|
||||
export * from './taskWithCompletionResponse';
|
||||
export * from './teacher';
|
||||
export * from './teacherCourseControllerFindAllParams';
|
||||
export * from './teacherCourseControllerGetAllStudentsParams';
|
||||
@ -425,6 +476,7 @@ export * from './teacherCreateRequest';
|
||||
export * from './teacherFeedbackControllerFindAllParams';
|
||||
export * from './teacherReportResponse';
|
||||
export * from './teacherResponse';
|
||||
export * from './teacherResponseClassNames';
|
||||
export * from './teacherTaskControllerGetMonthlyStatsParams';
|
||||
export * from './teacherUpdateRequest';
|
||||
export * from './tenant';
|
||||
|
||||
@ -15,7 +15,7 @@ import type { LessonResponse } from './lessonResponse';
|
||||
export interface LessonDetailResponse {
|
||||
lesson?: LessonResponse;
|
||||
course?: CourseResponse;
|
||||
class?: ClassResponse;
|
||||
/** 排课选择的课程类型(子课程模式时用于直接进入对应子课程) */
|
||||
lessonType?: string;
|
||||
class?: ClassResponse;
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 课时简要信息
|
||||
*/
|
||||
export interface LessonInfo {
|
||||
/** 课时 ID */
|
||||
id?: number;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 班级名称 */
|
||||
className?: string;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { LessonInfo } from './lessonInfo';
|
||||
|
||||
/**
|
||||
* 家长端阅读记录响应
|
||||
*/
|
||||
export interface LessonRecordResponse {
|
||||
/** 记录ID(student_record.id) */
|
||||
id?: number;
|
||||
lesson?: LessonInfo;
|
||||
/** 专注度评分 */
|
||||
focus?: number;
|
||||
/** 参与度评分 */
|
||||
participation?: number;
|
||||
/** 兴趣度评分 */
|
||||
interest?: number;
|
||||
/** 理解度评分 */
|
||||
understanding?: number;
|
||||
/** 备注 */
|
||||
notes?: string;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 课程环节标签
|
||||
*/
|
||||
export interface LessonTagResponse {
|
||||
/** 环节名称 */
|
||||
name?: string;
|
||||
/** 环节类型:INTRODUCTION、COLLECTIVE、LANGUAGE、HEALTH、SCIENCE、SOCIAL、ART */
|
||||
lessonType?: string;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 家长端通知响应
|
||||
*/
|
||||
export interface NotificationForParentResponse {
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 标题 */
|
||||
title?: string;
|
||||
/** 内容 */
|
||||
content?: string;
|
||||
/** 是否已读 */
|
||||
isRead?: boolean;
|
||||
/** 阅读时间 */
|
||||
readAt?: string;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 通知类型 */
|
||||
notificationType?: string;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { GrowthRecordForParentResponse } from './growthRecordForParentResponse';
|
||||
|
||||
export interface PageResultGrowthRecordForParentResponse {
|
||||
list?: GrowthRecordForParentResponse[];
|
||||
total?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
pages?: number;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { LessonRecordResponse } from './lessonRecordResponse';
|
||||
|
||||
export interface PageResultLessonRecordResponse {
|
||||
list?: LessonRecordResponse[];
|
||||
total?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
pages?: number;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { NotificationForParentResponse } from './notificationForParentResponse';
|
||||
|
||||
export interface PageResultNotificationForParentResponse {
|
||||
list?: NotificationForParentResponse[];
|
||||
total?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
pages?: number;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { SchoolCourseResponse } from './schoolCourseResponse';
|
||||
|
||||
export interface PageResultSchoolCourseResponse {
|
||||
list?: SchoolCourseResponse[];
|
||||
total?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
pages?: number;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { TaskCompletionDetailResponse } from './taskCompletionDetailResponse';
|
||||
|
||||
export interface PageResultTaskCompletionDetailResponse {
|
||||
list?: TaskCompletionDetailResponse[];
|
||||
total?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
pages?: number;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { TaskWithCompletionResponse } from './taskWithCompletionResponse';
|
||||
|
||||
export interface PageResultTaskWithCompletionResponse {
|
||||
list?: TaskWithCompletionResponse[];
|
||||
total?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
pages?: number;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { ChildProfileResponse } from './childProfileResponse';
|
||||
|
||||
export interface ResultChildProfileResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: ChildProfileResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { GrowthRecordForParentResponse } from './growthRecordForParentResponse';
|
||||
|
||||
export interface ResultGrowthRecordForParentResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: GrowthRecordForParentResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { ChildInfoResponse } from './childInfoResponse';
|
||||
|
||||
export interface ResultListChildInfoResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: ChildInfoResponse[];
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { GrowthRecordForParentResponse } from './growthRecordForParentResponse';
|
||||
|
||||
export interface ResultListGrowthRecordForParentResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: GrowthRecordForParentResponse[];
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { ResultMapStringStringData } from './resultMapStringStringData';
|
||||
|
||||
export interface ResultMapStringString {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: ResultMapStringStringData;
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
export type ResultMapStringStringData = {[key: string]: string};
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { NotificationForParentResponse } from './notificationForParentResponse';
|
||||
|
||||
export interface ResultNotificationForParentResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: NotificationForParentResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { PageResultGrowthRecordForParentResponse } from './pageResultGrowthRecordForParentResponse';
|
||||
|
||||
export interface ResultPageResultGrowthRecordForParentResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: PageResultGrowthRecordForParentResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { PageResultLessonRecordResponse } from './pageResultLessonRecordResponse';
|
||||
|
||||
export interface ResultPageResultLessonRecordResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: PageResultLessonRecordResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { PageResultNotificationForParentResponse } from './pageResultNotificationForParentResponse';
|
||||
|
||||
export interface ResultPageResultNotificationForParentResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: PageResultNotificationForParentResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { PageResultSchoolCourseResponse } from './pageResultSchoolCourseResponse';
|
||||
|
||||
export interface ResultPageResultSchoolCourseResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: PageResultSchoolCourseResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { PageResultTaskCompletionDetailResponse } from './pageResultTaskCompletionDetailResponse';
|
||||
|
||||
export interface ResultPageResultTaskCompletionDetailResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: PageResultTaskCompletionDetailResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { PageResultTaskWithCompletionResponse } from './pageResultTaskWithCompletionResponse';
|
||||
|
||||
export interface ResultPageResultTaskWithCompletionResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: PageResultTaskWithCompletionResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { SchoolCourseResponse } from './schoolCourseResponse';
|
||||
|
||||
export interface ResultSchoolCourseResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: SchoolCourseResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { StudentRecordsResponse } from './studentRecordsResponse';
|
||||
|
||||
export interface ResultStudentRecordsResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: StudentRecordsResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { TaskCompletionDetailResponse } from './taskCompletionDetailResponse';
|
||||
|
||||
export interface ResultTaskCompletionDetailResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: TaskCompletionDetailResponse;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { TaskFeedbackResponse } from './taskFeedbackResponse';
|
||||
|
||||
export interface ResultTaskFeedbackResponse {
|
||||
code?: number;
|
||||
message?: string;
|
||||
data?: TaskFeedbackResponse;
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { LessonTagResponse } from './lessonTagResponse';
|
||||
|
||||
/**
|
||||
* 学校端课程响应
|
||||
*/
|
||||
export interface SchoolCourseResponse {
|
||||
/** ID */
|
||||
id?: number;
|
||||
/** 租户 ID */
|
||||
tenantId?: number;
|
||||
/** 课程名称 */
|
||||
name?: string;
|
||||
/** 课程编码 */
|
||||
code?: string;
|
||||
/** 描述 */
|
||||
description?: string;
|
||||
/** 绘本名称 */
|
||||
pictureBookName?: string;
|
||||
/** 封面图片路径 */
|
||||
coverImagePath?: string;
|
||||
/** 封面 URL */
|
||||
coverUrl?: string;
|
||||
/** 年级标签(规范为数组) */
|
||||
gradeTags?: string[];
|
||||
/** 领域标签(规范为数组) */
|
||||
domainTags?: string[];
|
||||
/** 课程时长(分钟) */
|
||||
duration?: number;
|
||||
/** 使用次数 */
|
||||
usageCount?: number;
|
||||
/** 教师数量 */
|
||||
teacherCount?: number;
|
||||
/** 平均评分 */
|
||||
avgRating?: number;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新时间 */
|
||||
updatedAt?: string;
|
||||
/** 课程环节标签(列表展示用,仅 name 和 lessonType) */
|
||||
lessonTags?: LessonTagResponse[];
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 统计信息
|
||||
*/
|
||||
export interface StatsInfo {
|
||||
/** 阅读记录数 */
|
||||
lessonRecords?: number;
|
||||
/** 成长档案数 */
|
||||
growthRecords?: number;
|
||||
/** 任务完成数 */
|
||||
taskCompletions?: number;
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { ClassInfo } from './classInfo';
|
||||
|
||||
/**
|
||||
* 学生信息
|
||||
*/
|
||||
export interface StudentInfo {
|
||||
/** 学生ID */
|
||||
id?: number;
|
||||
/** 学生姓名 */
|
||||
name?: string;
|
||||
/** 学生头像 */
|
||||
avatar?: string;
|
||||
/** 性别:MALE/FEMALE */
|
||||
gender?: string;
|
||||
classInfo?: ClassInfo;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { LessonInfo } from './lessonInfo';
|
||||
import type { StudentWithRecordResponse } from './studentWithRecordResponse';
|
||||
|
||||
/**
|
||||
* 课后记录列表响应
|
||||
*/
|
||||
export interface StudentRecordsResponse {
|
||||
lesson?: LessonInfo;
|
||||
/** 学生列表(含记录) */
|
||||
students?: StudentWithRecordResponse[];
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { StudentRecordResponse } from './studentRecordResponse';
|
||||
|
||||
/**
|
||||
* 学生及其课后记录
|
||||
*/
|
||||
export interface StudentWithRecordResponse {
|
||||
/** 学生 ID */
|
||||
id?: number;
|
||||
/** 学生姓名 */
|
||||
name?: string;
|
||||
/** 性别 */
|
||||
gender?: string;
|
||||
record?: StudentRecordResponse;
|
||||
}
|
||||
@ -28,6 +28,8 @@ export interface Task {
|
||||
description?: string;
|
||||
/** 任务类型 */
|
||||
type?: string;
|
||||
/** 关联绘本名称 */
|
||||
relatedBookName?: string;
|
||||
/** 课程 ID */
|
||||
courseId?: number;
|
||||
/** 创建人 ID */
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 任务完成请求
|
||||
*/
|
||||
export interface TaskCompleteRequest {
|
||||
/** 学生ID */
|
||||
studentId: number;
|
||||
/** 完成内容/反馈 */
|
||||
content?: string;
|
||||
/** 附件 */
|
||||
attachments?: string;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { StudentInfo } from './studentInfo';
|
||||
import type { TaskFeedbackResponse } from './taskFeedbackResponse';
|
||||
|
||||
/**
|
||||
* 任务完成详情响应
|
||||
*/
|
||||
export interface TaskCompletionDetailResponse {
|
||||
/** 完成记录ID */
|
||||
id?: number;
|
||||
/** 任务ID */
|
||||
taskId?: number;
|
||||
/** 任务标题 */
|
||||
taskTitle?: string;
|
||||
student?: StudentInfo;
|
||||
/** 状态:PENDING/SUBMITTED/REVIEWED */
|
||||
status?: string;
|
||||
/** 状态文本:待完成/已提交/已评价 */
|
||||
statusText?: string;
|
||||
/** 照片URL数组 */
|
||||
photos?: string[];
|
||||
/** 视频URL */
|
||||
videoUrl?: string;
|
||||
/** 语音URL */
|
||||
audioUrl?: string;
|
||||
/** 完成内容/阅读心得 */
|
||||
content?: string;
|
||||
/** 提交时间 */
|
||||
submittedAt?: string;
|
||||
/** 评价时间 */
|
||||
reviewedAt?: string;
|
||||
feedback?: TaskFeedbackResponse;
|
||||
}
|
||||
@ -16,12 +16,20 @@ export interface TaskCreateRequest {
|
||||
description?: string;
|
||||
/** 任务类型:reading-阅读,homework-作业,activity-活动 */
|
||||
type?: string;
|
||||
/** 任务类型(前端兼容 taskType) */
|
||||
taskType?: string;
|
||||
/** 关联绘本名称(手动填写) */
|
||||
relatedBookName?: string;
|
||||
/** 课程 ID */
|
||||
courseId?: number;
|
||||
/** 课程 ID(前端兼容 relatedCourseId) */
|
||||
relatedCourseId?: number;
|
||||
/** 开始日期 */
|
||||
startDate?: string;
|
||||
/** 截止日期 */
|
||||
dueDate?: string;
|
||||
/** 截止日期(前端兼容 endDate) */
|
||||
endDate?: string;
|
||||
/** 附件(JSON 数组) */
|
||||
attachments?: string;
|
||||
/** 目标类型:class-班级,student-学生 */
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 任务评价请求
|
||||
*/
|
||||
export interface TaskFeedbackRequest {
|
||||
/** 评价结果:EXCELLENT-优秀/PASSED-通过/NEEDS_WORK-需改进 */
|
||||
result: string;
|
||||
/**
|
||||
* 评分 1-5(可选)
|
||||
* @minimum 1
|
||||
* @maximum 5
|
||||
*/
|
||||
rating?: number;
|
||||
/**
|
||||
* 评语
|
||||
* @minLength 0
|
||||
* @maxLength 500
|
||||
*/
|
||||
comment?: string;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 任务评价响应
|
||||
*/
|
||||
export interface TaskFeedbackResponse {
|
||||
/** 评价ID */
|
||||
id?: number;
|
||||
/** 完成记录ID */
|
||||
completionId?: number;
|
||||
/** 评价结果:EXCELLENT/PASSED/NEEDS_WORK */
|
||||
result?: string;
|
||||
/** 评价结果文本:优秀/通过/需改进 */
|
||||
resultText?: string;
|
||||
/** 评分 1-5 */
|
||||
rating?: number;
|
||||
/** 评语 */
|
||||
comment?: string;
|
||||
/** 教师ID */
|
||||
teacherId?: number;
|
||||
/** 教师姓名 */
|
||||
teacherName?: string;
|
||||
/** 教师头像 */
|
||||
teacherAvatar?: string;
|
||||
/** 评价时间 */
|
||||
createdAt?: string;
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { CourseInfo } from './courseInfo';
|
||||
|
||||
/**
|
||||
* 任务基本信息
|
||||
*/
|
||||
export interface TaskInfo {
|
||||
/** 任务ID */
|
||||
id?: number;
|
||||
/** 任务标题 */
|
||||
title?: string;
|
||||
/** 任务描述 */
|
||||
description?: string;
|
||||
/** 任务类型 */
|
||||
taskType?: string;
|
||||
/** 开始日期 */
|
||||
startDate?: string;
|
||||
/** 截止日期 */
|
||||
endDate?: string;
|
||||
/** 关联绘本名称 */
|
||||
relatedBookName?: string;
|
||||
course?: CourseInfo;
|
||||
}
|
||||
@ -20,6 +20,8 @@ export interface TaskResponse {
|
||||
description?: string;
|
||||
/** 任务类型 */
|
||||
type?: string;
|
||||
/** 关联绘本名称 */
|
||||
relatedBookName?: string;
|
||||
/** 课程 ID */
|
||||
courseId?: number;
|
||||
/** 创建人 ID */
|
||||
@ -34,6 +36,10 @@ export interface TaskResponse {
|
||||
status?: string;
|
||||
/** 附件 */
|
||||
attachments?: string;
|
||||
/** 目标类型:CLASS-班级,STUDENT-学生 */
|
||||
targetType?: string;
|
||||
/** 目标 IDs(班级或学生) */
|
||||
targetIds?: number[];
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新时间 */
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 任务提交请求
|
||||
*/
|
||||
export interface TaskSubmitRequest {
|
||||
/** 学生ID */
|
||||
studentId?: number;
|
||||
/**
|
||||
* 照片URL数组(最多9张)
|
||||
* @minItems 0
|
||||
* @maxItems 9
|
||||
*/
|
||||
photos?: string[];
|
||||
/** 视频URL */
|
||||
videoUrl?: string;
|
||||
/** 语音URL */
|
||||
audioUrl?: string;
|
||||
/**
|
||||
* 阅读心得/完成内容
|
||||
* @minLength 0
|
||||
* @maxLength 1000
|
||||
*/
|
||||
content?: string;
|
||||
}
|
||||
@ -23,9 +23,9 @@ export interface TaskTemplateCreateRequest {
|
||||
/** 默认持续时间 (天) */
|
||||
defaultDuration?: number;
|
||||
/** 是否默认模板 */
|
||||
isDefault?: number;
|
||||
isDefault?: boolean;
|
||||
/** 模板内容 */
|
||||
content?: string;
|
||||
/** 是否公开 */
|
||||
isPublic?: number;
|
||||
isPublic?: boolean;
|
||||
}
|
||||
|
||||
@ -16,6 +16,14 @@ export interface TaskUpdateRequest {
|
||||
description?: string;
|
||||
/** 任务类型 */
|
||||
type?: string;
|
||||
/** 任务类型(前端兼容 taskType) */
|
||||
taskType?: string;
|
||||
/** 关联绘本名称 */
|
||||
relatedBookName?: string;
|
||||
/** 课程 ID */
|
||||
courseId?: number;
|
||||
/** 课程 ID(前端兼容 relatedCourseId) */
|
||||
relatedCourseId?: number;
|
||||
/** 开始日期 */
|
||||
startDate?: string;
|
||||
/** 截止日期 */
|
||||
@ -24,4 +32,8 @@ export interface TaskUpdateRequest {
|
||||
status?: string;
|
||||
/** 附件(JSON 数组) */
|
||||
attachments?: string;
|
||||
/** 目标类型:CLASS-班级,STUDENT-学生 */
|
||||
targetType?: string;
|
||||
/** 目标 IDs */
|
||||
targetIds?: number[];
|
||||
}
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { TaskFeedbackResponse } from './taskFeedbackResponse';
|
||||
import type { TaskInfo } from './taskInfo';
|
||||
|
||||
/**
|
||||
* 家长端任务列表响应(含完成信息)
|
||||
*/
|
||||
export interface TaskWithCompletionResponse {
|
||||
/** 任务ID */
|
||||
id?: number;
|
||||
/** 完成状态:PENDING-待提交/SUBMITTED-已提交/REVIEWED-已评价 */
|
||||
status?: string;
|
||||
/** 提交时间 */
|
||||
submittedAt?: string;
|
||||
/** 评价时间 */
|
||||
reviewedAt?: string;
|
||||
/** 照片URL列表 */
|
||||
photos?: string[];
|
||||
/** 视频URL */
|
||||
videoUrl?: string;
|
||||
/** 语音URL */
|
||||
audioUrl?: string;
|
||||
/** 阅读心得/完成内容 */
|
||||
content?: string;
|
||||
teacherFeedback?: TaskFeedbackResponse;
|
||||
task?: TaskInfo;
|
||||
}
|
||||
@ -10,18 +10,20 @@
|
||||
* 教师创建请求
|
||||
*/
|
||||
export interface TeacherCreateRequest {
|
||||
/** 用户名 */
|
||||
/** 用户名/登录账号 */
|
||||
username: string;
|
||||
/** 密码 */
|
||||
password: string;
|
||||
/** 姓名 */
|
||||
name: string;
|
||||
/** 电话 */
|
||||
phone?: string;
|
||||
phone: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** 性别 */
|
||||
gender?: string;
|
||||
/** 简介 */
|
||||
bio?: string;
|
||||
/** 负责班级ID列表 */
|
||||
classIds?: number[];
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
import type { TeacherResponseClassNames } from './teacherResponseClassNames';
|
||||
|
||||
/**
|
||||
* 教师响应
|
||||
@ -14,8 +15,6 @@ export interface TeacherResponse {
|
||||
id?: number;
|
||||
/** 租户 ID */
|
||||
tenantId?: number;
|
||||
/** 用户名 */
|
||||
username?: string;
|
||||
/** 姓名 */
|
||||
name?: string;
|
||||
/** 电话 */
|
||||
@ -30,10 +29,18 @@ export interface TeacherResponse {
|
||||
bio?: string;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 负责班级ID列表 */
|
||||
classIds?: number[];
|
||||
/** 负责班级名称 */
|
||||
classNames?: TeacherResponseClassNames;
|
||||
/** 授课次数 */
|
||||
lessonCount?: number;
|
||||
/** 最后登录时间 */
|
||||
lastLoginAt?: string;
|
||||
/** 创建时间 */
|
||||
createdAt?: string;
|
||||
/** 更新时间 */
|
||||
updatedAt?: string;
|
||||
/** 登录账号 */
|
||||
loginAccount?: string;
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v8.5.3 🍺
|
||||
* Do not edit manually.
|
||||
* Reading Platform API
|
||||
* Reading Platform Backend Service API Documentation
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 负责班级名称
|
||||
*/
|
||||
export type TeacherResponseClassNames = { [key: string]: unknown };
|
||||
@ -24,4 +24,6 @@ export interface TeacherUpdateRequest {
|
||||
bio?: string;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 负责班级ID列表 */
|
||||
classIds?: number[];
|
||||
}
|
||||
|
||||
@ -26,8 +26,6 @@ export interface TenantCreateRequest {
|
||||
address?: string;
|
||||
/** Logo URL */
|
||||
logoUrl?: string;
|
||||
/** 套餐类型 */
|
||||
packageType?: string;
|
||||
/** 教师配额 */
|
||||
teacherQuota?: number;
|
||||
/** 学生配额 */
|
||||
@ -36,6 +34,6 @@ export interface TenantCreateRequest {
|
||||
startDate?: string;
|
||||
/** 结束日期 */
|
||||
expireDate?: string;
|
||||
/** 课程套餐 ID(可选) */
|
||||
collectionId?: number;
|
||||
/** 课程套餐 ID 列表(可选,支持多选) */
|
||||
collectionIds?: number[];
|
||||
}
|
||||
|
||||
@ -36,8 +36,8 @@ export interface TenantResponse {
|
||||
maxStudents?: number;
|
||||
/** 最大教师数 */
|
||||
maxTeachers?: number;
|
||||
/** 套餐类型 */
|
||||
packageType?: string;
|
||||
/** 套餐名称列表 */
|
||||
packageNames?: string[];
|
||||
/** 教师配额 */
|
||||
teacherQuota?: number;
|
||||
/** 学生配额 */
|
||||
|
||||
@ -24,10 +24,8 @@ export interface TenantUpdateRequest {
|
||||
logoUrl?: string;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
/** 套餐类型 */
|
||||
packageType?: string;
|
||||
/** 课程套餐ID(用于三层架构) */
|
||||
collectionId?: number;
|
||||
collectionIds?: number[];
|
||||
/** 教师配额 */
|
||||
teacherQuota?: number;
|
||||
/** 学生配额 */
|
||||
|
||||
@ -92,6 +92,7 @@ export interface TaskSubmitRequest {
|
||||
// 带完成信息的任务(兼容旧接口)
|
||||
export interface TaskWithCompletion {
|
||||
id: number;
|
||||
studentId?: number; // 学生ID,多孩子聚合时用于标识任务归属
|
||||
status: TaskCompletionStatus;
|
||||
completedAt?: string;
|
||||
feedback?: string;
|
||||
@ -154,23 +155,41 @@ export const getChildProfile = (childId: number): Promise<ChildProfile> =>
|
||||
|
||||
export const getChildLessons = (
|
||||
childId: number,
|
||||
params?: { pageNum?: number; pageSize?: number }
|
||||
params?: { pageNum?: number; pageSize?: number; page?: number }
|
||||
): Promise<{ items: LessonRecord[]; total: number; page: number; pageSize: number }> =>
|
||||
http.get(`/v1/parent/children/${childId}/lessons`, { params });
|
||||
http.get<{ list: LessonRecord[]; total: number; pageNum: number; pageSize: number }>(`/v1/parent/children/${childId}/lessons`, {
|
||||
params: { pageNum: params?.pageNum ?? params?.page ?? 1, pageSize: params?.pageSize ?? 10 },
|
||||
}).then(res => ({
|
||||
items: res.list || [],
|
||||
total: res.total || 0,
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
|
||||
// ==================== 任务 API ====================
|
||||
|
||||
/** 获取我的任务列表(聚合多孩子任务,无 childId 时使用) */
|
||||
export const getMyTasks = (
|
||||
params?: { pageNum?: number; pageSize?: number; status?: string }
|
||||
): Promise<{ items: TaskWithCompletion[]; total: number; page: number; pageSize: number }> =>
|
||||
http.get<{ list: TaskWithCompletion[]; total: number; pageNum: number; pageSize: number }>('/v1/parent/tasks', { params }).then(res => ({
|
||||
items: res.list || [],
|
||||
total: res.total || 0,
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
|
||||
/** 获取指定孩子的任务列表 */
|
||||
export const getChildTasks = (
|
||||
childId: number,
|
||||
params?: { pageNum?: number; pageSize?: number; status?: string }
|
||||
): Promise<{ items: TaskWithCompletion[]; total: number; page: number; pageSize: number }> =>
|
||||
http.get<{ list: TaskWithCompletion[]; total: number; pageNum: number; pageSize: number }>(`/v1/parent/tasks/student/${childId}`, { params })
|
||||
.then(res => ({
|
||||
items: res.list || [],
|
||||
total: res.total || 0,
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
http.get<{ list: TaskWithCompletion[]; total: number; pageNum: number; pageSize: number }>(`/v1/parent/tasks/student/${childId}`, { params }).then(res => ({
|
||||
items: res.list || [],
|
||||
total: res.total || 0,
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
|
||||
// 提交任务完成(新版)
|
||||
export const submitTaskCompletion = (
|
||||
@ -233,8 +252,18 @@ export const getNotifications = (
|
||||
unreadCount: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}> =>
|
||||
http.get<{ list: Notification[]; total: number; pageNum: number; pageSize: number }>('/v1/parent/notifications', { params })
|
||||
}> => {
|
||||
const queryParams: Record<string, any> = {
|
||||
pageNum: params?.pageNum ?? 1,
|
||||
pageSize: params?.pageSize ?? 10,
|
||||
};
|
||||
if (params?.isRead !== undefined) {
|
||||
queryParams.isRead = params.isRead ? 1 : 0;
|
||||
}
|
||||
if (params?.notificationType) {
|
||||
queryParams.notificationType = params.notificationType;
|
||||
}
|
||||
return http.get<{ list: Notification[]; total: number; pageNum: number; pageSize: number }>('/v1/parent/notifications', { params: queryParams })
|
||||
.then(res => ({
|
||||
items: res.list || [],
|
||||
total: res.total || 0,
|
||||
@ -242,6 +271,7 @@ export const getNotifications = (
|
||||
page: res.pageNum || 1,
|
||||
pageSize: res.pageSize || 10,
|
||||
}));
|
||||
};
|
||||
|
||||
export const getUnreadCount = (): Promise<number> =>
|
||||
http.get<number>('/v1/parent/notifications/unread-count').then(res => res || 0);
|
||||
|
||||
@ -1260,8 +1260,13 @@ export const getParents = (params?: ParentQueryParams) =>
|
||||
export const getParent = (id: number) =>
|
||||
http.get<Parent>(`/v1/school/parents/${id}`);
|
||||
|
||||
export const createParent = (data: CreateParentDto) =>
|
||||
http.post<Parent>('/v1/school/parents', data);
|
||||
export const createParent = (data: CreateParentDto) => {
|
||||
const { loginAccount, ...rest } = data;
|
||||
return http.post<Parent>('/v1/school/parents', {
|
||||
...rest,
|
||||
username: loginAccount,
|
||||
});
|
||||
};
|
||||
|
||||
export const updateParent = (id: number, data: UpdateParentDto) =>
|
||||
http.put<Parent>(`/v1/school/parents/${id}`, data);
|
||||
@ -1273,8 +1278,8 @@ export const resetParentPassword = (id: number) =>
|
||||
http.post<{ tempPassword: string }>(`/v1/school/parents/${id}/reset-password`);
|
||||
|
||||
export const getParentChildren = async (parentId: number): Promise<ParentChild[]> => {
|
||||
const parent = await http.get<Parent & { children: ParentChild[] }>(`/v1/school/parents/${parentId}`);
|
||||
return parent.children || [];
|
||||
const list = await http.get<ParentChild[]>(`/v1/school/parents/${parentId}/children`);
|
||||
return Array.isArray(list) ? list : [];
|
||||
};
|
||||
|
||||
export const addChildToParent = (parentId: number, data: AddChildDto) =>
|
||||
|
||||
@ -122,6 +122,7 @@ export function getTeacherStudents(params?: { pageNum?: number; pageSize?: numbe
|
||||
}
|
||||
|
||||
// 获取班级学生列表
|
||||
// 后端返回 { list, total, pageNum, pageSize, classInfo },前端统一为 { items, total, page, pageSize, class }
|
||||
export function getTeacherClassStudents(classId: number, params?: { pageNum?: number; pageSize?: number; keyword?: string }): Promise<{
|
||||
items: Array<{
|
||||
id: number;
|
||||
@ -151,7 +152,13 @@ export function getTeacherClassStudents(classId: number, params?: { pageNum?: nu
|
||||
pageSize: params?.pageSize,
|
||||
keyword: params?.keyword,
|
||||
},
|
||||
}) as any;
|
||||
}).then((res: any) => ({
|
||||
items: res?.list ?? res?.items ?? [],
|
||||
total: res?.total ?? 0,
|
||||
page: res?.pageNum ?? res?.page ?? 1,
|
||||
pageSize: res?.pageSize ?? 10,
|
||||
class: res?.classInfo ?? res?.class,
|
||||
}));
|
||||
}
|
||||
|
||||
// 获取班级教师列表
|
||||
|
||||
@ -11,9 +11,15 @@
|
||||
<p>关注孩子的阅读成长,陪伴每一步进步!</p>
|
||||
</div>
|
||||
<div class="banner-decorations">
|
||||
<span class="decoration"><BookOutlined /></span>
|
||||
<span class="decoration"><StarOutlined /></span>
|
||||
<span class="decoration"><HeartOutlined /></span>
|
||||
<span class="decoration">
|
||||
<BookOutlined />
|
||||
</span>
|
||||
<span class="decoration">
|
||||
<StarOutlined />
|
||||
</span>
|
||||
<span class="decoration">
|
||||
<HeartOutlined />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,15 +28,12 @@
|
||||
<!-- 我的孩子 -->
|
||||
<div class="section-card">
|
||||
<div class="section-header">
|
||||
<h3><TeamOutlined /> 我的孩子</h3>
|
||||
<h3>
|
||||
<TeamOutlined /> 我的孩子
|
||||
</h3>
|
||||
</div>
|
||||
<div class="children-grid" v-if="children.length > 0">
|
||||
<div
|
||||
v-for="child in children"
|
||||
:key="child.id"
|
||||
class="child-card"
|
||||
@click="goToChildDetail(child.id)"
|
||||
>
|
||||
<div v-for="child in children" :key="child.id" class="child-card" @click="goToChildDetail(child.id)">
|
||||
<div class="child-avatar">
|
||||
<a-avatar :size="isMobile ? 56 : 64" :style="{ backgroundColor: getAvatarColor(child.id) }">
|
||||
{{ child.name.charAt(0) }}
|
||||
@ -43,8 +46,12 @@
|
||||
</div>
|
||||
<div class="child-class">{{ child.class?.name || '未分班' }}</div>
|
||||
<div class="child-stats">
|
||||
<span><BookOutlined /> {{ child.readingCount }} 次阅读</span>
|
||||
<span><ReadOutlined /> {{ child.lessonCount }} 节课</span>
|
||||
<span>
|
||||
<BookOutlined /> {{ child.readingCount }} 次阅读
|
||||
</span>
|
||||
<span>
|
||||
<ReadOutlined /> {{ child.lessonCount }} 节课
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-arrow">
|
||||
@ -62,11 +69,13 @@
|
||||
<!-- 最近任务 -->
|
||||
<div class="section-card">
|
||||
<div class="section-header">
|
||||
<h3><CheckSquareOutlined /> 最近任务</h3>
|
||||
<h3>
|
||||
<CheckSquareOutlined /> 最近任务
|
||||
</h3>
|
||||
<a-button type="link" @click="goToTasks" class="view-all-btn">查看全部</a-button>
|
||||
</div>
|
||||
<div class="task-list" v-if="recentTasks.length > 0">
|
||||
<div v-for="task in recentTasks" :key="task.id" class="task-item">
|
||||
<div v-for="task in recentTasks" :key="`${task.id}-${task.studentId ?? ''}`" class="task-item">
|
||||
<div class="task-status" :class="getStatusClass(task.status)">
|
||||
{{ getStatusText(task.status) }}
|
||||
</div>
|
||||
@ -87,7 +96,9 @@
|
||||
<!-- 成长档案 -->
|
||||
<div class="section-card">
|
||||
<div class="section-header">
|
||||
<h3><FileImageOutlined /> 成长档案</h3>
|
||||
<h3>
|
||||
<FileImageOutlined /> 成长档案
|
||||
</h3>
|
||||
<a-button type="link" @click="goToGrowth" class="view-all-btn">查看全部</a-button>
|
||||
</div>
|
||||
<div class="growth-list" v-if="recentGrowth.length > 0">
|
||||
@ -126,7 +137,7 @@ import {
|
||||
RightOutlined,
|
||||
InboxOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
import { getChildren, type ChildInfo } from '@/api/parent';
|
||||
import { getChildren, getMyTasks, getChildGrowthRecords, type ChildInfo, type TaskWithCompletion } from '@/api/parent';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const router = useRouter();
|
||||
@ -153,8 +164,8 @@ const getRelationshipText = (relationship: string) => {
|
||||
|
||||
const statusMap: Record<string, { text: string; class: string }> = {
|
||||
PENDING: { text: '待完成', class: 'status-pending' },
|
||||
IN_PROGRESS: { text: '进行中', class: 'status-progress' },
|
||||
COMPLETED: { text: '已完成', class: 'status-completed' },
|
||||
SUBMITTED: { text: '已提交', class: 'status-progress' },
|
||||
REVIEWED: { text: '已评价', class: 'status-completed' },
|
||||
};
|
||||
|
||||
const getStatusText = (status: string) => statusMap[status]?.text || status;
|
||||
@ -171,11 +182,13 @@ const goToChildDetail = (childId: number) => {
|
||||
};
|
||||
|
||||
const goToTasks = () => {
|
||||
router.push('/parent/tasks');
|
||||
router.push('/parent/tasks'); // 任务页支持聚合视图,无需 childId
|
||||
};
|
||||
|
||||
const goToGrowth = () => {
|
||||
router.push('/parent/growth');
|
||||
// 成长档案需要指定孩子,有孩子时传第一个
|
||||
const childId = children.value[0]?.id;
|
||||
router.push(childId ? `/parent/growth?childId=${childId}` : '/parent/growth');
|
||||
};
|
||||
|
||||
const loadData = async () => {
|
||||
@ -184,9 +197,16 @@ const loadData = async () => {
|
||||
const data = await getChildren();
|
||||
children.value = data;
|
||||
|
||||
// 如果有孩子,加载第一个孩子的任务和成长记录
|
||||
// 加载最近任务(聚合多孩子)
|
||||
const tasksRes = await getMyTasks({ pageNum: 1, pageSize: 5 });
|
||||
recentTasks.value = tasksRes.items || [];
|
||||
|
||||
// 加载第一个孩子的最近成长档案
|
||||
if (data.length > 0) {
|
||||
// 这里可以加载任务和成长记录
|
||||
const growthRes = await getChildGrowthRecords(data[0].id, { pageNum: 1, pageSize: 4 });
|
||||
recentGrowth.value = growthRes.items || [];
|
||||
} else {
|
||||
recentGrowth.value = [];
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error.response?.data?.message || '加载数据失败');
|
||||
@ -212,6 +232,7 @@ $primary-light: #f6ffed;
|
||||
$primary-dark: #389e0d;
|
||||
|
||||
.parent-dashboard {
|
||||
|
||||
// 欢迎横幅
|
||||
.welcome-banner {
|
||||
background: linear-gradient(135deg, $primary-color 0%, #73d13d 100%);
|
||||
@ -550,6 +571,7 @@ $primary-dark: #389e0d;
|
||||
|
||||
.task-content,
|
||||
.growth-content {
|
||||
|
||||
.task-title,
|
||||
.growth-title {
|
||||
font-size: 13px;
|
||||
|
||||
@ -1,14 +1,8 @@
|
||||
<template>
|
||||
<a-layout :class="['parent-layout', { 'is-collapsed': collapsed }]">
|
||||
<!-- 桌面端侧边栏 -->
|
||||
<a-layout-sider
|
||||
v-if="!isMobile"
|
||||
v-model:collapsed="collapsed"
|
||||
:trigger="null"
|
||||
collapsible
|
||||
class="parent-sider"
|
||||
:width="220"
|
||||
>
|
||||
<a-layout-sider v-if="!isMobile" v-model:collapsed="collapsed" :trigger="null" collapsible class="parent-sider"
|
||||
:width="220">
|
||||
<div class="logo">
|
||||
<img src="/logo.png" alt="Logo" class="logo-img" />
|
||||
<div v-if="!collapsed" class="logo-text">
|
||||
@ -18,47 +12,45 @@
|
||||
</div>
|
||||
|
||||
<div class="sider-menu-wrapper">
|
||||
<a-menu
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
mode="inline"
|
||||
theme="light"
|
||||
:inline-collapsed="collapsed"
|
||||
@click="handleMenuClick"
|
||||
class="side-menu"
|
||||
>
|
||||
<a-menu-item key="dashboard">
|
||||
<template #icon><HomeOutlined /></template>
|
||||
<span>首页</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="children">
|
||||
<template #icon><TeamOutlined /></template>
|
||||
<span>我的孩子</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="lessons">
|
||||
<template #icon><BookOutlined /></template>
|
||||
<span>阅读记录</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="tasks">
|
||||
<template #icon><CheckSquareOutlined /></template>
|
||||
<span>阅读任务</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="growth">
|
||||
<template #icon><FileImageOutlined /></template>
|
||||
<span>成长档案</span>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
<a-menu v-model:selectedKeys="selectedKeys" mode="inline" theme="light" :inline-collapsed="collapsed"
|
||||
@click="handleMenuClick" class="side-menu">
|
||||
<a-menu-item key="dashboard">
|
||||
<template #icon>
|
||||
<HomeOutlined />
|
||||
</template>
|
||||
<span>首页</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="children">
|
||||
<template #icon>
|
||||
<TeamOutlined />
|
||||
</template>
|
||||
<span>我的孩子</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="lessons">
|
||||
<template #icon>
|
||||
<BookOutlined />
|
||||
</template>
|
||||
<span>阅读记录</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="tasks">
|
||||
<template #icon>
|
||||
<CheckSquareOutlined />
|
||||
</template>
|
||||
<span>阅读任务</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="growth">
|
||||
<template #icon>
|
||||
<FileImageOutlined />
|
||||
</template>
|
||||
<span>成长档案</span>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</div>
|
||||
</a-layout-sider>
|
||||
|
||||
<!-- 移动端抽屉菜单 -->
|
||||
<a-drawer
|
||||
v-if="isMobile"
|
||||
v-model:open="drawerVisible"
|
||||
placement="left"
|
||||
:closable="false"
|
||||
:width="260"
|
||||
class="mobile-drawer"
|
||||
>
|
||||
<a-drawer v-if="isMobile" v-model:open="drawerVisible" placement="left" :closable="false" :width="260"
|
||||
class="mobile-drawer">
|
||||
<template #title>
|
||||
<div class="drawer-header">
|
||||
<img src="/logo.png" alt="Logo" class="drawer-logo" />
|
||||
@ -68,35 +60,42 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<a-menu
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
mode="inline"
|
||||
theme="light"
|
||||
@click="handleMobileMenuClick"
|
||||
class="drawer-menu"
|
||||
>
|
||||
<a-menu v-model:selectedKeys="selectedKeys" mode="inline" theme="light" @click="handleMobileMenuClick"
|
||||
class="drawer-menu">
|
||||
<a-menu-item key="dashboard">
|
||||
<template #icon><HomeOutlined /></template>
|
||||
<template #icon>
|
||||
<HomeOutlined />
|
||||
</template>
|
||||
<span>首页</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="children">
|
||||
<template #icon><TeamOutlined /></template>
|
||||
<template #icon>
|
||||
<TeamOutlined />
|
||||
</template>
|
||||
<span>我的孩子</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="lessons">
|
||||
<template #icon><BookOutlined /></template>
|
||||
<template #icon>
|
||||
<BookOutlined />
|
||||
</template>
|
||||
<span>阅读记录</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="tasks">
|
||||
<template #icon><CheckSquareOutlined /></template>
|
||||
<template #icon>
|
||||
<CheckSquareOutlined />
|
||||
</template>
|
||||
<span>阅读任务</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="growth">
|
||||
<template #icon><FileImageOutlined /></template>
|
||||
<template #icon>
|
||||
<FileImageOutlined />
|
||||
</template>
|
||||
<span>成长档案</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item key="profile">
|
||||
<template #icon><UserOutlined /></template>
|
||||
<template #icon>
|
||||
<UserOutlined />
|
||||
</template>
|
||||
<span>个人信息</span>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
@ -112,16 +111,8 @@
|
||||
<!-- 桌面端顶部栏 -->
|
||||
<a-layout-header v-if="!isMobile" class="parent-header">
|
||||
<div class="header-left">
|
||||
<MenuUnfoldOutlined
|
||||
v-if="collapsed"
|
||||
class="trigger"
|
||||
@click="collapsed = !collapsed"
|
||||
/>
|
||||
<MenuFoldOutlined
|
||||
v-else
|
||||
class="trigger"
|
||||
@click="collapsed = !collapsed"
|
||||
/>
|
||||
<MenuUnfoldOutlined v-if="collapsed" class="trigger" @click="collapsed = !collapsed" />
|
||||
<MenuFoldOutlined v-else class="trigger" @click="collapsed = !collapsed" />
|
||||
</div>
|
||||
|
||||
<div class="header-right">
|
||||
@ -129,7 +120,9 @@
|
||||
<a-dropdown>
|
||||
<a-space class="user-info" style="cursor: pointer;">
|
||||
<a-avatar :size="32" class="user-avatar">
|
||||
<template #icon><UserOutlined /></template>
|
||||
<template #icon>
|
||||
<UserOutlined />
|
||||
</template>
|
||||
</a-avatar>
|
||||
<span class="user-name">{{ userName }}</span>
|
||||
<DownOutlined />
|
||||
@ -166,12 +159,8 @@
|
||||
|
||||
<!-- 移动端底部导航 -->
|
||||
<div v-if="isMobile" class="mobile-bottom-nav">
|
||||
<div
|
||||
v-for="nav in navItems"
|
||||
:key="nav.key"
|
||||
:class="['nav-item', { active: selectedKeys[0] === nav.key }]"
|
||||
@click="handleNavClick(nav.key)"
|
||||
>
|
||||
<div v-for="nav in navItems" :key="nav.key" :class="['nav-item', { active: selectedKeys[0] === nav.key }]"
|
||||
@click="handleNavClick(nav.key)">
|
||||
<component :is="nav.icon" class="nav-icon" />
|
||||
<span class="nav-text">{{ nav.text }}</span>
|
||||
</div>
|
||||
|
||||
@ -1,8 +1,23 @@
|
||||
<template>
|
||||
<div class="growth-record-view">
|
||||
<div class="page-header">
|
||||
<h2><FileImageOutlined /> 成长档案</h2>
|
||||
<p class="page-desc">记录孩子成长的每一个精彩瞬间</p>
|
||||
<div class="header-left">
|
||||
<h2>
|
||||
<FileImageOutlined /> 成长档案
|
||||
</h2>
|
||||
<p class="page-desc">记录孩子成长的每一个精彩瞬间</p>
|
||||
</div>
|
||||
<a-select
|
||||
v-if="children.length > 1"
|
||||
v-model:value="selectedChildId"
|
||||
placeholder="选择孩子"
|
||||
style="width: 140px;"
|
||||
@change="onChildChange"
|
||||
>
|
||||
<a-select-option v-for="c in children" :key="c.id" :value="c.id">
|
||||
{{ c.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
|
||||
<a-spin :spinning="loading">
|
||||
@ -22,7 +37,9 @@
|
||||
<h3>{{ record.title }}</h3>
|
||||
<p v-if="record.content">{{ record.content }}</p>
|
||||
<div class="card-meta">
|
||||
<span><CalendarOutlined /> {{ formatDate(record.recordDate) }}</span>
|
||||
<span>
|
||||
<CalendarOutlined /> {{ formatDate(record.recordDate) }}
|
||||
</span>
|
||||
<span v-if="record.class">
|
||||
<TeamOutlined /> {{ record.class.name }}
|
||||
</span>
|
||||
@ -38,18 +55,13 @@
|
||||
</a-spin>
|
||||
|
||||
<div class="pagination-section" v-if="total > pageSize">
|
||||
<a-pagination
|
||||
v-model:current="currentPage"
|
||||
:total="total"
|
||||
:page-size="pageSize"
|
||||
@change="onPageChange"
|
||||
/>
|
||||
<a-pagination v-model:current="currentPage" :total="total" :page-size="pageSize" @change="onPageChange" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { message } from 'ant-design-vue';
|
||||
import {
|
||||
@ -59,7 +71,7 @@ import {
|
||||
TeamOutlined,
|
||||
InboxOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
import { getChildGrowthRecords, getChildren, type GrowthRecord } from '@/api/parent';
|
||||
import { getChildGrowthRecords, getChildren, type GrowthRecord, type ChildInfo } from '@/api/parent';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const route = useRoute();
|
||||
@ -69,7 +81,9 @@ const records = ref<GrowthRecord[]>([]);
|
||||
const total = ref(0);
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(12);
|
||||
const children = ref<ChildInfo[]>([]);
|
||||
const currentChildId = ref<number | null>(null);
|
||||
const selectedChildId = ref<number | null>(null);
|
||||
|
||||
const formatDate = (date: string) => dayjs(date).format('YYYY-MM-DD');
|
||||
|
||||
@ -78,25 +92,32 @@ const onPageChange = (page: number) => {
|
||||
loadRecords();
|
||||
};
|
||||
|
||||
const onChildChange = (val: number) => {
|
||||
router.replace({ query: { childId: String(val) } });
|
||||
currentPage.value = 1;
|
||||
loadRecords();
|
||||
};
|
||||
|
||||
const loadRecords = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
let childId = route.query.childId ? Number(route.query.childId) : null;
|
||||
|
||||
// 如果没有指定childId,自动获取第一个孩子
|
||||
if (!childId) {
|
||||
const children = await getChildren();
|
||||
if (children && children.length > 0) {
|
||||
childId = children[0].id;
|
||||
router.replace({ query: { childId: String(childId) } });
|
||||
} else {
|
||||
records.value = [];
|
||||
total.value = 0;
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
// 加载孩子列表
|
||||
children.value = await getChildren();
|
||||
if (children.value.length === 0) {
|
||||
records.value = [];
|
||||
total.value = 0;
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果没有指定 childId,使用第一个孩子
|
||||
if (!childId) {
|
||||
childId = children.value[0].id;
|
||||
router.replace({ query: { childId: String(childId) } });
|
||||
}
|
||||
selectedChildId.value = childId;
|
||||
currentChildId.value = childId;
|
||||
|
||||
const data = await getChildGrowthRecords(childId, {
|
||||
@ -115,6 +136,8 @@ const loadRecords = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
watch(() => route.query.childId, () => loadRecords());
|
||||
|
||||
onMounted(() => {
|
||||
loadRecords();
|
||||
});
|
||||
@ -127,6 +150,15 @@ $primary-light: #f6ffed;
|
||||
.growth-record-view {
|
||||
.page-header {
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
|
||||
.header-left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0 0 8px;
|
||||
|
||||
@ -1,8 +1,23 @@
|
||||
<template>
|
||||
<div class="lesson-history-view">
|
||||
<div class="page-header">
|
||||
<h2><BookOutlined /> 阅读记录</h2>
|
||||
<p class="page-desc">查看孩子的阅读学习记录</p>
|
||||
<div class="header-left">
|
||||
<h2>
|
||||
<BookOutlined /> 阅读记录
|
||||
</h2>
|
||||
<p class="page-desc">查看孩子的阅读学习记录</p>
|
||||
</div>
|
||||
<a-select
|
||||
v-if="children.length > 1"
|
||||
v-model:value="selectedChildId"
|
||||
placeholder="选择孩子"
|
||||
style="width: 140px;"
|
||||
@change="onChildChange"
|
||||
>
|
||||
<a-select-option v-for="c in children" :key="c.id" :value="c.id">
|
||||
{{ c.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
|
||||
<a-spin :spinning="loading">
|
||||
@ -61,18 +76,13 @@
|
||||
</a-spin>
|
||||
|
||||
<div class="pagination-section" v-if="total > pageSize">
|
||||
<a-pagination
|
||||
v-model:current="currentPage"
|
||||
:total="total"
|
||||
:page-size="pageSize"
|
||||
@change="onPageChange"
|
||||
/>
|
||||
<a-pagination v-model:current="currentPage" :total="total" :page-size="pageSize" @change="onPageChange" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { message } from 'ant-design-vue';
|
||||
import {
|
||||
@ -82,7 +92,7 @@ import {
|
||||
FileTextOutlined,
|
||||
InboxOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
import { getChildLessons, getChildren, type LessonRecord } from '@/api/parent';
|
||||
import { getChildLessons, getChildren, type LessonRecord, type ChildInfo } from '@/api/parent';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const route = useRoute();
|
||||
@ -92,7 +102,9 @@ const records = ref<LessonRecord[]>([]);
|
||||
const total = ref(0);
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const children = ref<ChildInfo[]>([]);
|
||||
const currentChildId = ref<number | null>(null);
|
||||
const selectedChildId = ref<number | null>(null);
|
||||
|
||||
const formatDateTime = (date: string) => dayjs(date).format('YYYY-MM-DD HH:mm');
|
||||
|
||||
@ -101,23 +113,32 @@ const onPageChange = (page: number) => {
|
||||
loadRecords();
|
||||
};
|
||||
|
||||
const onChildChange = (val: number) => {
|
||||
router.replace({ query: { childId: String(val) } });
|
||||
currentPage.value = 1;
|
||||
loadRecords();
|
||||
};
|
||||
|
||||
const loadRecords = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
let childId = route.query.childId ? Number(route.query.childId) : null;
|
||||
|
||||
// 如果没有指定childId,自动获取第一个孩子
|
||||
if (!childId) {
|
||||
const children = await getChildren();
|
||||
if (children && children.length > 0) {
|
||||
childId = children[0].id;
|
||||
router.replace({ query: { childId: String(childId) } });
|
||||
} else {
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
// 加载孩子列表
|
||||
children.value = await getChildren();
|
||||
if (children.value.length === 0) {
|
||||
records.value = [];
|
||||
total.value = 0;
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果没有指定 childId,使用第一个孩子
|
||||
if (!childId) {
|
||||
childId = children.value[0].id;
|
||||
router.replace({ query: { childId: String(childId) } });
|
||||
}
|
||||
selectedChildId.value = childId;
|
||||
currentChildId.value = childId;
|
||||
|
||||
const data = await getChildLessons(childId, {
|
||||
@ -133,6 +154,8 @@ const loadRecords = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
watch(() => route.query.childId, () => loadRecords());
|
||||
|
||||
onMounted(() => {
|
||||
loadRecords();
|
||||
});
|
||||
@ -142,6 +165,15 @@ onMounted(() => {
|
||||
.lesson-history-view {
|
||||
.page-header {
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
|
||||
.header-left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0 0 8px;
|
||||
|
||||
@ -1,13 +1,30 @@
|
||||
<template>
|
||||
<div class="task-list-view">
|
||||
<div class="page-header">
|
||||
<h2><CheckSquareOutlined /> 阅读任务</h2>
|
||||
<p class="page-desc">查看孩子的阅读任务并提交完成情况</p>
|
||||
<div class="header-left">
|
||||
<h2>
|
||||
<CheckSquareOutlined /> 阅读任务
|
||||
</h2>
|
||||
<p class="page-desc">查看孩子的阅读任务并提交完成情况</p>
|
||||
</div>
|
||||
<a-select
|
||||
v-if="children.length > 1"
|
||||
v-model:value="selectedChildId"
|
||||
placeholder="选择孩子"
|
||||
style="width: 140px;"
|
||||
allow-clear
|
||||
@change="onChildChange"
|
||||
>
|
||||
<a-select-option :value="null">全部孩子</a-select-option>
|
||||
<a-select-option v-for="c in children" :key="c.id" :value="c.id">
|
||||
{{ c.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
|
||||
<a-spin :spinning="loading">
|
||||
<div class="task-list" v-if="tasks.length > 0">
|
||||
<div v-for="task in tasks" :key="task.id" class="task-card">
|
||||
<div v-for="task in tasks" :key="`${task.id}-${task.studentId ?? ''}`" class="task-card">
|
||||
<div class="card-header">
|
||||
<div class="task-info">
|
||||
<div class="task-title-row">
|
||||
@ -36,7 +53,8 @@
|
||||
</div>
|
||||
|
||||
<!-- 已提交内容预览 -->
|
||||
<div class="submission-preview" v-if="task.status !== 'PENDING' && (task.photos?.length || task.videoUrl || task.audioUrl || task.content)">
|
||||
<div class="submission-preview"
|
||||
v-if="task.status !== 'PENDING' && (task.photos?.length || task.videoUrl || task.audioUrl || task.content)">
|
||||
<div class="preview-title">已提交内容:</div>
|
||||
<div class="preview-items">
|
||||
<span v-if="task.photos?.length" class="preview-item">
|
||||
@ -108,15 +126,8 @@
|
||||
</a-spin>
|
||||
|
||||
<!-- 提交任务弹窗 -->
|
||||
<a-modal
|
||||
v-model:open="submitModalVisible"
|
||||
:title="isEditSubmit ? '修改提交' : '提交任务完成'"
|
||||
@ok="handleSubmit"
|
||||
:confirm-loading="submitting"
|
||||
width="600px"
|
||||
okText="提交"
|
||||
cancelText="取消"
|
||||
>
|
||||
<a-modal v-model:open="submitModalVisible" :title="isEditSubmit ? '修改提交' : '提交任务完成'" @ok="handleSubmit"
|
||||
:confirm-loading="submitting" width="600px" okText="提交" cancelText="取消">
|
||||
<div class="task-info-header" v-if="selectedTask">
|
||||
<h4>{{ selectedTask.task.title }}</h4>
|
||||
<p v-if="selectedTask.task.relatedBookName">
|
||||
@ -135,12 +146,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-upload
|
||||
:customRequest="handlePhotoUpload"
|
||||
:showUploadList="false"
|
||||
accept="image/*"
|
||||
multiple
|
||||
>
|
||||
<a-upload :customRequest="handlePhotoUpload" :showUploadList="false" accept="image/*" multiple>
|
||||
<div class="upload-btn">
|
||||
<PlusOutlined />
|
||||
<span>添加照片</span>
|
||||
@ -151,40 +157,22 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="视频链接">
|
||||
<a-input
|
||||
v-model:value="submitForm.videoUrl"
|
||||
placeholder="请输入视频链接(可选,如腾讯视频、优酷等分享链接)"
|
||||
allow-clear
|
||||
/>
|
||||
<a-input v-model:value="submitForm.videoUrl" placeholder="请输入视频链接(可选,如腾讯视频、优酷等分享链接)" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="音频链接">
|
||||
<a-input
|
||||
v-model:value="submitForm.audioUrl"
|
||||
placeholder="请输入音频链接(可选)"
|
||||
allow-clear
|
||||
/>
|
||||
<a-input v-model:value="submitForm.audioUrl" placeholder="请输入音频链接(可选)" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="阅读心得">
|
||||
<a-textarea
|
||||
v-model:value="submitForm.content"
|
||||
placeholder="请描述孩子的阅读情况、感受等(可选)"
|
||||
:rows="4"
|
||||
:maxlength="500"
|
||||
show-count
|
||||
/>
|
||||
<a-textarea v-model:value="submitForm.content" placeholder="请描述孩子的阅读情况、感受等(可选)" :rows="4" :maxlength="500"
|
||||
show-count />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<!-- 评价详情弹窗 -->
|
||||
<a-modal
|
||||
v-model:open="feedbackModalVisible"
|
||||
title="教师评价详情"
|
||||
:footer="null"
|
||||
width="500px"
|
||||
>
|
||||
<a-modal v-model:open="feedbackModalVisible" title="教师评价详情" :footer="null" width="500px">
|
||||
<div class="feedback-detail" v-if="selectedTask?.teacherFeedback">
|
||||
<div class="feedback-result-section">
|
||||
<div class="result-label">评价结果</div>
|
||||
@ -214,7 +202,8 @@
|
||||
<a-divider>提交内容</a-divider>
|
||||
<div class="review-photos" v-if="selectedTask.photos?.length">
|
||||
<div class="photos-grid">
|
||||
<img v-for="(photo, idx) in selectedTask.photos" :key="idx" :src="photo" alt="照片" @click="previewImage(photo)" />
|
||||
<img v-for="(photo, idx) in selectedTask.photos" :key="idx" :src="photo" alt="照片"
|
||||
@click="previewImage(photo)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="review-links" v-if="selectedTask.videoUrl || selectedTask.audioUrl">
|
||||
@ -233,19 +222,15 @@
|
||||
</a-modal>
|
||||
|
||||
<!-- 图片预览 -->
|
||||
<a-image
|
||||
:style="{ display: 'none' }"
|
||||
:preview="{
|
||||
visible: imagePreviewVisible,
|
||||
onVisibleChange: (visible: boolean) => { imagePreviewVisible = visible; },
|
||||
}"
|
||||
:src="previewImageUrl"
|
||||
/>
|
||||
<a-image :style="{ display: 'none' }" :preview="{
|
||||
visible: imagePreviewVisible,
|
||||
onVisibleChange: (visible: boolean) => { imagePreviewVisible = visible; },
|
||||
}" :src="previewImageUrl" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ref, reactive, onMounted, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { message, Upload } from 'ant-design-vue';
|
||||
import type { UploadRequestOption } from 'ant-design-vue/es/vc-upload/interface';
|
||||
@ -267,10 +252,13 @@ import {
|
||||
} from '@ant-design/icons-vue';
|
||||
import {
|
||||
getChildTasks,
|
||||
getMyTasks,
|
||||
getChildren,
|
||||
submitTaskCompletion,
|
||||
updateTaskCompletion,
|
||||
type TaskWithCompletion,
|
||||
type TaskSubmitRequest,
|
||||
type ChildInfo,
|
||||
} from '@/api/parent';
|
||||
import { uploadFile } from '@/api/file';
|
||||
import dayjs from 'dayjs';
|
||||
@ -279,7 +267,9 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
const loading = ref(false);
|
||||
const tasks = ref<TaskWithCompletion[]>([]);
|
||||
const children = ref<ChildInfo[]>([]);
|
||||
const currentChildId = ref<number | null>(null);
|
||||
const selectedChildId = ref<number | null>(null); // null = 全部孩子,使用 getMyTasks
|
||||
|
||||
// 提交弹窗
|
||||
const submitModalVisible = ref(false);
|
||||
@ -336,20 +326,21 @@ const openSubmitModal = (task: TaskWithCompletion) => {
|
||||
submitModalVisible.value = true;
|
||||
};
|
||||
|
||||
// 处理照片上传
|
||||
// 处理照片上传(符合 API:photos 为 URL 字符串数组)
|
||||
const handlePhotoUpload = async (options: UploadRequestOption) => {
|
||||
const { file } = options;
|
||||
try {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file as File);
|
||||
const url = await uploadFile(formData);
|
||||
if (submitForm.photos.length < 9) {
|
||||
submitForm.photos.push(url);
|
||||
} else {
|
||||
if (submitForm.photos.length >= 9) {
|
||||
message.warning('最多上传9张照片');
|
||||
return;
|
||||
}
|
||||
const result = await uploadFile(file as File, 'poster');
|
||||
const url = result.filePath;
|
||||
if (url) {
|
||||
submitForm.photos.push(url);
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error('上传失败');
|
||||
message.error(error?.message || '上传失败');
|
||||
}
|
||||
};
|
||||
|
||||
@ -362,7 +353,8 @@ const removePhoto = (index: number) => {
|
||||
const handleSubmit = async () => {
|
||||
if (!selectedTask.value) return;
|
||||
|
||||
const childId = currentChildId.value || (route.query.childId ? Number(route.query.childId) : null);
|
||||
// 优先使用任务自带的 studentId(聚合视图),否则用当前选中的孩子
|
||||
const childId = selectedTask.value?.studentId ?? currentChildId.value ?? (route.query.childId ? Number(route.query.childId) : null);
|
||||
if (!childId) {
|
||||
message.warning('请先选择孩子');
|
||||
return;
|
||||
@ -407,28 +399,43 @@ const previewImage = (url: string) => {
|
||||
imagePreviewVisible.value = true;
|
||||
};
|
||||
|
||||
// 加载任务列表
|
||||
// 孩子切换
|
||||
const onChildChange = (val: number | null) => {
|
||||
if (val) {
|
||||
router.replace({ query: { childId: String(val) } });
|
||||
} else {
|
||||
router.replace({ query: {} });
|
||||
}
|
||||
loadTasks();
|
||||
};
|
||||
|
||||
// 加载任务列表:有 childId 用 getChildTasks,无 childId 用 getMyTasks(聚合多孩子)
|
||||
const loadTasks = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
let childId = route.query.childId ? Number(route.query.childId) : null;
|
||||
|
||||
// 如果没有指定childId,自动获取第一个孩子
|
||||
if (!childId) {
|
||||
const { getChildren } = await import('@/api/parent');
|
||||
const children = await getChildren();
|
||||
if (children && children.length > 0) {
|
||||
childId = children[0].id;
|
||||
router.replace({ query: { childId: String(childId) } });
|
||||
} else {
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
// 加载孩子列表(用于选择器)
|
||||
children.value = await getChildren();
|
||||
if (children.value.length === 0) {
|
||||
tasks.value = [];
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
currentChildId.value = childId;
|
||||
const data = await getChildTasks(childId);
|
||||
tasks.value = data.items;
|
||||
selectedChildId.value = childId;
|
||||
|
||||
if (childId) {
|
||||
// 指定孩子:调用 getChildTasks
|
||||
currentChildId.value = childId;
|
||||
const data = await getChildTasks(childId);
|
||||
tasks.value = data.items;
|
||||
} else {
|
||||
// 未指定:调用 getMyTasks 聚合多孩子任务
|
||||
currentChildId.value = children.value[0]?.id ?? null;
|
||||
const data = await getMyTasks();
|
||||
tasks.value = data.items;
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error.response?.data?.message || '加载数据失败');
|
||||
} finally {
|
||||
@ -436,6 +443,9 @@ const loadTasks = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 监听路由变化(如从孩子详情页跳转带 childId)
|
||||
watch(() => route.query.childId, () => loadTasks());
|
||||
|
||||
onMounted(() => {
|
||||
loadTasks();
|
||||
});
|
||||
@ -448,6 +458,15 @@ $primary-light: #f6ffed;
|
||||
.task-list-view {
|
||||
.page-header {
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
|
||||
.header-left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0 0 8px;
|
||||
@ -698,6 +717,7 @@ $primary-light: #f6ffed;
|
||||
|
||||
// 评价详情弹窗样式
|
||||
.feedback-detail {
|
||||
|
||||
.feedback-result-section,
|
||||
.feedback-rating-section {
|
||||
margin-bottom: 16px;
|
||||
@ -854,6 +874,7 @@ $primary-light: #f6ffed;
|
||||
}
|
||||
|
||||
.photo-upload-area {
|
||||
|
||||
.photo-item,
|
||||
.upload-btn {
|
||||
width: 60px;
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
<div class="info-row">
|
||||
<CalendarOutlined class="info-icon" />
|
||||
<span class="info-value">{{ calculateAge(student.birthDate) || '--' }}{{ student.birthDate ? '岁' : ''
|
||||
}}</span>
|
||||
}}</span>
|
||||
<span class="gender-tag" :class="normalizeGender(student.gender) === '男' ? 'boy' : 'girl'">
|
||||
{{ normalizeGender(student.gender) }}
|
||||
</span>
|
||||
@ -400,7 +400,7 @@ interface FormState {
|
||||
name: string;
|
||||
gender: string;
|
||||
birthDate?: string | null;
|
||||
classId: number;
|
||||
classId?: number;
|
||||
parentName: string;
|
||||
parentPhone: string;
|
||||
}
|
||||
@ -409,7 +409,7 @@ const formState = reactive<FormState>({
|
||||
name: '',
|
||||
gender: '男',
|
||||
birthDate: null,
|
||||
classId: 0,
|
||||
classId: undefined,
|
||||
parentName: '',
|
||||
parentPhone: '',
|
||||
});
|
||||
@ -417,7 +417,9 @@ const formState = reactive<FormState>({
|
||||
const rules: Record<string, any[]> = {
|
||||
name: [{ required: true, message: '请输入学生姓名', trigger: 'blur' }],
|
||||
gender: [{ required: true, message: '请选择性别', trigger: 'change' }],
|
||||
classId: [{ required: true, message: '请选择班级', trigger: 'change', type: 'number' }],
|
||||
classId: [
|
||||
{ required: true, message: '请选择班级', trigger: 'change' },
|
||||
],
|
||||
};
|
||||
|
||||
const calculateAge = (birthDate?: string | null): number | null => {
|
||||
@ -482,7 +484,7 @@ const resetForm = () => {
|
||||
formState.name = '';
|
||||
formState.gender = '男';
|
||||
formState.birthDate = null;
|
||||
formState.classId = 0;
|
||||
formState.classId = undefined;
|
||||
formState.parentName = '';
|
||||
formState.parentPhone = '';
|
||||
};
|
||||
@ -508,6 +510,11 @@ const handleEdit = (record: Student) => {
|
||||
const handleModalOk = async () => {
|
||||
try {
|
||||
await formRef.value?.validate();
|
||||
const classId = formState.classId;
|
||||
if (Number(classId || '-1') < 0) {
|
||||
message.warning('请选择班级');
|
||||
return;
|
||||
}
|
||||
submitting.value = true;
|
||||
|
||||
if (isEdit.value && formState.id) {
|
||||
@ -515,7 +522,7 @@ const handleModalOk = async () => {
|
||||
name: formState.name,
|
||||
gender: formState.gender,
|
||||
birthDate: formState.birthDate,
|
||||
classId: formState.classId,
|
||||
classId,
|
||||
parentName: formState.parentName,
|
||||
parentPhone: formState.parentPhone,
|
||||
});
|
||||
@ -525,7 +532,7 @@ const handleModalOk = async () => {
|
||||
name: formState.name,
|
||||
gender: formState.gender,
|
||||
birthDate: formState.birthDate,
|
||||
classId: formState.classId,
|
||||
classId,
|
||||
parentName: formState.parentName,
|
||||
parentPhone: formState.parentPhone,
|
||||
});
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
<div class="class-avatar" :style="{ background: getGradeGradient(cls.grade) }">
|
||||
<span class="avatar-text">{{ getGradeInitial(cls.grade) }}</span>
|
||||
</div>
|
||||
<div class="class-name">{{ cls.name }}</div>
|
||||
<div class="class-name">{{ cls.name || '未命名班级' }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 统计信息 -->
|
||||
|
||||
@ -182,21 +182,32 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-item label="选择目标" required v-if="createForm.targetType === 'CLASS'">
|
||||
<a-form-item label="选择班级" required v-if="createForm.targetType === 'CLASS'">
|
||||
<a-select v-model:value="createForm.targetIds" mode="multiple" placeholder="请选择班级" style="width: 100%;">
|
||||
<a-select-option v-for="cls in classes" :key="cls.id" :value="cls.id">
|
||||
{{ cls.name }} ({{ cls.grade }})
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择学生" required v-if="createForm.targetType === 'STUDENT'">
|
||||
<a-select v-model:value="createForm.targetIds" mode="multiple" placeholder="请选择学生" style="width: 100%;"
|
||||
:filter-option="filterStudentOption" show-search>
|
||||
<a-select-option v-for="student in students" :key="student.id" :value="student.id">
|
||||
{{ student.name }} - {{ student.class?.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<template v-if="createForm.targetType === 'STUDENT'">
|
||||
<a-form-item label="选择班级" required>
|
||||
<a-select v-model:value="selectedClassIdForStudent" placeholder="请先选择班级" style="width: 100%;" allow-clear
|
||||
@change="onStudentClassChange">
|
||||
<a-select-option v-for="cls in classes" :key="cls.id" :value="cls.id">
|
||||
{{ cls.name }} ({{ cls.grade }})
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择学生" required>
|
||||
<a-select v-model:value="createForm.targetIds" mode="multiple" placeholder="请选择学生" style="width: 100%;"
|
||||
:filter-option="filterStudentOption" show-search :loading="studentsLoading"
|
||||
:disabled="!selectedClassIdForStudent">
|
||||
<a-select-option v-for="student in students" :key="student.id" :value="student.id">
|
||||
{{ student.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="关联课程">
|
||||
<a-select v-model:value="createForm.relatedCourseId" placeholder="可选,关联课程包" style="width: 100%;" allowClear
|
||||
show-search :filter-option="filterCourseOption">
|
||||
@ -269,8 +280,8 @@
|
||||
<a-tooltip :title="completion.parentFeedback || completion.feedback?.comment">
|
||||
<span class="feedback-text">{{ (completion.parentFeedback || completion.feedback?.comment ||
|
||||
'').substring(0, 30) }}{{ (completion.parentFeedback || completion.feedback?.comment || '').length >
|
||||
30
|
||||
? '...' : '' }}</span>
|
||||
30
|
||||
? '...' : '' }}</span>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<span v-else class="no-feedback">暂无反馈</span>
|
||||
@ -359,7 +370,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from 'vue';
|
||||
import { ref, reactive, onMounted, computed, watch } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import {
|
||||
CheckSquareOutlined,
|
||||
@ -395,7 +406,7 @@ import {
|
||||
updateCompletionFeedback,
|
||||
sendTaskReminder,
|
||||
getTeacherClasses,
|
||||
getTeacherStudents,
|
||||
getTeacherClassStudents,
|
||||
getTeacherCourses,
|
||||
getTaskTemplates,
|
||||
type TeacherTask,
|
||||
@ -438,6 +449,8 @@ const isEdit = ref(false);
|
||||
const editTaskId = ref<number | null>(null);
|
||||
const classes = ref<any[]>([]);
|
||||
const students = ref<any[]>([]);
|
||||
const studentsLoading = ref(false);
|
||||
const selectedClassIdForStudent = ref<number | undefined>();
|
||||
const courses = ref<any[]>([]);
|
||||
|
||||
// 模板相关
|
||||
@ -506,8 +519,8 @@ const getCompletedCount = (task: TeacherTask) => {
|
||||
};
|
||||
|
||||
const filterStudentOption = (input: string, option: any) => {
|
||||
const text = option.children[0].children.toLowerCase();
|
||||
return text.includes(input.toLowerCase());
|
||||
const student = students.value.find((s: any) => s.id === option.value);
|
||||
return student ? student.name.toLowerCase().includes(input.toLowerCase()) : false;
|
||||
};
|
||||
|
||||
const filterCourseOption = (input: string, option: any) => {
|
||||
@ -533,22 +546,68 @@ const loadTasks = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 加载班级、学生、课程
|
||||
// 目标类型切换时重置相关状态
|
||||
watch(() => createForm.targetType, () => {
|
||||
createForm.targetIds = [];
|
||||
selectedClassIdForStudent.value = undefined;
|
||||
students.value = [];
|
||||
});
|
||||
|
||||
// 加载班级、课程(学生按班级加载)
|
||||
const loadOptions = async () => {
|
||||
try {
|
||||
const [classesData, studentsData, coursesData] = await Promise.all([
|
||||
const [classesData, coursesData] = await Promise.all([
|
||||
getTeacherClasses(),
|
||||
getTeacherStudents({ pageNum: 1, pageSize: 500 }),
|
||||
getTeacherCourses({ pageNum: 1, pageSize: 100 }),
|
||||
]);
|
||||
classes.value = classesData;
|
||||
students.value = studentsData.items || [];
|
||||
courses.value = coursesData.items || [];
|
||||
} catch (error) {
|
||||
console.error('加载选项失败', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 选择班级后加载该班级学生(目标类型为学生时)
|
||||
const onStudentClassChange = async (value: unknown) => {
|
||||
const classId = value != null && !Number.isNaN(Number(value)) ? Number(value) : undefined;
|
||||
createForm.targetIds = [];
|
||||
if (!classId) {
|
||||
students.value = [];
|
||||
return;
|
||||
}
|
||||
studentsLoading.value = true;
|
||||
try {
|
||||
const res = await getTeacherClassStudents(classId, { pageNum: 1, pageSize: 500 });
|
||||
students.value = (res as any).list || res.items || [];
|
||||
} catch (error) {
|
||||
console.error('加载班级学生失败', error);
|
||||
students.value = [];
|
||||
} finally {
|
||||
studentsLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 编辑时加载所有班级学生(用于回显已选学生)
|
||||
const loadAllStudentsForEdit = async () => {
|
||||
studentsLoading.value = true;
|
||||
try {
|
||||
const allStudents: any[] = [];
|
||||
for (const cls of classes.value) {
|
||||
const res = await getTeacherClassStudents(cls.id, { pageNum: 1, pageSize: 500 });
|
||||
const items = (res as any).list || res.items || [];
|
||||
items.forEach((s: any) => {
|
||||
if (!allStudents.find(x => x.id === s.id)) allStudents.push({ ...s, class: { name: cls.name, grade: cls.grade } });
|
||||
});
|
||||
}
|
||||
students.value = allStudents;
|
||||
} catch (error) {
|
||||
console.error('加载学生失败', error);
|
||||
students.value = [];
|
||||
} finally {
|
||||
studentsLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const onPageChange = (page: number) => {
|
||||
currentPage.value = page;
|
||||
loadTasks();
|
||||
@ -567,10 +626,11 @@ const openCreateModal = async () => {
|
||||
createForm.relatedCourseId = undefined;
|
||||
createForm.relatedBookName = ''; // 重置绘本名称
|
||||
createForm.dateRange = null;
|
||||
selectedClassIdForStudent.value = undefined;
|
||||
students.value = [];
|
||||
createModalVisible.value = true;
|
||||
|
||||
// 加载模板列表
|
||||
await loadTemplates();
|
||||
await Promise.all([loadOptions(), loadTemplates()]);
|
||||
};
|
||||
|
||||
// 加载模板列表
|
||||
@ -624,24 +684,26 @@ const getTaskTypeText = (type: string) => {
|
||||
const openEditModal = async (task: TeacherTask) => {
|
||||
isEdit.value = true;
|
||||
editTaskId.value = task.id;
|
||||
selectedClassIdForStudent.value = undefined;
|
||||
createModalVisible.value = true;
|
||||
try {
|
||||
await loadOptions(); // 确保班级、学生、课程选项已加载
|
||||
await loadOptions();
|
||||
const detail = await getTeacherTask(task.id);
|
||||
// 详情接口返回字段映射到表单(与新增一致)
|
||||
createForm.title = detail.title || '';
|
||||
createForm.description = detail.description || '';
|
||||
createForm.taskType = (detail.type || detail.taskType || 'READING') as 'READING' | 'ACTIVITY' | 'HOMEWORK';
|
||||
createForm.targetType = (detail.targetType?.toUpperCase?.() || 'CLASS') as 'CLASS' | 'STUDENT';
|
||||
createForm.targetIds = detail.targetIds || [];
|
||||
// 关联课程:统一为 number,避免 API 返回 string 导致 a-select 无法匹配
|
||||
const rawCourseId = detail.courseId ?? detail.relatedCourseId;
|
||||
createForm.relatedCourseId = rawCourseId;
|
||||
createForm.relatedBookName = detail.relatedBookName || '';
|
||||
// 任务时间:dueDate 为空时用 startDate 作为结束日期,保证能回显
|
||||
createForm.dateRange = detail.startDate
|
||||
? [dayjs(detail.startDate), dayjs(detail.dueDate || detail.startDate)]
|
||||
: null;
|
||||
// 编辑学生任务时加载全部学生用于回显
|
||||
if (createForm.targetType === 'STUDENT' && createForm.targetIds.length > 0) {
|
||||
await loadAllStudentsForEdit();
|
||||
}
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '加载任务详情失败');
|
||||
createModalVisible.value = false;
|
||||
@ -656,7 +718,7 @@ const handleCreate = async () => {
|
||||
}
|
||||
|
||||
if (!isEdit.value && createForm.targetIds.length === 0) {
|
||||
message.warning('请选择目标班级或学生');
|
||||
message.warning(createForm.targetType === 'STUDENT' ? '请先选择班级并选择学生' : '请选择目标班级');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
package com.reading.platform.controller.parent;
|
||||
|
||||
import com.reading.platform.common.mapper.StudentMapper;
|
||||
import com.reading.platform.common.response.PageResult;
|
||||
import com.reading.platform.common.response.Result;
|
||||
import com.reading.platform.common.security.SecurityUtils;
|
||||
import com.reading.platform.dto.response.StudentResponse;
|
||||
import com.reading.platform.entity.Student;
|
||||
import com.reading.platform.service.StudentService;
|
||||
import com.reading.platform.dto.response.ChildInfoResponse;
|
||||
import com.reading.platform.dto.response.ChildProfileResponse;
|
||||
import com.reading.platform.dto.response.LessonRecordResponse;
|
||||
import com.reading.platform.common.annotation.RequireRole;
|
||||
import com.reading.platform.common.enums.UserRole;
|
||||
import com.reading.platform.service.ParentAuthService;
|
||||
import com.reading.platform.service.ParentChildService;
|
||||
import com.reading.platform.service.ParentLessonService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -17,30 +22,45 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/parent/children")
|
||||
@RequiredArgsConstructor
|
||||
@RequireRole(UserRole.PARENT)
|
||||
public class ParentChildController {
|
||||
|
||||
private final StudentService studentService;
|
||||
private final StudentMapper studentMapper;
|
||||
private final ParentChildService parentChildService;
|
||||
private final ParentAuthService parentAuthService;
|
||||
private final ParentLessonService parentLessonService;
|
||||
|
||||
@Operation(summary = "Get my children")
|
||||
@GetMapping
|
||||
public Result<List<StudentResponse>> getMyChildren() {
|
||||
public Result<List<ChildInfoResponse>> getMyChildren() {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
List<Student> students = studentService.getStudentsByParentId(parentId);
|
||||
return Result.success(studentMapper.toVO(students));
|
||||
List<ChildInfoResponse> children = parentChildService.getChildrenForParent(parentId);
|
||||
return Result.success(children);
|
||||
}
|
||||
|
||||
@Operation(summary = "Get child by ID")
|
||||
@GetMapping("/{id}")
|
||||
public Result<StudentResponse> getChild(@PathVariable Long id) {
|
||||
Student student = studentService.getStudentById(id);
|
||||
return Result.success(studentMapper.toVO(student));
|
||||
public Result<ChildProfileResponse> getChild(@PathVariable Long id) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
ChildProfileResponse profile = parentChildService.getChildProfile(parentId, id);
|
||||
return Result.success(profile);
|
||||
}
|
||||
|
||||
@Operation(summary = "Get child lesson records (reading history)")
|
||||
@GetMapping("/{id}/lessons")
|
||||
public Result<PageResult<LessonRecordResponse>> getChildLessons(
|
||||
@PathVariable Long id,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentStudentRelation(parentId, id);
|
||||
PageResult<LessonRecordResponse> result = parentLessonService.getLessonsByStudentId(id, parentId, pageNum, pageSize);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "Get child growth records")
|
||||
@GetMapping("/{id}/growth")
|
||||
public Result<Object> getChildGrowth(@PathVariable Long id) {
|
||||
// TODO: 实现获取成长记录
|
||||
// 已迁移至 ParentGrowthController: GET /parent/growth-records/student/:studentId
|
||||
return Result.success(null);
|
||||
}
|
||||
|
||||
|
||||
@ -1,81 +1,114 @@
|
||||
package com.reading.platform.controller.parent;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.reading.platform.common.mapper.GrowthRecordMapper;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.reading.platform.entity.Clazz;
|
||||
import com.reading.platform.entity.GrowthRecord;
|
||||
import com.reading.platform.common.response.PageResult;
|
||||
import com.reading.platform.common.response.Result;
|
||||
import com.reading.platform.common.security.SecurityUtils;
|
||||
import com.reading.platform.dto.request.GrowthRecordCreateRequest;
|
||||
import com.reading.platform.dto.request.GrowthRecordUpdateRequest;
|
||||
import com.reading.platform.dto.response.GrowthRecordResponse;
|
||||
import com.reading.platform.entity.GrowthRecord;
|
||||
import com.reading.platform.dto.response.GrowthRecordForParentResponse;
|
||||
import com.reading.platform.common.annotation.RequireRole;
|
||||
import com.reading.platform.common.enums.UserRole;
|
||||
import com.reading.platform.service.ClassService;
|
||||
import com.reading.platform.service.GrowthRecordService;
|
||||
import com.reading.platform.service.ParentAuthService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "Parent - Growth Record", description = "Growth Record APIs for Parent")
|
||||
/**
|
||||
* 家长端成长档案 - 只读
|
||||
* 家长仅可查看孩子的成长档案,不可创建/修改/删除
|
||||
* 返回格式对齐前端 GrowthRecord:images 为数组,recordType,class
|
||||
*/
|
||||
@Tag(name = "Parent - Growth Record", description = "Growth Record APIs for Parent (read-only)")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/parent/growth-records")
|
||||
@RequiredArgsConstructor
|
||||
@RequireRole(UserRole.PARENT)
|
||||
public class ParentGrowthController {
|
||||
|
||||
private final GrowthRecordService growthRecordService;
|
||||
private final GrowthRecordMapper growthRecordMapper;
|
||||
|
||||
@Operation(summary = "Create growth record")
|
||||
@PostMapping
|
||||
public Result<GrowthRecordResponse> createGrowthRecord(@Valid @RequestBody GrowthRecordCreateRequest request) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
Long userId = SecurityUtils.getCurrentUserId();
|
||||
GrowthRecord record = growthRecordService.createGrowthRecord(tenantId, userId, "parent", request);
|
||||
return Result.success(growthRecordMapper.toVO(record));
|
||||
}
|
||||
|
||||
@Operation(summary = "Update growth record")
|
||||
@PutMapping("/{id}")
|
||||
public Result<GrowthRecordResponse> updateGrowthRecord(@PathVariable Long id, @RequestBody GrowthRecordUpdateRequest request) {
|
||||
GrowthRecord record = growthRecordService.updateGrowthRecord(id, request);
|
||||
return Result.success(growthRecordMapper.toVO(record));
|
||||
}
|
||||
private final ParentAuthService parentAuthService;
|
||||
private final ClassService classService;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
@Operation(summary = "Get growth record by ID")
|
||||
@GetMapping("/{id}")
|
||||
public Result<GrowthRecordResponse> getGrowthRecord(@PathVariable Long id) {
|
||||
public Result<GrowthRecordForParentResponse> getGrowthRecord(@PathVariable Long id) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
GrowthRecord record = growthRecordService.getGrowthRecordById(id);
|
||||
return Result.success(growthRecordMapper.toVO(record));
|
||||
parentAuthService.validateParentStudentRelation(parentId, record.getStudentId());
|
||||
return Result.success(toParentResponse(record));
|
||||
}
|
||||
|
||||
@Operation(summary = "Get growth records by student ID")
|
||||
@GetMapping("/student/{studentId}")
|
||||
public Result<PageResult<GrowthRecordResponse>> getGrowthRecordsByStudent(
|
||||
public Result<PageResult<GrowthRecordForParentResponse>> getGrowthRecordsByStudent(
|
||||
@PathVariable Long studentId,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) String type) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentStudentRelation(parentId, studentId);
|
||||
Page<GrowthRecord> page = growthRecordService.getGrowthRecordsByStudentId(studentId, pageNum, pageSize, type);
|
||||
List<GrowthRecordResponse> voList = growthRecordMapper.toVO(page.getRecords());
|
||||
List<GrowthRecordForParentResponse> voList = page.getRecords().stream()
|
||||
.map(this::toParentResponse)
|
||||
.toList();
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
}
|
||||
|
||||
@Operation(summary = "Get recent growth records")
|
||||
@GetMapping("/student/{studentId}/recent")
|
||||
public Result<List<GrowthRecordResponse>> getRecentGrowthRecords(
|
||||
public Result<List<GrowthRecordForParentResponse>> getRecentGrowthRecords(
|
||||
@PathVariable Long studentId,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer limit) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentStudentRelation(parentId, studentId);
|
||||
List<GrowthRecord> records = growthRecordService.getRecentGrowthRecords(studentId, limit);
|
||||
return Result.success(growthRecordMapper.toVO(records));
|
||||
return Result.success(records.stream().map(this::toParentResponse).toList());
|
||||
}
|
||||
|
||||
@Operation(summary = "Delete growth record")
|
||||
@DeleteMapping("/{id}")
|
||||
public Result<Void> deleteGrowthRecord(@PathVariable Long id) {
|
||||
growthRecordService.deleteGrowthRecord(id);
|
||||
return Result.success();
|
||||
private GrowthRecordForParentResponse toParentResponse(GrowthRecord record) {
|
||||
List<String> images = parseImages(record.getImages());
|
||||
GrowthRecordForParentResponse.ClassInfo classInfo = null;
|
||||
if (record.getStudentId() != null) {
|
||||
Clazz clazz = classService.getPrimaryClassByStudentId(record.getStudentId());
|
||||
if (clazz != null) {
|
||||
classInfo = GrowthRecordForParentResponse.ClassInfo.builder()
|
||||
.id(clazz.getId())
|
||||
.name(clazz.getName())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
return GrowthRecordForParentResponse.builder()
|
||||
.id(record.getId())
|
||||
.title(record.getTitle())
|
||||
.content(record.getContent())
|
||||
.images(images)
|
||||
.recordDate(record.getRecordDate())
|
||||
.recordType(record.getType())
|
||||
.classInfo(classInfo)
|
||||
.createdAt(record.getCreatedAt())
|
||||
.build();
|
||||
}
|
||||
|
||||
private List<String> parseImages(String imagesJson) {
|
||||
if (!StringUtils.hasText(imagesJson)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
return objectMapper.readValue(imagesJson, new TypeReference<List<String>>() {});
|
||||
} catch (Exception e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
package com.reading.platform.controller.parent;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.reading.platform.common.mapper.NotificationMapper;
|
||||
import com.reading.platform.common.response.PageResult;
|
||||
import com.reading.platform.common.response.Result;
|
||||
import com.reading.platform.common.security.SecurityUtils;
|
||||
import com.reading.platform.dto.response.NotificationResponse;
|
||||
import com.reading.platform.dto.response.NotificationForParentResponse;
|
||||
import com.reading.platform.entity.Notification;
|
||||
import com.reading.platform.common.annotation.RequireRole;
|
||||
import com.reading.platform.common.enums.UserRole;
|
||||
import com.reading.platform.service.NotificationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -14,35 +15,51 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Tag(name = "Parent - Notification", description = "Notification APIs for Parent")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/parent/notifications")
|
||||
@RequiredArgsConstructor
|
||||
@RequireRole(UserRole.PARENT)
|
||||
public class ParentNotificationController {
|
||||
|
||||
private final NotificationService notificationService;
|
||||
private final NotificationMapper notificationMapper;
|
||||
|
||||
@Operation(summary = "Get notification by ID")
|
||||
@GetMapping("/{id}")
|
||||
public Result<NotificationResponse> getNotification(@PathVariable Long id) {
|
||||
public Result<NotificationForParentResponse> getNotification(@PathVariable Long id) {
|
||||
Notification notification = notificationService.getNotificationById(id);
|
||||
return Result.success(notificationMapper.toVO(notification));
|
||||
return Result.success(toParentResponse(notification));
|
||||
}
|
||||
|
||||
@Operation(summary = "Get my notifications")
|
||||
@GetMapping
|
||||
public Result<PageResult<NotificationResponse>> getMyNotifications(
|
||||
public Result<PageResult<NotificationForParentResponse>> getMyNotifications(
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) Integer isRead) {
|
||||
@RequestParam(required = false) Integer isRead,
|
||||
@RequestParam(required = false) String notificationType) {
|
||||
Long userId = SecurityUtils.getCurrentUserId();
|
||||
Page<Notification> page = notificationService.getMyNotifications(userId, "parent", pageNum, pageSize, isRead);
|
||||
List<NotificationResponse> voList = notificationMapper.toVO(page.getRecords());
|
||||
Page<Notification> page = notificationService.getMyNotifications(userId, "parent", pageNum, pageSize, isRead, notificationType);
|
||||
List<NotificationForParentResponse> voList = page.getRecords().stream()
|
||||
.map(this::toParentResponse)
|
||||
.collect(Collectors.toList());
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
}
|
||||
|
||||
private NotificationForParentResponse toParentResponse(Notification n) {
|
||||
return NotificationForParentResponse.builder()
|
||||
.id(n.getId())
|
||||
.title(n.getTitle())
|
||||
.content(n.getContent())
|
||||
.notificationType(n.getType())
|
||||
.isRead(n.getIsRead() != null && n.getIsRead() == 1)
|
||||
.readAt(n.getReadAt())
|
||||
.createdAt(n.getCreatedAt())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Operation(summary = "Mark notification as read")
|
||||
@PostMapping("/{id}/read")
|
||||
public Result<Void> markAsRead(@PathVariable Long id) {
|
||||
|
||||
@ -1,15 +1,21 @@
|
||||
package com.reading.platform.controller.parent;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.reading.platform.common.mapper.TaskMapper;
|
||||
import com.reading.platform.common.response.PageResult;
|
||||
import com.reading.platform.common.response.Result;
|
||||
import com.reading.platform.common.security.SecurityUtils;
|
||||
import com.reading.platform.dto.request.TaskCompleteRequest;
|
||||
import com.reading.platform.dto.request.TaskSubmitRequest;
|
||||
import com.reading.platform.dto.response.TaskCompletionDetailResponse;
|
||||
import com.reading.platform.dto.response.TaskFeedbackResponse;
|
||||
import com.reading.platform.dto.response.TaskResponse;
|
||||
import com.reading.platform.dto.response.TaskWithCompletionResponse;
|
||||
import com.reading.platform.entity.Task;
|
||||
import com.reading.platform.common.annotation.RequireRole;
|
||||
import com.reading.platform.common.enums.ErrorCode;
|
||||
import com.reading.platform.common.enums.UserRole;
|
||||
import com.reading.platform.common.exception.BusinessException;
|
||||
import com.reading.platform.service.ParentAuthService;
|
||||
import com.reading.platform.service.TaskFeedbackService;
|
||||
import com.reading.platform.service.TaskService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -24,11 +30,13 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/parent/tasks")
|
||||
@RequiredArgsConstructor
|
||||
@RequireRole(UserRole.PARENT)
|
||||
public class ParentTaskController {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final TaskMapper taskMapper;
|
||||
private final TaskFeedbackService taskFeedbackService;
|
||||
private final ParentAuthService parentAuthService;
|
||||
|
||||
@Operation(summary = "获取任务详情")
|
||||
@GetMapping("/{id}")
|
||||
@ -37,27 +45,28 @@ public class ParentTaskController {
|
||||
return Result.success(taskMapper.toVO(task));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取孩子的任务列表")
|
||||
@Operation(summary = "获取孩子的任务列表(含完成信息与教师评价)")
|
||||
@GetMapping("/student/{studentId}")
|
||||
public Result<PageResult<TaskResponse>> getTasksByStudent(
|
||||
public Result<PageResult<TaskWithCompletionResponse>> getTasksByStudent(
|
||||
@PathVariable Long studentId,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) String status) {
|
||||
Page<Task> page = taskService.getTasksByStudentId(studentId, pageNum, pageSize, status);
|
||||
List<TaskResponse> voList = taskMapper.toVO(page.getRecords());
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentStudentRelation(parentId, studentId);
|
||||
PageResult<TaskWithCompletionResponse> result = taskService.getTasksWithCompletionByStudentId(studentId, pageNum, pageSize, status);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取我的任务列表")
|
||||
@Operation(summary = "获取我的任务列表(聚合多孩子任务)")
|
||||
@GetMapping
|
||||
public Result<PageResult<TaskResponse>> getMyTasks(
|
||||
public Result<PageResult<TaskWithCompletionResponse>> getMyTasks(
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) String status) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
// TODO: 根据 parentId 获取关联学生的任务列表
|
||||
return Result.success(PageResult.of(List.of(), 0L, Long.valueOf(pageNum == null ? 1 : pageNum), Long.valueOf(pageSize == null ? 10 : pageSize)));
|
||||
PageResult<TaskWithCompletionResponse> result = taskService.getMyTasksForParent(parentId, pageNum, pageSize, status);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
// =============== 提交与评价 API ===============
|
||||
@ -67,6 +76,8 @@ public class ParentTaskController {
|
||||
public Result<TaskCompletionDetailResponse> submitTask(
|
||||
@PathVariable Long taskId,
|
||||
@Valid @RequestBody TaskSubmitRequest request) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentStudentRelation(parentId, request.getStudentId());
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
TaskCompletionDetailResponse response = taskService.submitTaskCompletion(taskId, request, tenantId);
|
||||
return Result.success(response);
|
||||
@ -77,6 +88,8 @@ public class ParentTaskController {
|
||||
public Result<TaskCompletionDetailResponse> updateSubmission(
|
||||
@PathVariable Long taskId,
|
||||
@Valid @RequestBody TaskSubmitRequest request) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentStudentRelation(parentId, request.getStudentId());
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
TaskCompletionDetailResponse response = taskService.submitTaskCompletion(taskId, request, tenantId);
|
||||
return Result.success(response);
|
||||
@ -85,6 +98,8 @@ public class ParentTaskController {
|
||||
@Operation(summary = "获取教师评价")
|
||||
@GetMapping("/completions/{completionId}/feedback")
|
||||
public Result<TaskFeedbackResponse> getFeedback(@PathVariable Long completionId) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentCanAccessCompletion(parentId, completionId);
|
||||
TaskFeedbackResponse response = taskFeedbackService.getFeedbackByCompletionId(completionId);
|
||||
return Result.success(response);
|
||||
}
|
||||
@ -92,6 +107,8 @@ public class ParentTaskController {
|
||||
@Operation(summary = "获取提交详情")
|
||||
@GetMapping("/completions/{completionId}")
|
||||
public Result<TaskCompletionDetailResponse> getCompletionDetail(@PathVariable Long completionId) {
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentCanAccessCompletion(parentId, completionId);
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
TaskCompletionDetailResponse response = taskService.getCompletionDetail(completionId, tenantId);
|
||||
return Result.success(response);
|
||||
@ -99,14 +116,23 @@ public class ParentTaskController {
|
||||
|
||||
// =============== 兼容旧接口 ===============
|
||||
|
||||
@Operation(summary = "完成任务(旧接口,兼容使用)")
|
||||
@Operation(summary = "完成任务(旧接口,兼容使用,支持 JSON body)")
|
||||
@PostMapping("/{id}/complete")
|
||||
public Result<Void> completeTask(
|
||||
@PathVariable Long id,
|
||||
@RequestParam Long studentId,
|
||||
@RequestBody(required = false) TaskCompleteRequest body,
|
||||
@RequestParam(required = false) Long studentId,
|
||||
@RequestParam(required = false) String content,
|
||||
@RequestParam(required = false) String attachments) {
|
||||
taskService.completeTask(id, studentId, content, attachments);
|
||||
Long sid = (body != null && body.getStudentId() != null) ? body.getStudentId() : studentId;
|
||||
String cnt = (body != null && body.getContent() != null) ? body.getContent() : content;
|
||||
String att = (body != null && body.getAttachments() != null) ? body.getAttachments() : attachments;
|
||||
if (sid == null) {
|
||||
throw new BusinessException(ErrorCode.INVALID_PARAMETER, "学生ID不能为空");
|
||||
}
|
||||
Long parentId = SecurityUtils.getCurrentUserId();
|
||||
parentAuthService.validateParentStudentRelation(parentId, sid);
|
||||
taskService.completeTask(id, sid, cnt, att);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@ -1,24 +1,34 @@
|
||||
package com.reading.platform.controller.school;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.reading.platform.common.mapper.ClassMapper;
|
||||
import com.reading.platform.common.mapper.ClassTeacherMapper;
|
||||
import com.reading.platform.common.response.PageResult;
|
||||
import com.reading.platform.common.response.Result;
|
||||
import com.reading.platform.common.security.SecurityUtils;
|
||||
import com.reading.platform.dto.request.ClassCreateRequest;
|
||||
import com.reading.platform.dto.request.ClassUpdateRequest;
|
||||
import com.reading.platform.common.mapper.StudentMapper;
|
||||
import com.reading.platform.dto.response.ClassResponse;
|
||||
import com.reading.platform.dto.response.ClassTeacherResponse;
|
||||
import com.reading.platform.dto.response.StudentResponse;
|
||||
import com.reading.platform.entity.Clazz;
|
||||
import com.reading.platform.entity.ClassTeacher;
|
||||
import com.reading.platform.entity.Lesson;
|
||||
import com.reading.platform.entity.Student;
|
||||
import com.reading.platform.entity.Teacher;
|
||||
import com.reading.platform.mapper.ClassTeacherMapper;
|
||||
import com.reading.platform.mapper.LessonMapper;
|
||||
import com.reading.platform.service.ClassService;
|
||||
import com.reading.platform.service.StudentService;
|
||||
import com.reading.platform.service.TeacherService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "School - Class", description = "Class Management APIs for School")
|
||||
@ -30,6 +40,10 @@ public class SchoolClassController {
|
||||
private final ClassService classService;
|
||||
private final ClassMapper classMapper;
|
||||
private final ClassTeacherMapper classTeacherMapper;
|
||||
private final StudentService studentService;
|
||||
private final StudentMapper studentMapper;
|
||||
private final TeacherService teacherService;
|
||||
private final LessonMapper lessonMapper;
|
||||
|
||||
@Operation(summary = "Create class")
|
||||
@PostMapping
|
||||
@ -59,13 +73,40 @@ public class SchoolClassController {
|
||||
@GetMapping
|
||||
public Result<PageResult<ClassResponse>> getClassPage(
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false, defaultValue = "100") Integer pageSize,
|
||||
@RequestParam(required = false) String keyword,
|
||||
@RequestParam(required = false) String grade,
|
||||
@RequestParam(required = false) String status) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
Page<Clazz> page = classService.getClassPage(tenantId, pageNum, pageSize, keyword, grade, status);
|
||||
List<ClassResponse> voList = classMapper.toVO(page.getRecords());
|
||||
for (ClassResponse vo : voList) {
|
||||
int studentCount = studentService.getStudentListByClassId(vo.getId()).size();
|
||||
long lessonCount = 0;
|
||||
try {
|
||||
lessonCount = lessonMapper.selectCount(
|
||||
new LambdaQueryWrapper<Lesson>().eq(Lesson::getClassId, vo.getId()));
|
||||
} catch (Exception ignored) {}
|
||||
vo.setStudentCount(studentCount);
|
||||
vo.setLessonCount((int) lessonCount);
|
||||
|
||||
List<ClassTeacher> classTeachers = classTeacherMapper.selectList(
|
||||
new LambdaQueryWrapper<ClassTeacher>().eq(ClassTeacher::getClassId, vo.getId()));
|
||||
List<ClassTeacherResponse> teacherList = new ArrayList<>();
|
||||
for (ClassTeacher ct : classTeachers) {
|
||||
Teacher t = teacherService.getTeacherById(ct.getTeacherId());
|
||||
teacherList.add(ClassTeacherResponse.builder()
|
||||
.id(ct.getId())
|
||||
.classId(ct.getClassId())
|
||||
.teacherId(ct.getTeacherId())
|
||||
.role(ct.getRole())
|
||||
.teacherName(t != null ? t.getName() : null)
|
||||
.isPrimary("班主任".equals(ct.getRole()) || "主班".equals(ct.getRole()))
|
||||
.createdAt(ct.getCreatedAt())
|
||||
.build());
|
||||
}
|
||||
vo.setTeachers(teacherList);
|
||||
}
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
}
|
||||
|
||||
@ -95,25 +136,39 @@ public class SchoolClassController {
|
||||
|
||||
@Operation(summary = "Get students of class")
|
||||
@GetMapping("/{id}/students")
|
||||
public Result<PageResult<ClassResponse>> getClassStudents(
|
||||
public Result<PageResult<StudentResponse>> getClassStudents(
|
||||
@PathVariable Long id,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize) {
|
||||
// 验证班级属于当前租户
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
classService.getClassByIdWithTenantCheck(id, tenantId);
|
||||
// TODO: 实现获取班级学生
|
||||
return Result.success(PageResult.of(List.of(), 0L, Long.valueOf(pageNum == null ? 1 : pageNum), Long.valueOf(pageSize == null ? 10 : pageSize)));
|
||||
Page<Student> page = studentService.getStudentsByClassId(id, pageNum, pageSize, keyword);
|
||||
List<StudentResponse> voList = studentMapper.toVO(page.getRecords());
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
}
|
||||
|
||||
@Operation(summary = "Get teachers of class")
|
||||
@GetMapping("/{id}/teachers")
|
||||
public Result<List<ClassTeacherResponse>> getClassTeachers(@PathVariable Long id) {
|
||||
// 验证班级属于当前租户
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
classService.getClassByIdWithTenantCheck(id, tenantId);
|
||||
// TODO: 实现获取班级教师
|
||||
return Result.success(List.of());
|
||||
List<ClassTeacher> classTeachers = classTeacherMapper.selectList(
|
||||
new LambdaQueryWrapper<ClassTeacher>().eq(ClassTeacher::getClassId, id));
|
||||
List<ClassTeacherResponse> teacherList = new ArrayList<>();
|
||||
for (ClassTeacher ct : classTeachers) {
|
||||
Teacher t = teacherService.getTeacherById(ct.getTeacherId());
|
||||
teacherList.add(ClassTeacherResponse.builder()
|
||||
.id(ct.getId())
|
||||
.classId(ct.getClassId())
|
||||
.teacherId(ct.getTeacherId())
|
||||
.role(ct.getRole())
|
||||
.teacherName(t != null ? t.getName() : null)
|
||||
.isPrimary("班主任".equals(ct.getRole()) || "主班".equals(ct.getRole()))
|
||||
.createdAt(ct.getCreatedAt())
|
||||
.build());
|
||||
}
|
||||
return Result.success(teacherList);
|
||||
}
|
||||
|
||||
@Operation(summary = "Update class teacher role")
|
||||
|
||||
@ -1,16 +1,20 @@
|
||||
package com.reading.platform.controller.school;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.reading.platform.common.mapper.ParentMapper;
|
||||
import com.reading.platform.common.mapper.ParentStudentMapper;
|
||||
import com.reading.platform.mapper.ParentStudentMapper;
|
||||
import com.reading.platform.common.response.PageResult;
|
||||
import com.reading.platform.common.response.Result;
|
||||
import com.reading.platform.common.security.SecurityUtils;
|
||||
import com.reading.platform.dto.request.ParentCreateRequest;
|
||||
import com.reading.platform.dto.request.ParentUpdateRequest;
|
||||
import com.reading.platform.dto.response.ChildInfoResponse;
|
||||
import com.reading.platform.dto.response.ParentResponse;
|
||||
import com.reading.platform.dto.response.ParentStudentResponse;
|
||||
import com.reading.platform.entity.Parent;
|
||||
import com.reading.platform.entity.ParentStudent;
|
||||
import com.reading.platform.service.ParentChildService;
|
||||
import com.reading.platform.service.ParentService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -27,6 +31,7 @@ import java.util.List;
|
||||
public class SchoolParentController {
|
||||
|
||||
private final ParentService parentService;
|
||||
private final ParentChildService parentChildService;
|
||||
private final ParentMapper parentMapper;
|
||||
private final ParentStudentMapper parentStudentMapper;
|
||||
|
||||
@ -64,6 +69,12 @@ public class SchoolParentController {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
Page<Parent> page = parentService.getParentPage(tenantId, pageNum, pageSize, keyword, status);
|
||||
List<ParentResponse> voList = parentMapper.toVO(page.getRecords());
|
||||
for (ParentResponse vo : voList) {
|
||||
long count = parentStudentMapper.selectCount(
|
||||
new LambdaQueryWrapper<ParentStudent>()
|
||||
.eq(ParentStudent::getParentId, vo.getId()));
|
||||
vo.setChildrenCount((int) count);
|
||||
}
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
}
|
||||
|
||||
@ -95,6 +106,29 @@ public class SchoolParentController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "Add child to parent (alias for bind student)")
|
||||
@PostMapping("/{parentId}/children/{studentId}")
|
||||
public Result<Void> addChild(
|
||||
@PathVariable Long parentId,
|
||||
@PathVariable Long studentId,
|
||||
@RequestBody(required = false) java.util.Map<String, Object> body) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
String relationship = null;
|
||||
Boolean isPrimary = null;
|
||||
if (body != null) {
|
||||
if (body.containsKey("relationship")) {
|
||||
Object v = body.get("relationship");
|
||||
relationship = v != null ? v.toString() : null;
|
||||
}
|
||||
if (body.containsKey("isPrimary")) {
|
||||
Object v = body.get("isPrimary");
|
||||
isPrimary = v instanceof Boolean ? (Boolean) v : (v != null && Boolean.parseBoolean(v.toString()));
|
||||
}
|
||||
}
|
||||
parentService.bindStudentWithTenantCheck(parentId, studentId, tenantId, relationship, isPrimary);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "Unbind student from parent")
|
||||
@DeleteMapping("/{parentId}/students/{studentId}")
|
||||
public Result<Void> unbindStudent(@PathVariable Long parentId, @PathVariable Long studentId) {
|
||||
@ -103,11 +137,21 @@ public class SchoolParentController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "Remove child from parent (alias for unbind student)")
|
||||
@DeleteMapping("/{parentId}/children/{studentId}")
|
||||
public Result<Void> removeChild(@PathVariable Long parentId, @PathVariable Long studentId) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
parentService.unbindStudentWithTenantCheck(parentId, studentId, tenantId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "Get children of parent")
|
||||
@GetMapping("/{id}/children")
|
||||
public Result<List<ParentStudentResponse>> getParentChildren(@PathVariable Long id) {
|
||||
// TODO: 实现获取家长孩子列表
|
||||
return Result.success(List.of());
|
||||
public Result<List<ChildInfoResponse>> getParentChildren(@PathVariable Long id) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
parentService.getParentByIdWithTenantCheck(id, tenantId);
|
||||
List<ChildInfoResponse> children = parentChildService.getChildrenForParent(id);
|
||||
return Result.success(children);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import com.reading.platform.dto.request.StudentCreateRequest;
|
||||
import com.reading.platform.dto.request.StudentUpdateRequest;
|
||||
import com.reading.platform.dto.response.StudentResponse;
|
||||
import com.reading.platform.entity.Student;
|
||||
import com.reading.platform.service.ClassService;
|
||||
import com.reading.platform.service.StudentService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -25,6 +26,7 @@ import java.util.List;
|
||||
public class SchoolStudentController {
|
||||
|
||||
private final StudentService studentService;
|
||||
private final ClassService classService;
|
||||
private final StudentMapper studentMapper;
|
||||
|
||||
@Operation(summary = "Create student")
|
||||
@ -48,7 +50,10 @@ public class SchoolStudentController {
|
||||
public Result<StudentResponse> getStudent(@PathVariable Long id) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
Student student = studentService.getStudentByIdWithTenantCheck(id, tenantId);
|
||||
return Result.success(studentMapper.toVO(student));
|
||||
StudentResponse vo = studentMapper.toVO(student);
|
||||
var clazz = classService.getPrimaryClassByStudentId(id);
|
||||
vo.setClassId(clazz != null ? clazz.getId() : null);
|
||||
return Result.success(vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "Get student page")
|
||||
@ -58,10 +63,15 @@ public class SchoolStudentController {
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) String keyword,
|
||||
@RequestParam(required = false) String grade,
|
||||
@RequestParam(required = false) String status) {
|
||||
@RequestParam(required = false) String status,
|
||||
@RequestParam(required = false) Long classId) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
Page<Student> page = studentService.getStudentPage(tenantId, pageNum, pageSize, keyword, grade, status);
|
||||
Page<Student> page = studentService.getStudentPage(tenantId, pageNum, pageSize, keyword, grade, status, classId);
|
||||
List<StudentResponse> voList = studentMapper.toVO(page.getRecords());
|
||||
for (StudentResponse vo : voList) {
|
||||
var clazz = classService.getPrimaryClassByStudentId(vo.getId());
|
||||
vo.setClassId(clazz != null ? clazz.getId() : null);
|
||||
}
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.reading.platform.controller.teacher;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.reading.platform.common.enums.CourseStatus;
|
||||
import com.reading.platform.common.mapper.ClassMapper;
|
||||
@ -10,16 +11,18 @@ import com.reading.platform.common.response.PageResult;
|
||||
import com.reading.platform.common.response.Result;
|
||||
import com.reading.platform.common.security.SecurityUtils;
|
||||
import com.reading.platform.dto.response.ClassResponse;
|
||||
import com.reading.platform.dto.response.ClassStudentsResponse;
|
||||
import com.reading.platform.dto.response.CourseResponse;
|
||||
import com.reading.platform.dto.response.LessonTagResponse;
|
||||
import com.reading.platform.dto.response.StudentResponse;
|
||||
import com.reading.platform.dto.response.TeacherResponse;
|
||||
import com.reading.platform.entity.ClassTeacher;
|
||||
import com.reading.platform.entity.Clazz;
|
||||
import com.reading.platform.entity.Lesson;
|
||||
import com.reading.platform.entity.CoursePackage;
|
||||
import com.reading.platform.entity.Student;
|
||||
import com.reading.platform.entity.Teacher;
|
||||
import com.reading.platform.entity.CourseLesson;
|
||||
import com.reading.platform.mapper.LessonMapper;
|
||||
import com.reading.platform.service.ClassService;
|
||||
import com.reading.platform.service.CourseLessonService;
|
||||
import com.reading.platform.service.CoursePackageService;
|
||||
@ -50,13 +53,45 @@ public class TeacherCourseController {
|
||||
private final ClassMapper classMapper;
|
||||
private final StudentMapper studentMapper;
|
||||
private final TeacherMapper teacherMapper;
|
||||
private final LessonMapper lessonMapper;
|
||||
|
||||
@Operation(summary = "获取教师的班级列表")
|
||||
@GetMapping("/classes")
|
||||
public Result<List<ClassResponse>> getClasses() {
|
||||
Long teacherId = SecurityUtils.getCurrentUserId();
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
List<Clazz> classes = classService.getActiveClassesByTenantId(tenantId);
|
||||
return Result.success(classMapper.toVO(classes));
|
||||
List<Clazz> classes = classService.getClassesByTeacherId(teacherId, tenantId);
|
||||
|
||||
List<ClassResponse> voList = classMapper.toVO(classes);
|
||||
for (ClassResponse vo : voList) {
|
||||
int studentCount = studentService.getStudentListByClassId(vo.getId()).size();
|
||||
long lessonCount = 0;
|
||||
try {
|
||||
lessonCount = lessonMapper.selectCount(
|
||||
new LambdaQueryWrapper<Lesson>().eq(Lesson::getClassId, vo.getId()));
|
||||
} catch (Exception e) {
|
||||
// 忽略 lesson 表不存在等异常
|
||||
}
|
||||
String role = classService.getTeacherRoleInClass(vo.getId(), teacherId);
|
||||
vo.setStudentCount(studentCount);
|
||||
vo.setLessonCount((int) lessonCount);
|
||||
vo.setMyRole(mapRoleToFrontend(role));
|
||||
vo.setIsPrimary(isPrimaryRole(role));
|
||||
}
|
||||
return Result.success(voList);
|
||||
}
|
||||
|
||||
private static String mapRoleToFrontend(String role) {
|
||||
if (role == null) return "ASSIST";
|
||||
return switch (role) {
|
||||
case "班主任", "主班" -> "MAIN";
|
||||
case "保育员" -> "CARE";
|
||||
default -> "ASSIST";
|
||||
};
|
||||
}
|
||||
|
||||
private static boolean isPrimaryRole(String role) {
|
||||
return role != null && ("班主任".equals(role) || "主班".equals(role));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据 ID 获取课程")
|
||||
@ -138,14 +173,41 @@ public class TeacherCourseController {
|
||||
|
||||
@Operation(summary = "获取班级学生列表")
|
||||
@GetMapping("/classes/{id}/students")
|
||||
public Result<PageResult<StudentResponse>> getClassStudents(
|
||||
public Result<ClassStudentsResponse> getClassStudents(
|
||||
@PathVariable Long id,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
Page<Student> page = studentService.getStudentsByClassId(id, pageNum, pageSize);
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
Clazz clazz = classService.getClassByIdWithTenantCheck(id, tenantId);
|
||||
Page<Student> page = studentService.getStudentsByClassId(id, pageNum, pageSize, keyword);
|
||||
List<StudentResponse> voList = studentMapper.toVO(page.getRecords());
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
|
||||
int studentCount = studentService.getStudentListByClassId(id).size();
|
||||
long lessonCount = 0;
|
||||
try {
|
||||
lessonCount = lessonMapper.selectCount(
|
||||
new LambdaQueryWrapper<Lesson>().eq(Lesson::getClassId, id));
|
||||
} catch (Exception e) {
|
||||
// 忽略 lesson 表不存在等异常
|
||||
}
|
||||
|
||||
ClassStudentsResponse.ClassInfo classInfo = ClassStudentsResponse.ClassInfo.builder()
|
||||
.id(clazz.getId())
|
||||
.name(clazz.getName())
|
||||
.grade(clazz.getGrade())
|
||||
.studentCount(studentCount)
|
||||
.lessonCount((int) lessonCount)
|
||||
.build();
|
||||
|
||||
ClassStudentsResponse response = ClassStudentsResponse.builder()
|
||||
.list(voList)
|
||||
.total(page.getTotal())
|
||||
.pageNum(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.classInfo(classInfo)
|
||||
.build();
|
||||
return Result.success(response);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取班级教师列表")
|
||||
|
||||
@ -66,9 +66,13 @@ public class TeacherTaskController {
|
||||
@RequestParam(required = false) String taskType,
|
||||
@RequestParam(required = false) String status) {
|
||||
Long tenantId = SecurityUtils.getCurrentTenantId();
|
||||
Long teacherId = SecurityUtils.getCurrentUserId();
|
||||
String typeFilter = (type != null && !type.isEmpty()) ? type : taskType;
|
||||
Page<Task> page = taskService.getTaskPage(tenantId, pageNum, pageSize, keyword, typeFilter, status);
|
||||
Page<Task> page = taskService.getTaskPage(tenantId, pageNum, pageSize, keyword, typeFilter, status, teacherId);
|
||||
List<TaskResponse> voList = taskMapper.toVO(page.getRecords());
|
||||
for (int i = 0; i < voList.size(); i++) {
|
||||
taskService.enrichTaskResponseWithStats(voList.get(i), page.getRecords().get(i).getId());
|
||||
}
|
||||
return Result.success(PageResult.of(voList, page.getTotal(), page.getCurrent(), page.getSize()));
|
||||
}
|
||||
|
||||
|
||||
@ -39,4 +39,7 @@ public class StudentUpdateRequest {
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "所在班级 ID,更新时调用 assignStudents 调整班级")
|
||||
private Long classId;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package com.reading.platform.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 任务完成请求(旧接口,兼容家长端 JSON 提交)
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "任务完成请求")
|
||||
public class TaskCompleteRequest {
|
||||
|
||||
@Schema(description = "学生ID", required = true)
|
||||
private Long studentId;
|
||||
|
||||
@Schema(description = "完成内容/反馈")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "附件")
|
||||
private String attachments;
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.reading.platform.dto.response;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 家长端孩子列表响应
|
||||
* 对齐前端 ChildInfo 结构
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Schema(description = "家长端孩子列表响应")
|
||||
public class ChildInfoResponse {
|
||||
|
||||
@Schema(description = "学生ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "出生日期")
|
||||
private LocalDate birthDate;
|
||||
|
||||
@Schema(description = "与家长关系:FATHER/MOTHER/GRANDFATHER/GRANDMOTHER/OTHER")
|
||||
private String relationship;
|
||||
|
||||
@JsonProperty("class")
|
||||
@Schema(description = "班级信息")
|
||||
private ClassInfo classInfo;
|
||||
|
||||
@Schema(description = "阅读次数(student_record 数量)")
|
||||
private Integer readingCount;
|
||||
|
||||
@Schema(description = "上课次数(lesson 记录数)")
|
||||
private Integer lessonCount;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@Schema(description = "班级信息")
|
||||
public static class ClassInfo {
|
||||
@Schema(description = "班级ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "班级名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String grade;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user