import { VersionAdd, VersionQuery, Verupdate } from './types';

import { AxiosPromise } from 'axios';
import { RoleVO } from '@/api/system/role/types';
import { parseStrEmpty } from '@/utils/ruoyi';
import request from '@/utils/request';

/**
 * 查询版本列表
 * @param query
 */
export const getList = (query: VersionQuery): AxiosPromise => {
  return request({
    url: 'system/version/list',
    method: 'post',
    data: query
  });
};
/**
 * 版本添加
 * @param query
 */
export const postAdd = (query: VersionAdd): AxiosPromise => {
  return request({
    url: 'system/version/add',
    method: 'post',
    data: query
  });
};

/**
 * 修改状态
 * @param query
 */
export const getupdate = (query: Verupdate): AxiosPromise => {
  return request({
    url: 'system/version/update',
    method: 'get',
    params: query
  });
};

export interface dele {
  id: string;
}
/**
 * 删除版本
 * @param query
 */
export const getDel = (query: dele): AxiosPromise => {
  return request({
    url: `system/version/${query.id}`,
    method: 'delete',
    params: query
  });
};
