
import { requestClient } from '#/api/request';
import type { languageRecord, languageType } from '#/model/type';
export interface OperationParam{
  AppId: number;
  ServerList?: number[];
  Emit?:string[];
}

export interface languageParam{
  PageSize: number;
  CurrentPage: number;
  Key?: string;
  StartTime?: string;
  EndTime?: string;
  SearchField?: string;
  SearchValue?: string;
}

export async function getStatisticsOrder(data : OperationParam) {
  return requestClient.post('/statistics/order', data);
}

export async function getStatisticsLevel(data : OperationParam) {
  return requestClient.post('/statistics/level', data);
}

export async function getstatisticsInfo(data : OperationParam) {
  return requestClient.post('/statistics/info', data, {timeout: 120000});
}

export async function getstatisticsHeat(data : OperationParam) {
  return requestClient.post('/statistics/heat', data, {timeout: 120000});
}

export async function getLanguageList(data: languageParam) {
  return requestClient.post('/language/list', data,{});
}

export async function saveLanguageList(data: languageRecord[]) {
  return requestClient.post('/language/save', {data:data},{});
}

export async function addLanguageList(data: languageType[]) {
  return requestClient.post('/language/add', {data:data},{});
}

export async function exportLanguageFile() {
  return requestClient.post('/language/export', {});
}

export async function deleteLanguageItem(data: {key: string}) {
  return requestClient.post('/language/delete', data);
}