|
|
@@ -2,16 +2,38 @@
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import { session } from "/@/utils/Memory.js";
|
|
|
import type { ErrorMessageMode } from '/#/axios';
|
|
|
+const interfaceType = { apiUrl2: true };
|
|
|
+
|
|
|
|
|
|
enum Api {
|
|
|
+ callProvider = "/callProvider",
|
|
|
List = '/base-center/system/selectSystemPowerInterface',
|
|
|
GetGroup = '/interface-center/interface/getGroup',
|
|
|
GetGroupId = '/interface-center/interface/getInterfacesAndPowerByUserId',
|
|
|
GetInterfaceDetail = '/interface-center/interface/getInterfaceDetail',
|
|
|
- GetInterfaces = '/interface-center/interface/getInterfaces'
|
|
|
-}
|
|
|
+ GetInterfaces = '/interface-center/interface/getInterfaces',
|
|
|
+ //数据监控接口
|
|
|
+ //(1)大数据平台告警信息
|
|
|
+ BigDataMonitor = '/interface-center/monitor/bigData/events',
|
|
|
+ //(2) 大数据平台hdfs容量信息
|
|
|
+ HdfsCapacity = '/interface-center/monitor/bigData/hdfsCapacity',
|
|
|
+ //(3) 获取接口api总数,当月调用次数,总调用次数
|
|
|
+ GetApiData = '/interface-center/monitor/getApiData',
|
|
|
+ //(4) 获取接口近三十天每日的调用次数
|
|
|
+ GetApiUseCountDays = '/interface-center/monitor/getApiUseCountDays',
|
|
|
+ //(5) 获取接口近半年每月的调用次数
|
|
|
+ GetApiUseCountMouths = '/interface-center/monitor/getApiUseCountMouths',
|
|
|
+ //(6) 各分析统计
|
|
|
+ BusinessStatistics = '/xldanalysis-center/xldanalyst/BusinessStatistics',
|
|
|
|
|
|
-const interfaceType = { apiUrl2: true };
|
|
|
+ //(7) 分类统计
|
|
|
+ GetInterfacesTotalNum = '/interface-center/interface/getInterfacesTotalNum',
|
|
|
+ //(8) 获取地图服务,文件数据,数据库数据,工具数据个数
|
|
|
+ GetSpaceData = '/interface-center/monitor/getSpaceData',
|
|
|
+ //(9) 统计文件个数和总文件大小
|
|
|
+ GetDataStoreGroupByStatistics = '/interface-center/monitor/getDataStoreGroupByStatistics'
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* @description:获取应用列表
|
|
|
@@ -116,3 +138,130 @@ export function getAllInterface(e) {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description:各分析统计
|
|
|
+ * @param:
|
|
|
+ * startTime 开始时间 2022-01-29
|
|
|
+ * endTime 结束时间 2022-09-29
|
|
|
+*/
|
|
|
+export function queryBusinessStatistics(params) {
|
|
|
+ return new Promise<void>((resolve) => {
|
|
|
+ defHttp.post({ url: Api.BusinessStatistics, params })
|
|
|
+ .then((r) => {
|
|
|
+ if (r.resp_code == 0 && r.datas && r.datas.length) {
|
|
|
+ resolve(r.datas);
|
|
|
+ } else {
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description:获取接口近三十天每日的调用次数
|
|
|
+*/
|
|
|
+export function queryApiUseCountDays(params) {
|
|
|
+ return new Promise<void>((resolve) => {
|
|
|
+ defHttp.get({ url: Api.GetApiUseCountDays, params })
|
|
|
+ .then((r) => {
|
|
|
+ if (r.resp_code == 0 && r.datas && r.datas) {
|
|
|
+ resolve(r.datas);
|
|
|
+ } else {
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description:获取接口近半年每月的调用次数
|
|
|
+*/
|
|
|
+export function queryApiUseCountMouths(params) {
|
|
|
+ return new Promise<void>((resolve) => {
|
|
|
+ defHttp.get({ url: Api.GetApiUseCountMouths, params })
|
|
|
+ .then((r) => {
|
|
|
+ if (r.resp_code == 0 && r.datas && r.datas) {
|
|
|
+ resolve(r.datas);
|
|
|
+ } else {
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description:数据资源分类统计
|
|
|
+ */
|
|
|
+ export function StatisticDataResource() {
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.append("interfaceName", "antu.space.provider.sservicebase.ServiceBaseMetaDataViewProvider");
|
|
|
+ formData.append("methodName", "getStatistics");
|
|
|
+ formData.append("args[]", session.getItem('tokenV2'));
|
|
|
+ formData.append("args[]", 'false');
|
|
|
+ return new Promise<void>((resolve, reject) => {
|
|
|
+ defHttp.post({ url: Api.callProvider, params: formData, ...interfaceType })
|
|
|
+ .then((r) => {
|
|
|
+ let result = r.result === '' ? {} : JSON.parse(r.result)
|
|
|
+ resolve(result);
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description:查询接口总数
|
|
|
+ * @param:
|
|
|
+*/
|
|
|
+export function queryInterfacesTotalNum(params) {
|
|
|
+ return new Promise<void>((resolve) => {
|
|
|
+ defHttp.get({ url: Api.GetInterfacesTotalNum, params })
|
|
|
+ .then((r) => {
|
|
|
+ if (r.resp_code === 0 && r.datas) {
|
|
|
+ resolve(r.datas);
|
|
|
+ } else {
|
|
|
+ resolve(0);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description:获取地图服务,文件数据,数据库数据,工具数据个数
|
|
|
+ * @param:
|
|
|
+*/
|
|
|
+export function querySpaceData(params) {
|
|
|
+ return new Promise<void>((resolve) => {
|
|
|
+ defHttp.get({ url: Api.GetSpaceData, params })
|
|
|
+ .then((r) => {
|
|
|
+ if (r.resp_code == 0 && r.datas && r.datas.length) {
|
|
|
+ resolve(r.datas);
|
|
|
+ } else {
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description:统计文件个数和总文件大小
|
|
|
+ * @param:
|
|
|
+*/
|
|
|
+export function DataStoreGroupByStatistics(params) {
|
|
|
+ return new Promise<void>((resolve) => {
|
|
|
+ defHttp.get({ url: Api.GetDataStoreGroupByStatistics, params })
|
|
|
+ .then((r) => {
|
|
|
+ if (r.resp_code == 0 && r.datas && r.datas.length) {
|
|
|
+ resolve(r.datas);
|
|
|
+ } else {
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|