import { defHttp } from '/@/utils/http/axios';
import {
  GetMeetingListModel,
  DeleteBatchesParams,
  MeetingIdParams,
  AddMeetingParams,
  EditMeetingParams,
  GetActivityListModel,
  GetMeetingModel,
  GetActivityModel,
  ActivityIdParams,
  AddActivityParams,
  EditActivityParams,
} from './model/eventModel';

enum Api {
  MeetingUrl = '/event/meeting',
  ActivityUrl = '/event/activity',
}

/**
 * @description: GetMeetingList
 */
export function getMeetingList(params) {
  console.log('-------------------getMeetingList---------------');
  return defHttp.request<GetMeetingListModel>({
    url: Api.MeetingUrl,
    method: 'GET',
    params,
  });
}

/**
 * @description: addMeeting
 */
export function addMeeting(params: AddMeetingParams) {
  return defHttp.request<GetMeetingListModel>({
    url: Api.MeetingUrl,
    method: 'POST',
    params,
  });
}
/**
 * @description: 批量删除交易类型
 */
export function deleteBatchesMeeting(params: DeleteBatchesParams) {
  return defHttp.request<GetMeetingListModel>({
    url: Api.MeetingUrl,
    method: 'DELETE',
    params,
  });
}

/**
 * @description: 获取单个交易类型
 */
export function getMeeting(params: MeetingIdParams) {
  return defHttp.request<GetMeetingModel>({
    url: Api.MeetingUrl + '/' + params.id,
    method: 'GET',
  });
}
/**
 * @description: 修改单个交易类型
 */
export function editMeeting(params: EditMeetingParams) {
  return defHttp.request<GetMeetingListModel>({
    url: Api.MeetingUrl + '/' + params.id,
    method: 'PUT',
    params,
  });
}
/**
 * @description: 删除单个交易类型
 */
export function deleteMeeting(params: MeetingIdParams) {
  return defHttp.request<GetMeetingListModel>({
    url: Api.MeetingUrl + '/' + params.id,
    method: 'DELETE',
  });
}

/**
 * @description: GetActivityList -----------------------------------------------
 */
export function getActivityList(params) {
  console.log('-------------------getActivityList---------------');
  return defHttp.request<GetActivityListModel>({
    url: Api.ActivityUrl,
    method: 'GET',
    params,
  });
}

/**
 * @description: addActivity
 */
export function addActivity(params: AddActivityParams) {
  return defHttp.request<GetActivityListModel>({
    url: Api.ActivityUrl,
    method: 'POST',
    params,
  });
}
/**
 * @description: 批量删除账户
 */
export function deleteBatchesActivity(params: DeleteBatchesParams) {
  return defHttp.request<GetActivityListModel>({
    url: Api.ActivityUrl,
    method: 'DELETE',
    params,
  });
}

/**
 * @description: 获取单个账户
 */
export function getActivity(params: ActivityIdParams) {
  return defHttp.request<GetActivityModel>({
    url: Api.ActivityUrl + '/' + params.id,
    method: 'GET',
  });
}
/**
 * @description: 修改单个账户
 */
export function editActivity(params: EditActivityParams) {
  return defHttp.request<GetActivityListModel>({
    url: Api.ActivityUrl + '/' + params.id,
    method: 'PUT',
    params,
  });
}
/**
 * @description: 删除单个账户
 */
export function deleteActivity(params: ActivityIdParams) {
  return defHttp.request<GetActivityListModel>({
    url: Api.ActivityUrl + '/' + params.id,
    method: 'DELETE',
  });
}
