fix: 接口变更/请求方法为大写

This commit is contained in:
TsMask
2025-02-20 10:42:34 +08:00
parent 8bfa73a67a
commit 7322759545
83 changed files with 568 additions and 1388 deletions

View File

@@ -20,14 +20,14 @@ export async function listAlarm(query: Record<string, any>) {
querySQL += ` and alarm_status = '${query.status}' `;
}
if (query.beginTime) {
querySQL += ` and log_time >= '${query.beginTime}' `;
querySQL += ` and event_time >= '${new Date(query.beginTime).valueOf()}' `;
}
if (query.endTime) {
querySQL += ` and log_time <= '${query.endTime}' `;
querySQL += ` and event_time <= '${new Date(query.endTime).valueOf()}' `;
}
// 排序
let sortSql = ' order by log_time ';
let sortSql = ' order by event_time ';
if (query.sortOrder === 'asc') {
sortSql += ' asc ';
} else {
@@ -41,7 +41,7 @@ export async function listAlarm(query: Record<string, any>) {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_log`,
method: 'get',
method: 'GET',
params: {
totalSQL: totalSQL + querySQL,
rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
@@ -50,9 +50,8 @@ export async function listAlarm(query: Record<string, any>) {
// 解析数据
if (result.code === RESULT_CODE_SUCCESS) {
const data: DataList = {
total: 0,
rows: [],
const data = {
data: { total: 0, rows: [] as any },
code: result.code,
msg: result.msg,
};
@@ -60,9 +59,9 @@ export async function listAlarm(query: Record<string, any>) {
const itemData = item['alarm_log'];
if (Array.isArray(itemData)) {
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
data.total = itemData[0]['total'];
data.data.total = itemData[0]['total'];
} else {
data.rows = itemData.map(v => parseObjLineToHump(v));
data.data.rows = itemData.map(v => parseObjLineToHump(v));
}
}
});

View File

@@ -9,7 +9,7 @@ import { request } from '@/plugins/http-fetch';
export function getBakFile() {
return request({
url: '/lm/table/list',
method: 'get',
method: 'GET',
});
}
@@ -21,7 +21,7 @@ export function getBakFile() {
export function getBakFileList(query: Record<string, any>) {
return request({
url: '/lm/file/list',
method: 'get',
method: 'GET',
params: query,
});
}
@@ -34,7 +34,7 @@ export function getBakFileList(query: Record<string, any>) {
export function downFile(query: Record<string, any>) {
return request({
url: `/lm/file/${query.fileName}`,
method: 'get',
method: 'GET',
params: query,
responseType: 'blob',
timeout: 180_000,
@@ -49,7 +49,7 @@ export function downFile(query: Record<string, any>) {
export function delFile(query: Record<string, any>) {
return request({
url: `/lm/file/${query.fileName}`,
method: 'delete',
method: 'DELETE',
params: query,
});
}
@@ -62,7 +62,7 @@ export function delFile(query: Record<string, any>) {
export function updateFTPInfo(data: Record<string, any>) {
return request({
url: `/lm/table/ftp`,
method: 'post',
method: 'POST',
data: data,
crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false',
});
@@ -76,7 +76,7 @@ export function updateFTPInfo(data: Record<string, any>) {
export function getFTPInfo() {
return request({
url: `/lm/table/ftp`,
method: 'get',
method: 'GET',
crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false',
});
}
@@ -89,7 +89,7 @@ export function getFTPInfo() {
export function putFTPInfo(filePath: string, fileName: string) {
return request({
url: `/lm/table/ftp`,
method: 'put',
method: 'PUT',
data: { filePath, fileName },
});
}

View File

@@ -17,14 +17,14 @@ export async function listForwarding(query: Record<string, any>) {
querySQL += ` and ne_type like '%${query.neType}%' `;
}
if (query.beginTime) {
querySQL += ` and log_time >= '${query.beginTime}' `;
querySQL += ` and event_time >= '${new Date(query.beginTime).valueOf()}' `;
}
if (query.endTime) {
querySQL += ` and log_time <= '${query.endTime}' `;
querySQL += ` and event_time <= '${new Date(query.endTime).valueOf()}' `;
}
// 排序
let sortSql = ' order by log_time ';
let sortSql = ' order by event_time ';
if (query.sortOrder === 'asc') {
sortSql += ' asc ';
} else {
@@ -38,7 +38,7 @@ export async function listForwarding(query: Record<string, any>) {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_forward_log`,
method: 'get',
method: 'GET',
params: {
totalSQL: totalSQL + querySQL,
rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
@@ -47,9 +47,8 @@ export async function listForwarding(query: Record<string, any>) {
// 解析数据
if (result.code === RESULT_CODE_SUCCESS) {
const data: DataList = {
total: 0,
rows: [],
const data = {
data: { total: 0, rows: [] as any },
code: result.code,
msg: result.msg,
};
@@ -57,9 +56,9 @@ export async function listForwarding(query: Record<string, any>) {
const itemData = item['alarm_forward_log'];
if (Array.isArray(itemData)) {
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
data.total = itemData[0]['total'];
data.data.total = itemData[0]['total'];
} else {
data.rows = itemData.map(v => parseObjLineToHump(v));
data.data.rows = itemData.map(v => parseObjLineToHump(v));
}
}
});

View File

@@ -18,7 +18,7 @@ export async function getLogSet() {
// 日志保存时间
const logDurationResult = await request({
url: `/api/rest/databaseManagement/v1/omc_db/config`,
method: 'get',
method: 'GET',
params: {
SQL: `SELECT * FROM config WHERE config_tag = 'logDuration'`,
},
@@ -27,7 +27,7 @@ export async function getLogSet() {
// 日志最大容量
const logCapacityResult = await request({
url: `/api/rest/databaseManagement/v1/omc_db/config`,
method: 'get',
method: 'GET',
params: {
SQL: `SELECT * FROM config WHERE config_tag = 'logCapacity'`,
},
@@ -76,7 +76,7 @@ export async function updateLogSet(data: Record<string, any>) {
const value = `${data[key]}`;
const result = request({
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='${key}'`,
method: 'put',
method: 'PUT',
data: { data: { value } },
});
arr.push(result);
@@ -120,7 +120,7 @@ export async function getFtpLogSet() {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/omc_db/config`,
method: 'get',
method: 'GET',
params: {
SQL: `SELECT * FROM config WHERE config_tag = 'ftpLogSet'`,
},
@@ -151,7 +151,7 @@ export async function getFtpLogSet() {
export async function updateFtpLogSet(data: Record<string, any>) {
const result = await request({
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='ftpLogSet'`,
method: 'put',
method: 'PUT',
data: { data: { value_json: JSON.stringify(data) } },
});
// 解析数据
@@ -176,7 +176,7 @@ export async function getRemoteOut() {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/omc_db/config`,
method: 'get',
method: 'GET',
params: {
SQL: `SELECT * FROM config WHERE config_tag = 'remoteLogSet'`,
},
@@ -206,7 +206,7 @@ export async function getRemoteOut() {
export async function updateRemoteOut(data: Record<string, any>) {
const result = await request({
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='remoteLogSet'`,
method: 'put',
method: 'PUT',
data: { data: { value_json: JSON.stringify(data) } },
});
// 解析数据
@@ -254,7 +254,7 @@ export async function exportLog(query: Record<string, any>) {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/select/omc_db/${query.logType}`,
method: 'get',
method: 'GET',
params: {
SQL: querySQL,
},
@@ -277,7 +277,7 @@ export async function exportLog(query: Record<string, any>) {
export async function backupLog(logType: string) {
const result = await request({
url: `/api/rest/dataManagement/v1/omc_db/${logType}/backup`,
method: 'post',
method: 'POST',
});
// 解析数据
if (result.code === RESULT_CODE_SUCCESS && result.data.data) {
@@ -300,7 +300,7 @@ export async function backupLog(logType: string) {
export async function backupDownload(path: string) {
return request({
url: `/api/rest/fileManagement/v1/path/file?path=${path}`,
method: 'get',
method: 'GET',
responseType: 'blob',
timeout: 180_000,
});
@@ -314,7 +314,7 @@ export async function backupDownload(path: string) {
export function backupFileList() {
return request({
url: `/api/rest/fileManagement/v1/files/listFiles`,
method: 'post',
method: 'POST',
data: {
path: '/usr/local/omc/database',
expand: true,

View File

@@ -38,7 +38,7 @@ export async function listMML(query: Record<string, any>) {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/select/omc_db/mml_log`,
method: 'get',
method: 'GET',
params: {
totalSQL: totalSQL + querySQL,
rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
@@ -47,9 +47,8 @@ export async function listMML(query: Record<string, any>) {
// 解析数据
if (result.code === RESULT_CODE_SUCCESS) {
const data: DataList = {
total: 0,
rows: [],
const data = {
data: { total: 0, rows: [] as any },
code: result.code,
msg: result.msg,
};
@@ -57,9 +56,9 @@ export async function listMML(query: Record<string, any>) {
const itemData = item['mml_log'];
if (Array.isArray(itemData)) {
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
data.total = itemData[0]['total'];
data.data.total = itemData[0]['total'];
} else {
data.rows = itemData.map(v => parseObjLineToHump(v));
data.data.rows = itemData.map(v => parseObjLineToHump(v));
}
}
});

View File

@@ -41,7 +41,7 @@ export async function listOperationLog(query: Record<string, any>) {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/select/omc_db/operation_log`,
method: 'get',
method: 'GET',
params: {
totalSQL: totalSQL + querySQL,
rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
@@ -50,9 +50,8 @@ export async function listOperationLog(query: Record<string, any>) {
// 解析数据
if (result.code === RESULT_CODE_SUCCESS) {
const data: DataList = {
total: 0,
rows: [],
const data = {
data: { total: 0, rows: [] as any },
code: result.code,
msg: result.msg,
};
@@ -60,9 +59,9 @@ export async function listOperationLog(query: Record<string, any>) {
const itemData = item['operation_log'];
if (Array.isArray(itemData)) {
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
data.total = itemData[0]['total'];
data.data.total = itemData[0]['total'];
} else {
data.rows = itemData.map(v => parseObjLineToHump(v));
data.data.rows = itemData.map(v => parseObjLineToHump(v));
}
}
});

View File

@@ -41,7 +41,7 @@ export async function listSecurityLog(query: Record<string, any>) {
// 发起请求
const result = await request({
url: `/api/rest/databaseManagement/v1/select/omc_db/security_log`,
method: 'get',
method: 'GET',
params: {
totalSQL: totalSQL + querySQL,
rowsSQL: rowsSQL + querySQL + sortSql + limtSql,
@@ -50,9 +50,8 @@ export async function listSecurityLog(query: Record<string, any>) {
// 解析数据
if (result.code === RESULT_CODE_SUCCESS) {
const data: DataList = {
total: 0,
rows: [],
const data = {
data: { total: 0, rows: [] as any },
code: result.code,
msg: result.msg,
};
@@ -60,9 +59,9 @@ export async function listSecurityLog(query: Record<string, any>) {
const itemData = item['security_log'];
if (Array.isArray(itemData)) {
if (itemData.length === 1 && itemData[0]['total'] >= 0) {
data.total = itemData[0]['total'];
data.data.total = itemData[0]['total'];
} else {
data.rows = itemData.map(v => parseObjLineToHump(v));
data.data.rows = itemData.map(v => parseObjLineToHump(v));
}
}
});