import request from '@/utils/request';
import { SessionVO, SessionQuery, SessionForm } from './types';

export function listSession(query: SessionQuery) {
  return request({
    url: '/talk/session/list',
    method: 'get',
    params: query
  });
}

export function getSession(id: string | number) {
  return request({
    url: '/talk/session/' + id,
    method: 'get'
  });
}

export function addSession(data: SessionForm) {
  return request({
    url: '/talk/session',
    method: 'post',
    data: data
  });
}

export function updateSession(data: SessionForm) {
  return request({
    url: '/talk/session',
    method: 'put',
    data: data
  });
}

export function delSession(id: string | number | Array<string | number>) {
  return request({
    url: '/talk/session/' + id,
    method: 'delete'
  });
}
