提交 | 用户 | 时间
|
e7c126
|
1 |
import request from '@/config/axios'
|
H |
2 |
|
|
3 |
export interface StudentVO {
|
|
4 |
id: number
|
|
5 |
name: string
|
|
6 |
description: string
|
|
7 |
birthday: Date
|
|
8 |
sex: number
|
|
9 |
enabled: boolean
|
|
10 |
avatar: string
|
|
11 |
video: string
|
|
12 |
memo: string
|
|
13 |
}
|
|
14 |
|
|
15 |
// 查询学生分页
|
|
16 |
export const getStudentPage = async (params) => {
|
|
17 |
return await request.get({ url: `/infra/student/page`, params })
|
|
18 |
}
|
|
19 |
|
|
20 |
// 查询学生详情
|
|
21 |
export const getStudent = async (id: number) => {
|
|
22 |
return await request.get({ url: `/infra/student/get?id=` + id })
|
|
23 |
}
|
|
24 |
|
|
25 |
// 新增学生
|
|
26 |
export const createStudent = async (data: StudentVO) => {
|
|
27 |
return await request.post({ url: `/infra/student/create`, data })
|
|
28 |
}
|
|
29 |
|
|
30 |
// 修改学生
|
|
31 |
export const updateStudent = async (data: StudentVO) => {
|
|
32 |
return await request.put({ url: `/infra/student/update`, data })
|
|
33 |
}
|
|
34 |
|
|
35 |
// 删除学生
|
|
36 |
export const deleteStudent = async (id: number) => {
|
|
37 |
return await request.delete({ url: `/infra/student/delete?id=` + id })
|
|
38 |
}
|
|
39 |
|
|
40 |
// 导出学生 Excel
|
|
41 |
export const exportStudent = async (params) => {
|
|
42 |
return await request.download({ url: `/infra/student/export-excel`, params })
|
|
43 |
}
|
|
44 |
|
|
45 |
// ==================== 子表(学生联系人) ====================
|
|
46 |
|
|
47 |
// 获得学生联系人列表
|
|
48 |
export const getStudentContactListByStudentId = async (studentId) => {
|
|
49 |
return await request.get({ url: `/infra/student/student-contact/list-by-student-id?studentId=` + studentId })
|
|
50 |
}
|
|
51 |
|
|
52 |
// ==================== 子表(学生班主任) ====================
|
|
53 |
|
|
54 |
// 获得学生班主任
|
|
55 |
export const getStudentTeacherByStudentId = async (studentId) => {
|
|
56 |
return await request.get({ url: `/infra/student/student-teacher/get-by-student-id?studentId=` + studentId })
|
|
57 |
}
|