1
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled
This commit is contained in:
92
apps/web-antd/src/api/admin/teacher.ts
Normal file
92
apps/web-antd/src/api/admin/teacher.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace TeacherApi {
|
||||
/** 教师列表查询参数 */
|
||||
export interface ListParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
teacher_id?: string;
|
||||
name?: string;
|
||||
department_id?: number;
|
||||
nickname?: string;
|
||||
}
|
||||
|
||||
/** 教师信息 */
|
||||
export interface TeacherInfo {
|
||||
id?: number;
|
||||
teacher_id?: string | null;
|
||||
name?: string;
|
||||
gender?: string;
|
||||
department_id?: number;
|
||||
title?: string | null;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
avatar?: string | null;
|
||||
remark?: string;
|
||||
status?: number;
|
||||
user_id?: number | null;
|
||||
create_time?: string;
|
||||
update_time?: string | null;
|
||||
nickname?: string;
|
||||
department_name?: string | null;
|
||||
classroom_count?: number;
|
||||
classroom_names?: string[];
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/** 教师详情参数 */
|
||||
export interface DetailParams {
|
||||
id: number;
|
||||
}
|
||||
|
||||
/** 保存教师参数 */
|
||||
export interface SaveParams extends TeacherInfo {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/** 删除教师参数 */
|
||||
export interface DeleteParams {
|
||||
id: number;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教师列表
|
||||
* GET /api/admin/teacher/list
|
||||
*/
|
||||
export async function getTeacherListApi(params?: TeacherApi.ListParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/teacher/list', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教师详情
|
||||
* GET /api/admin/teacher/detail
|
||||
*/
|
||||
export async function getTeacherDetailApi(params: TeacherApi.DetailParams) {
|
||||
// 使用 responseReturn: 'body' 获取完整响应体
|
||||
return requestClient.get<any>('/api/admin/teacher/detail', {
|
||||
params,
|
||||
responseReturn: 'body',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存教师(新增/编辑)
|
||||
* POST /api/admin/teacher/save
|
||||
*/
|
||||
export async function saveTeacherApi(data: TeacherApi.SaveParams) {
|
||||
return requestClient.post<TeacherApi.TeacherInfo>('/api/admin/teacher/save', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教师
|
||||
* POST /api/admin/teacher/delete
|
||||
*/
|
||||
export async function deleteTeacherApi(data: TeacherApi.DeleteParams) {
|
||||
return requestClient.post('/api/admin/teacher/delete', data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user