import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TypeConfigVO, TypeConfigForm, TypeConfigQuery } from '@/api/print/typeConfig/types';

/**
 * 查询签名类型配置列表
 * @param query
 * @returns {*}
 */

export const listTypeConfig = (query?: TypeConfigQuery): AxiosPromise<TypeConfigVO[]> => {
  return request({
    url: '/print/typeConfig/list',
    method: 'get',
    params: query
  });
};


/**
 * 新增签名类型配置
 * @param data
 */
export const addTypeConfig = (data: TypeConfigForm) => {
  return request({
    url: '/print/typeConfig/add',
    method: 'post',
    data: data
  });
};

/**
 * 修改签名类型配置
 * @param data
 */
export const updateTypeConfig = (data: TypeConfigForm) => {
  return request({
    url: '/print/typeConfig/edit',
    method: 'post',
    data: data
  });
};

export const getServiceList = () => {
  return request({
    url: '/print/typeConfig/getServiceList',
    method: 'post'
  });
};

export const changeSignTypeStatus = (data) => {
  return request({
    url: '/print/typeConfig/changeSignTypeStatus',
    method: 'post',
    data: data
  });
};

export const getSignList = () => {
  return request({
    url: '/print/typeConfig/getSignList',
    method: 'post'
  });
};
