import { request } from '../request';

// 查询全部课程类别
// 响应接口
export interface SelectAll_1Res {
  status: boolean;
  msg: string;
  data: Record<string, unknown>;
}

/**
 * 查询全部课程类别
 * @returns
 */
export function selectAll_1() {
  return request.get(`/selectAll`);
}

// 添加课程类别
// 参数接口
export interface AddEasEduCategoryParams {
  id?: number | null;
  name?: string | null;
  description?: string | null;
  createTime?: string;
  modifyTime?: string;
  createUid?: number | null;
  disabled?: string | null;
}

// 响应接口
export interface AddEasEduCategoryRes {
  status: boolean;
  msg: string;
  data: Record<string, unknown>;
}

/**
 * 添加课程类别
 * @param {object} params EasEduCategory
 * @param {number} params.id
 * @param {string} params.name 学科名称
 * @param {string} params.description 学科描述
 * @param {object} params.createTime 创建时间
 * @param {object} params.modifyTime 修改时间
 * @param {number} params.createUid 创建用户ID
 * @param {string} params.disabled 状态
 * @returns
 */
export function addEasEduCategory(params: AddEasEduCategoryParams) {
  return request.post(`/addEasEduCategory`, params);
}

// 根据Id删除课程类别
// 响应接口
export interface DeleteByIdRes {
  status: boolean;
  msg: string;
  data: string;
}

/**
 * 根据Id删除课程类别
 * @param {string} id
 * @returns
 */
export function deleteById(id: number) {
  return request.delete(`/deleteById/${id}`);
}

// 课程类别更新
// 参数接口
export interface UpdateEasEduCategoryParams {
  id?: number | null;
  name?: string | null;
  description?: string | null;
  createTime?: string | null;
  modifyTime?: string;
  createUid?: number | null;
  disabled?: string | null;
}

// 响应接口
export interface UpdateEasEduCategoryRes {
  status: boolean;
  msg: string;
  data: Record<string, unknown>;
}

/**
 * 课程类别更新
 * @param {object} params EasEduCategory
 * @param {number} params.id
 * @param {string} params.name 学科名称
 * @param {string} params.description 学科描述
 * @param {object} params.createTime 创建时间
 * @param {object} params.modifyTime 修改时间
 * @param {number} params.createUid 创建用户ID
 * @param {string} params.disabled 状态
 * @returns
 */
export function updateEasEduCategory(params: UpdateEasEduCategoryParams) {
  return request.post(`/updateEasEduCategory`, params);
}

// 根据Id查询对应课程类别
// 响应接口
export interface SelectById_1Res {
  status: boolean;
  msg: string;
  data: Record<string, unknown>;
}

/**
 * 根据Id查询对应课程类别
 * @param {string} id
 * @returns
 */
export function selectById_1(id: number) {
  return request.get(`/selectById?id=${id}`);
}

// 根据条件进行查询课程类别
// 参数接口
export interface SelectByCondition_1Params {
  id?: number | null;
  name?: string | null;
  description?: string | null;
  createTime?: null | string;
  modifyTime?: null | string;
  createUid?: null | number;
  disabled?: string | null;
}

// 响应接口
export interface SelectByCondition_1Res {
  status: boolean;
  msg: string;
  data: Record<string, unknown>;
  total: number;
}

/**
 * 根据条件进行查询课程类别
 * @param {string} pageNum
 * @param {string} pageSize
 * @param {object} params EasEduCategory
 * @param {number} params.id
 * @param {string} params.name 学科名称
 * @param {string} params.description 学科描述
 * @param {object} params.createTime 创建时间
 * @param {object} params.modifyTime 修改时间
 * @param {number} params.createUid 创建用户ID
 * @param {string} params.disabled 状态
 * @returns
 */
export function selectByCondition_1(pageNum: number, pageSize: number, params: SelectByCondition_1Params) {
  return request.post(`/selectByCondition?pageNum=${pageNum}&pageSize=${pageSize}`, params);
}
