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

/**
 * 获取MsgCat Category分页
 * @param data
 * @returns
 */
export function getMsgCatByPage(data: any) {
  return apiRequest({
    url: '/msg/cat/page',
    method: 'GET',
    params: data,
  })
}

/**
 * 获取MsgCat Category列表
 * @param data
 * @returns
 */
export function getMsgCatByList(data: any) {
  return apiRequest({
    url: '/msg/cat',
    method: 'GET',
    params: data,
  })
}

/**
 * 根据Id获取MsgCat Category
 * @returns
 * @param id
 */
export function getMsgCatById(id: number) {
  return apiRequest({
    url: `/msg/cat/${id}`,
    method: 'GET',
  })
}

/**
 * 添加MsgCat Category
 * @param data
 * @returns
 */
export function createMsgCat(data: any) {
  return apiRequest({
    url: '/msg/cat/add',
    method: 'POST',
    data,
  })
}

/**
 * 更新MsgCat Category
 * @param data
 * @returns
 */
export function updateMsgCat(data: any) {
  return apiRequest({
    url: '/msg/cat/update',
    method: 'PUT',
    data,
  })
}

/**
 * 删除MsgCat Category
 * @returns
 * @param id
 */
export function deleteMsgCatById(id: number) {
  return apiRequest({
    url: `/msg/cat/${id}`,
    method: 'DELETE',
  })
}
