import http from "@/utils/http";
import { AppDispatch } from "..";
/**
 * 获取 留言反馈 列表
 */
export const A6_APIgetList = (data: any) => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post("cms/message/pageList", data);
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total,
      };
      dispatch({ type: "A6/getList", payload: obj });
    }
  };
};

/**
 * 获取 留言反馈 列表(导出)
 */
export const A6_APIgetListDerive = (data: any) => {
  return http.post("cms/message/pageList", data);
};

/**
 * 处理状态
 */
export const A6_APIgetInfo = (id: number, isSend: 1 | 2) => {
  return http.get(`cms/message/update/${id}/${isSend}`);
};
