xian-ncc-da-client/src/api/LineInfoApi.ts

81 lines
1.4 KiB
TypeScript
Raw Normal View History

import { api } from 'src/boot/axios';
import { PageDto, PageQueryDto } from './ApiCommon';
const UriBase = '/api/lineInfo';
interface Item {
id: number;
name: string;
lineId: number;
config: string;
createdAt: string;
updateAt: string;
}
export class PagingQueryParams extends PageQueryDto {
name?: string;
}
/**
*
* @param params
* @returns
*/
export async function pageQuery(
params: PagingQueryParams
): Promise<PageDto<Item>> {
const response = await api.get(`${UriBase}/paging`, {
params: params,
});
return response.data;
}
/**
* 线
* @param params
* @returns
*/
export function createLine(data: {
name: string;
lineId: number;
2023-06-09 15:15:27 +08:00
config?: string;
}) {
return api.post(`${UriBase}`, data);
}
/**
* 线
* @param id 线id
*/
export function deleteLine(id: number) {
return api.delete(`${UriBase}/${id}`);
}
/**
* 线
* @param id 稿id
*/
export function saveLineData(id: number, data: Item) {
return api.put(`${UriBase}/${id}`, data);
}
/**
* 线
* @param params
* @returns
*/
export async function getLineInfo(id: number): Promise<Item> {
const response = await api.get(`${UriBase}/${id}`);
return response.data;
}
/**
* 线
* @param params
* @returns
*/
2023-06-09 15:15:27 +08:00
export async function getLineList(): Promise<Array<Item>> {
const response = await api.get(`${UriBase}/list`);
return response.data;
}