import {get, post, put, del} from '../http/http'

const prefix = "dawn/api/v1/"

const apiIdle = {
  /**
   * 获取动态罚款配置表格
   * @param {Object} params
   */
  getIdleFeePages(params) {
    return post(prefix + 'idlefee-pages', params)
  },
  /**
   * 保存IdleFee
   * @param {Object} data
   */
  saveIdleFee(data) {
    return post(prefix + "idlefees", data)
  },
  /**
   * 获取IdleFee
   * @param {Object} dynamicIdleFeeId
   */
  getIdleFeeById(dynamicIdleFeeId) {
    return get(prefix + "idlefees/" + dynamicIdleFeeId)
  },
  /**
   * 修改IdleFee
   * @param {Object} data
   */
  updateIdleFee(data) {
    return put(prefix + "idlefees/" + data.dynamicIdleFeeId, data)
  },
  /**
   * 获取IdleFee
   * @param {Object} dynamicIdleFeeId
   */
  deleteIdleFeeById(dynamicIdleFeeId) {
    return del(prefix + "idlefees/" + dynamicIdleFeeId)
  },
  /**
   * 分页获取动态罚款配置的站点分配表格
   * @param {Object} data
   */
  getAssignIdleConfigPages(data) {
    return post(prefix + "idlefee/site-pages", data)
  },
  /**
   * 分配动态罚款配置的站点
   * @param {Object} data {emailId,recipientId,notifyTypeIds}
   */
  assignIdleConfig(data) {
    return post(prefix + "assign-sites", data)
  },
  /**
   * 取消分配动态罚款配置的站点
   * @param {Object} data {emailId,recipientId,notifyTypeIds}
   */
  unassignIdleConfig(data) {
    return post(prefix + "unassign-sites", data)
  },
}

export default apiIdle