Explorar o código

chore(api): 更新接口

wangshun hai 2 meses
pai
achega
13b8824ee0
Modificáronse 1 ficheiros con 77 adicións e 0 borrados
  1. 77 0
      src/api/index.ts

+ 77 - 0
src/api/index.ts

@@ -6,9 +6,13 @@ import type {
   AddInterface,
   AgreementUpdate,
   AllDevicesList,
+  BatchUpdate,
   CustomParameters,
   DeviceBindQuery,
+  DeviceGroup,
   DeviceGroupItem,
+  DeviceGroupListQuery,
+  DeviceParams,
   DevicesList,
   DevicesListItemData,
   DictTypeData,
@@ -28,11 +32,13 @@ import type {
   GetListItem,
   GroupingList,
   GroupingListData,
+  GroupRegions,
   InterfaceData,
   ListEquipmentParametersItemData,
   ListInfo,
   ListInterfaces,
   ListPhysicalInterfaces,
+  MonitoringForm,
   ParameterVerification,
   ParamValueListAutomaticData,
   ParamValueListAutomaticQuery,
@@ -52,6 +58,7 @@ import type {
   ProtocolReset,
   ProtocolStandardParamData,
   ProtocolStandardParamQuery,
+  RegionQuery,
   SerialNumberItem,
   SerialNumberItemData,
   SubmitSorting,
@@ -112,6 +119,44 @@ export const refreshUser = async () => {
 
 // ----- 系统服务 -----
 
+// 环境监控-区域
+
+export const addRegion = async (params: RegionQuery) => {
+  await request(apiBiz('/region/add'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+};
+
+export const regionUpdate = async (params: RegionQuery) => {
+  await request(apiBiz('/region/update'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+};
+
+export const regionDelete = async (id: number) => {
+  await request(apiBiz(`/region/delete/${id}`), {
+    method: 'POST',
+  });
+};
+
+export const getGroupRegions = async (devGroupId: number) => {
+  const data = await request<GroupRegions[]>(apiBiz(`/region/groupRegions/${devGroupId}`), {
+    method: 'POST',
+  });
+  return data;
+};
+
+// 环境监控-监测点
+
+export const addMonitorPoint = async (params: MonitoringForm) => {
+  await request(apiBiz('/monitorPoint/add'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+};
+
 // 字典类型表
 export const getDictTypeData = async (params: DictTypeDataParams) => {
   const data = await request<DictTypeData[]>(apiSys('/sysDictType/typeAndData/', params));
@@ -139,6 +184,14 @@ export const deviceAdd = async (equipmentInformationForm: EquipmentInformationFo
   return data;
 };
 
+export const getDeviceGroupList = async (params: DeviceGroupListQuery) => {
+  const data = await request<DeviceGroup[]>(apiBiz('/deviceGroup/getDeviceGroupList'), {
+    method: 'POST',
+    body: JSON.stringify(params),
+  });
+  return data;
+};
+
 export const addDeviceBind = async (params: DeviceBindQuery) => {
   await request(apiBiz('/device/bind'), {
     method: 'POST',
@@ -175,6 +228,11 @@ export const noPaginationDevicesList = async () => {
   return data;
 };
 
+export const getDeviceListSimple = async (deviceId: number) => {
+  const data = await request<DeviceParams[]>(apiBiz(`/device/listSimple/${deviceId}`));
+  return data;
+};
+
 // 设备网关
 
 export const deviceGatewayUpdate = async (equipmentUpdateForm: EquipmentUpdateForm[]) => {
@@ -235,6 +293,12 @@ export const addGateway = async () => {
   await request(apiBiz('/gateway/add'));
 };
 
+export const gatewayDelete = async (id: number) => {
+  await request(apiBiz(`/gateway/delete/${id}`), {
+    method: 'POST',
+  });
+};
+
 export const getAllGatewayList = async () => {
   const data = await request<SerialNumberItem[]>(apiBiz('/gateway/getGtwLinkList'), {
     method: 'POST',
@@ -266,6 +330,13 @@ export const gatewayLinkAdd = async (addInterface: AddInterface) => {
   });
 };
 
+export const addGatewayLinkBatchUpdate = async (params: BatchUpdate[]) => {
+  await request(apiBiz('/gatewayLink/batchUpdate'), {
+    method: 'POST',
+    body: JSON.stringify({ gatewayLinks: params }),
+  });
+};
+
 export const gatewayLinkDelete = async (id: number) => {
   await request(apiBiz(`/gatewayLink/delete/${id}`), {
     method: 'POST',
@@ -390,6 +461,12 @@ export const orgGatewayRegister = async (gatewayId: number) => {
   });
 };
 
+export const orgGatewayUnregister = async (gatewayId: number) => {
+  await request(apiBiz(`/orgGateway/unregister/${gatewayId}`), {
+    method: 'POST',
+  });
+};
+
 export const orgGatewaySerialNumber = async (protocolList: ProtocolList) => {
   const data = await request<SerialNumberItemData>(apiBiz('/orgGateway/getGatewayPageList'), {
     method: 'POST',