import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TeamMeetingForm, TeamMeetingQuery, TeamMeetingVO } from '@/api/safety/teamMeeting/types';

/**
 * 查询站班会列表
 * @param query
 * @returns {*}
 */

export const listTeamMeeting = (query?: TeamMeetingQuery): AxiosPromise<TeamMeetingVO[]> => {
  return request({
    url: '/safety/teamMeeting/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询站班会详细
 * @param id
 */
export const getTeamMeeting = (id: string | number): AxiosPromise<TeamMeetingVO> => {
  return request({
    url: '/safety/teamMeeting/' + id,
    method: 'get'
  });
};

/**
 * 新增站班会
 * @param data
 */
export const addTeamMeeting = (data: TeamMeetingForm) => {
  return request({
    url: '/safety/teamMeeting',
    method: 'post',
    data: data
  });
};

/**
 * 修改站班会
 * @param data
 */
export const updateTeamMeeting = (data: TeamMeetingForm) => {
  return request({
    url: '/safety/teamMeeting',
    method: 'put',
    data: data
  });
};

/**
 * 删除站班会
 * @param id
 */
export const delTeamMeeting = (id: string | number | Array<string | number>) => {
  return request({
    url: '/safety/teamMeeting/' + id,
    method: 'delete'
  });
};
