index.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import request from '@/config/axios'
  2. export interface Demo03StudentVO {
  3. id: number
  4. name: string
  5. sex: number
  6. birthday: Date
  7. description: string
  8. }
  9. // 查询学生分页
  10. export const getDemo03StudentPage = async (params) => {
  11. return await request.get({ url: `/infra/demo03-student/page`, params })
  12. }
  13. // 查询学生详情
  14. export const getDemo03Student = async (id: number) => {
  15. return await request.get({ url: `/infra/demo03-student/get?id=` + id })
  16. }
  17. // 新增学生
  18. export const createDemo03Student = async (data: Demo03StudentVO) => {
  19. return await request.post({ url: `/infra/demo03-student/create`, data })
  20. }
  21. // 修改学生
  22. export const updateDemo03Student = async (data: Demo03StudentVO) => {
  23. return await request.put({ url: `/infra/demo03-student/update`, data })
  24. }
  25. // 删除学生
  26. export const deleteDemo03Student = async (id: number) => {
  27. return await request.delete({ url: `/infra/demo03-student/delete?id=` + id })
  28. }
  29. // 导出学生 Excel
  30. export const exportDemo03Student = async (params) => {
  31. return await request.download({ url: `/infra/demo03-student/export-excel`, params })
  32. }
  33. // ==================== 子表(学生课程) ====================
  34. // 获得学生课程列表
  35. export const getDemo03CourseListByStudentId = async (studentId) => {
  36. return await request.get({ url: `/infra/demo03-student/demo03-course/list-by-student-id?studentId=` + studentId })
  37. }
  38. // ==================== 子表(学生班级) ====================
  39. // 获得学生班级
  40. export const getDemo03GradeByStudentId = async (studentId) => {
  41. return await request.get({ url: `/infra/demo03-student/demo03-grade/get-by-student-id?studentId=` + studentId })
  42. }