import { fetch, post, ApiResponse } from './index'

export function queryTenantPage(params = {}): Promise<ApiResponse<any>> {
  return fetch({ url: '/upms/tenant/page', params })
}

export function fetchTenantById(params = {}): Promise<ApiResponse<any>> {
  return fetch({ url: '/upms/tenant/by-id', params })
}

export function createTenant(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/create', params })
}

export function updateTenant(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/update', params })
}

export function removeTenant(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/remove', params })
}

export function syncTenantMenu(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/menu/sync', params })
}

export function queryTenantUserPage(params = {}): Promise<ApiResponse<any>> {
  return fetch({ url: '/upms/tenant/user/page', params })
}

export function queryTenantUserAccount(params = {}): Promise<ApiResponse<any>> {
  return fetch({ url: '/upms/tenant/user/account', params })
}

export function changeTenantUserLock(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/user/change-lock', params })
}

export function resetTenantUserPwd(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/user/reset-pwd', params })
}

export function addTenantUserRole(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/user/role-add', params })
}

export function delTenantUserRole(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/user/role-delete', params })
}

export function removeTenantUser(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/user/remove', params })
}

export function fetchTenantUserById(params = {}): Promise<ApiResponse<any>> {
  return fetch({ url: '/upms/tenant/user/detail/by-id', params })
}

export function updateTenantUserDetail(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/user/detail/update', params })
}

export function createTenantUser(params = {}): Promise<ApiResponse<any>> {
  return post({ url: '/upms/tenant/user/create', params })
}
