昨天 8f3bf7050e65fdbe55eaad74fde307c57dab960e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { PageParam, PageResult } from '@/http/types'
import { http } from '@/http/http'
 
/** 学生信息 */
export interface Student {
  id?: number
  name: string
  description: string
  birthday: Date
  sex: number
  enabled: boolean
  avatar: string
  video: string
  memo: string
  createTime?: Date
}
 
/** 获取学生分页列表 */
export function getStudentPage(params: PageParam) {
  return http.get<PageResult<Student>>('/infra/student/page', params)
}
 
/** 获取学生详情 */
export function getStudent(id: number) {
  return http.get<Student>(`/infra/student/get?id=${id}`)
}
 
/** 创建学生 */
export function createStudent(data: Student) {
  return http.post<number>('/infra/student/create', data)
}
 
/** 更新学生 */
export function updateStudent(data: Student) {
  return http.put<boolean>('/infra/student/update', data)
}
 
/** 删除学生 */
export function deleteStudent(id: number) {
  return http.delete<boolean>(`/infra/student/delete?id=${id}`)
}