import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TutorVO, TutorForm, TutorQuery } from '@/api/ygpassport/tutor/types';

/**
 * 查询导师组活动列表
 * @param query
 * @returns {*}
 */

export const listTutor = (query?: TutorQuery): AxiosPromise<TutorVO[]> => {
  return request({
    url: '/ruoyi-ygpassport/tutor/listNew',
    method: 'get',
    params: query
  });
};

/**
 * 查询导师组活动详细
 * @param id
 */
export const getTutor = (id: string | number): AxiosPromise<TutorVO> => {
  return request({
    url: '/ruoyi-ygpassport/tutor/' + id,
    method: 'get'
  });
};

/**
 * 新增导师组活动
 * @param data
 */
export const addTutor = (data: TutorForm) => {
  return request({
    url: '/ruoyi-ygpassport/tutor',
    method: 'post',
    data: data
  });
};

/**
 * 修改导师组活动
 * @param data
 */
export const updateTutor = (data: TutorForm) => {
  return request({
    url: '/ruoyi-ygpassport/tutor',
    method: 'put',
    data: data
  });
};

/**
 * 删除导师组活动
 * @param id
 */
export const delTutor = (id: string | number | Array<string | number>) => {
  return request({
    url: '/ruoyi-ygpassport/tutor/' + id,
    method: 'delete'
  });
};
