import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UnsubscribeLogVO, UnsubscribeLogForm, UnsubscribeLogQuery } from '@/api/system/physical/unsubscribeLog/types';

/**
 * 查询用户注销操作记录列表
 * @param query
 * @returns {*}
 */

export const listUnsubscribeLog = (query?: UnsubscribeLogQuery): AxiosPromise<UnsubscribeLogVO[]> => {
  return request({
    url: '/physical/unsubscribeLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询用户注销操作记录详细
 * @param id
 */
export const getUnsubscribeLog = (id: string | number): AxiosPromise<UnsubscribeLogVO> => {
  return request({
    url: '/physical/unsubscribeLog/' + id,
    method: 'get'
  });
};

/**
 * 新增用户注销操作记录
 * @param data
 */
export const addUnsubscribeLog = (data: UnsubscribeLogForm) => {
  return request({
    url: '/physical/unsubscribeLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改用户注销操作记录
 * @param data
 */
export const updateUnsubscribeLog = (data: UnsubscribeLogForm) => {
  return request({
    url: '/physical/unsubscribeLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除用户注销操作记录
 * @param id
 */
export const delUnsubscribeLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/physical/unsubscribeLog/' + id,
    method: 'delete'
  });
};
/**
 * 取消注销
 * @param data
 */
export const removeUnsubscribe = (data: UnsubscribeLogForm) => {
  return request({
    url: '/physical/unsubscribeLog/removeUnsubscribe',
    method: 'put',
    data: data
  });
};
