import request, { queryDict } from '@/utils/request';

/*
 * 分页查询
 */
export const getSysOrg = (params) => request('/sysOrg', { params });

export const getSysOrgDict = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
/*
 * 新增数据
 */
export const postSysOrg = (data) => request('/sysOrg', { data, method: 'post' });

/*
 * 通过ID查询单条数据
 */
export const getSysOrgById = (id) => request(`/sysOrg/${id}`);

/** 
 * 更新数据
 * 
 * @param {*} id
 * @param {*} data
 * @returns
 */
export const putSysOrg = (id, data) => request(`/sysOrg/${id}`, { data, method: 'put' });

/*
 * 通过主键删除数据
 */
export const deleteSysOrg = (id) => request(`/sysOrg/${id}`, { method: 'delete' });
