nursing_unit_vue/src/views/iot/tplink/region/RegionInfo.api.ts

40 lines
867 B
TypeScript
Raw Normal View History

2025-03-21 10:15:35 +08:00
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/iot/regionInfo/list',
sync = '/iot/regionInfo/sync',
add = '/iot/regionInfo/add',
edit = '/iot/regionInfo/edit',
delete = '/iot/regionInfo/delete',
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const sync = (params) => defHttp.get({ url: Api.sync, params });
/**
*
* @param params
*/
export const saveOrUpdateRegion = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.add;
return defHttp.post({ url: url, params });
};
/**
*
*/
export const deleteRegion = (params,handleSuccess) => {
return defHttp.post({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};