79 lines
1.5 KiB
TypeScript
79 lines
1.5 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
import { VersionVO, VersionForm, VersionQuery } from './type';
|
|
|
|
/**
|
|
* 查询版本列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listVersion = (query?: VersionQuery): AxiosPromise<VersionVO[]> => {
|
|
return request({
|
|
url: '/api/app/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询版本详细
|
|
* @param id
|
|
*/
|
|
export const getVersion = (id: string | number): AxiosPromise<VersionVO> => {
|
|
return request({
|
|
url: '/system/version/' + id,
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 新增版本
|
|
* @param data
|
|
*/
|
|
export const addVersion = (data: VersionForm) => {
|
|
return request({
|
|
url: '/api/app/release',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改版本
|
|
* @param data
|
|
*/
|
|
export const updateVersion = (data: VersionForm) => {
|
|
return request({
|
|
url: '/system/version',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 删除版本
|
|
* @param id
|
|
*/
|
|
export const delVersion = (id: string | number | Array<string | number>) => {
|
|
return request({
|
|
url: '/system/version/' + id,
|
|
method: 'delete'
|
|
});
|
|
};
|
|
|
|
/** 获取过往版本 */
|
|
export const getPastVersion = (platform: string, appChannel: string) => {
|
|
return request({
|
|
url: `/api/app/getPastVersion?platform=${platform}&appChannel=${appChannel}`,
|
|
method: 'get',
|
|
});
|
|
};
|
|
/** 切换版本启停 */
|
|
export const switchVersion = (id: string, status: string) => {
|
|
return request({
|
|
url: `/api/app/switchStatus/${id}/${status}`,
|
|
method: 'get'
|
|
});
|
|
};
|