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

/**
 * 恢复
 */
export const A7_APIrecover = (ids: string) => {
  return http.get(`cms/recycle/recover/${ids}`);
};

/**
 * 删除
 */
export const A7_APIdel = (ids: string) => {
  return http.get(`cms/recycle/remove/${ids}`);
};

/**
 * 文件占用总内存
 */
export const A7_APIgetSizeAll = () => {
  return http.get("cms/recycle/getSize");
};
