import request from '@/utils/request';
//查询菜单
export function getMenuList(data) {
  return request({
    url: '/wechatMp/menu/list',
    method: 'get',
    data,
  });
}
//获取菜单类型
export function getMenuType(data) {
  return request({
    url: '/wechatMp/menu/type',
    method: 'get',
    data,
  });
}
//创建菜单
export function addMenuPub(data) {
  return request({
    url: '/wechatMp/menu/pub',
    method: 'post',
    data,
  });
}
//删除菜单
export function delMenuRemove() {
  return request({
    url: '/wechatMp/menu/remove',
    method: 'post',
  });
}
//关注自动回复
//查询回复规则
export function getSubscribeReply(data) {
  return request({
    url: '/wechatMp/subscribeReply/getReply',
    method: 'get',
    data,
  });
}
//根据素材类型分页查询素材列表
export function getMaterialList(data) {
  if (data.page == null) {
    data.page = 1;
  }
  const param =
    '?page=' + data.page + '&size=' + data.size + '&type=' + data.type;
  return request({
    url: '/wechatMp/material/list' + param,
    method: 'get',
    data,
  });
}
//素材类型字典查询
export function getMaterialType(data) {
  return request({
    url: '/wechatMp/material/type',
    method: 'get',
    data,
  });
}
//消息类型字典查询
export function getMaterialMsgType(data) {
  return request({
    url: '/wechatMp/subscribeReply/msgType',
    method: 'get',
    data,
  });
}
//保存或修改
export function materialSaveOrUpdate(data) {
  return request({
    url: '/wechatMp/subscribeReply/saveOrUpdate',
    method: 'post',
    data,
  });
}
//删除
export function materialRemove(data) {
  return request({
    url: '/wechatMp/subscribeReply/remove?id=' + data.id,
    method: 'post',
    data,
  });
}
//关键词自动回复
//关键字匹配类型
export function getMatchType(data) {
  return request({
    url: '/wechatMp/keywordReply/matchType',
    method: 'get',
    data,
  });
}

//查询
export function getKeywordReplyList(data) {
  const param = '?page=' + data.page + '&size=' + data.size;
  return request({
    url: '/wechatMp/keywordReply/list' + param,
    method: 'get',
    data,
  });
}
//新增
export function keywordReplyAdd(data) {
  return request({
    url: '/wechatMp/keywordReply/insert',
    method: 'post',
    data,
  });
}
//修改
export function keywordReplyEdit(data) {
  return request({
    url: '/wechatMp/keywordReply/update',
    method: 'post',
    data,
  });
}
//删除
export function keywordReplyRemove(data) {
  return request({
    url: '/wechatMp/keywordReply/remove',
    method: 'post',
    data,
  });
}
//默认自动回复
//查询回复规则
export function getReplyType(data) {
  return request({
    url: '/wechatMp/defaultReply/getReply',
    method: 'get',
    data,
  });
}
//查询回复规则
export function getDefaultReplyType(data) {
  return request({
    url: '/wechatMp/defaultReply/getReply',
    method: 'get',
    data,
  });
}
//保存或修改
export function defaultReplySaveOrUpdate(data) {
  return request({
    url: '/wechatMp/defaultReply/saveOrUpdate',
    method: 'post',
    data,
  });
}
//删除
export function defaultReplyRemove(data) {
  return request({
    url: '/wechatMp/defaultReply/remove?id=' + data.id,
    method: 'post',
    data,
  });
}
