fix: 接口变更/请求方法为大写
This commit is contained in:
@@ -1,60 +1,16 @@
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
|
||||
/**
|
||||
* 查询信令列表
|
||||
* 跟踪任务数据列表
|
||||
* @param query 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export async function listTraceData(query: Record<string, any>) {
|
||||
let totalSQL = 'select count(*) as total from trace_data where 1=1 ';
|
||||
let rowsSQL = 'select * from trace_data where 1=1 ';
|
||||
|
||||
// 查询
|
||||
let querySQL = '';
|
||||
if (query.imsi) {
|
||||
querySQL += ` and imsi like '%${query.imsi}%' `;
|
||||
}
|
||||
if (query.msisdn) {
|
||||
querySQL += ` and msisdn like '%${query.msisdn}%' `;
|
||||
}
|
||||
|
||||
// 分页
|
||||
const pageNum = (query.pageNum - 1) * query.pageSize;
|
||||
const limtSql = ` limit ${pageNum},${query.pageSize} `;
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/trace_data`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
rowsSQL: rowsSQL + querySQL + limtSql,
|
||||
},
|
||||
return request({
|
||||
url: '/trace/task/list',
|
||||
method: 'GET',
|
||||
params: query,
|
||||
});
|
||||
|
||||
// 解析数据
|
||||
if (result.code === RESULT_CODE_SUCCESS) {
|
||||
const data: DataList = {
|
||||
total: 0,
|
||||
rows: [],
|
||||
code: result.code,
|
||||
msg: result.msg,
|
||||
};
|
||||
result.data.data.forEach((item: any) => {
|
||||
const itemData = item['trace_data'];
|
||||
if (Array.isArray(itemData)) {
|
||||
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
|
||||
data.total = itemData[0]['total'];
|
||||
} else {
|
||||
data.rows = itemData.map(v => parseObjLineToHump(v));
|
||||
}
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +21,7 @@ export async function listTraceData(query: Record<string, any>) {
|
||||
export function getTraceRawInfo(id: Record<string, string>) {
|
||||
return request({
|
||||
url: `/api/rest/traceManagement/v1/decMessage/${id}`,
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
export function packetDevices() {
|
||||
return request({
|
||||
url: '/trace/packet/devices',
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function packetDevices() {
|
||||
export function packetStart(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/trace/packet/start',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
@@ -32,7 +32,7 @@ export function packetStart(data: Record<string, any>) {
|
||||
export function packetStop(taskNo: string) {
|
||||
return request({
|
||||
url: '/trace/packet/stop',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: { taskNo },
|
||||
});
|
||||
}
|
||||
@@ -45,7 +45,7 @@ export function packetStop(taskNo: string) {
|
||||
export function packetFilter(taskNo: string, expr: string) {
|
||||
return request({
|
||||
url: '/trace/packet/filter',
|
||||
method: 'put',
|
||||
method: 'PUT',
|
||||
data: { taskNo, expr },
|
||||
});
|
||||
}
|
||||
@@ -58,7 +58,7 @@ export function packetFilter(taskNo: string, expr: string) {
|
||||
export function packetKeep(taskNo: string, duration: number = 120) {
|
||||
return request({
|
||||
url: '/trace/packet/keep-alive',
|
||||
method: 'put',
|
||||
method: 'PUT',
|
||||
data: { taskNo, duration },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
export function dumpStart(data: Record<string, string>) {
|
||||
return request({
|
||||
url: '/trace/tcpdump/start',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
timeout: 60_000,
|
||||
});
|
||||
@@ -14,7 +14,7 @@ export function dumpStart(data: Record<string, string>) {
|
||||
export function dumpStop(data: Record<string, string>) {
|
||||
return request({
|
||||
url: '/trace/tcpdump/stop',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
timeout: 60_000,
|
||||
});
|
||||
@@ -24,7 +24,7 @@ export function dumpStop(data: Record<string, string>) {
|
||||
export function traceUPF(data: Record<string, string>) {
|
||||
return request({
|
||||
url: '/trace/tcpdump/upf',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
timeout: 60_000,
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function listTraceTask(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/trace/task/list',
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -23,7 +23,7 @@ export async function listTraceTask(query: Record<string, any>) {
|
||||
export async function getTraceTask(id: string | number) {
|
||||
return request({
|
||||
url: `/trace/task/${id}`,
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export async function getTraceTask(id: string | number) {
|
||||
export function addTraceTask(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/trace/task`,
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
@@ -48,7 +48,7 @@ export function addTraceTask(data: Record<string, any>) {
|
||||
export function updateTraceTask(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/trace/task`,
|
||||
method: 'put',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export function updateTraceTask(data: Record<string, any>) {
|
||||
export async function delTraceTask(ids: string) {
|
||||
return request({
|
||||
url: `/trace/task/${ids}`,
|
||||
method: 'delete',
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export async function delTraceTask(ids: string) {
|
||||
export function filePullTask(traceId: string) {
|
||||
return request({
|
||||
url: '/trace/task/filePull',
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
params: { traceId },
|
||||
responseType: 'blob',
|
||||
timeout: 60_000,
|
||||
@@ -88,7 +88,7 @@ export async function getNeTraceInterfaceAll() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/ne_info`,
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
params: {
|
||||
SQL: `SELECT ne_type,interface FROM trace_info GROUP BY ne_type,interface`,
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
export function listTaskHLR(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/trace/task/hlr/list',
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
@@ -21,7 +21,7 @@ export function listTaskHLR(query: Record<string, any>) {
|
||||
export function delTaskHLR(ids: string | number) {
|
||||
return request({
|
||||
url: `/trace/task/hlr/${ids}`,
|
||||
method: 'delete',
|
||||
method: 'DELETE',
|
||||
timeout: 60_000,
|
||||
});
|
||||
}
|
||||
@@ -34,7 +34,7 @@ export function delTaskHLR(ids: string | number) {
|
||||
export function startTaskHLR(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/trace/task/hlr/start',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
timeout: 60_000,
|
||||
});
|
||||
@@ -48,7 +48,7 @@ export function startTaskHLR(data: Record<string, any>) {
|
||||
export function stopTaskHLR(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/trace/task/hlr/stop',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
timeout: 60_000,
|
||||
});
|
||||
@@ -62,7 +62,7 @@ export function stopTaskHLR(data: Record<string, any>) {
|
||||
export function fileTaskHLR(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/trace/task/hlr/file',
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export function fileTaskHLR(data: Record<string, any>) {
|
||||
export function filePullTaskHLR(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/trace/task/hlr/filePull',
|
||||
method: 'get',
|
||||
method: 'GET',
|
||||
params: query,
|
||||
responseType: 'blob',
|
||||
timeout: 60_000,
|
||||
|
||||
Reference in New Issue
Block a user