import apiRequest from '@/network/http/apiRequest'

/**
 * 获取Model列表
 * @param data
 * @returns
 */
export function getBizRuleByList(data: any) {
  return apiRequest({
    url: '/biz/rule',
    method: 'GET',
    params: data,
  })
}

/**
 * 根据Id获取BizRule
 * @param ruleId
 * @returns
 */
export function getBizRuleById(ruleId: number) {
  return apiRequest({
    url: `/biz/rule/${ruleId}`,
    method: 'GET',
  })
}

/**
 * 添加BizRule
 * @param data
 * @returns
 */
export function createBizRule(data: any) {
  return apiRequest({
    url: '/biz/rule/add',
    method: 'POST',
    data,
  })
}

/**
 * 更新Model
 * @param data
 * @returns
 */
export function updateBizRule(data: any) {
  return apiRequest({
    url: '/biz/rule/update',
    method: 'PUT',
    data,
  })
}

/**
 * 删除BizRule
 * @para bizId
 * @returns
 */
export function deleteBizRuleById(ruleId: number) {
  return apiRequest({
    url: `/biz/rule/${ruleId}`,
    method: 'DELETE',
  })
}
