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}`)
|
}
|