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

40 lines
867 B
TypeScript
Raw Normal View History

2025-03-14 17:32:08 +08:00
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/iot/regionInfo/list',
sync = '/iot/regionInfo/sync',
2025-03-20 09:26:41 +08:00
add = '/iot/regionInfo/add',
edit = '/iot/regionInfo/edit',
delete = '/iot/regionInfo/delete',
2025-03-14 17:32:08 +08:00
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const sync = (params) => defHttp.get({ url: Api.sync, params });
2025-03-20 09:26:41 +08:00
/**
*
* @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();
});
};