import request from "../../utils/request";
import qs from "qs";
let setqs = function (data) {
  return qs.stringify(data);
};

// 保存内容
export function saveMessageApi (data) {
  console.log(data);
  return request({
    url: `/admin/cms/save`,
    method: "POST",
    data,
  });
}
// 修改内容
export function updateMessageApi (data) {
  return request({
    url: `/admin/cms/update`,
    method: "PUT",
    data,
  });
}

//  获取内容列表
export function getMessageListApi (data) {
  return request({
    url: `/admin/cms/${data.page}/${data.limit}`,
    method: "get",
    params: {
      status: data.status,
      keyword: data.keyword
    }
    // data,
  });
}
// 获取内容
export function getMessageDetailApi (id) {
  return request({
    url: `/admin/cms/get/${id}`,
    method: "get",
    // data,
  });
}

// 导入股权结构文件
export function importStockModelApi (data) {
  return request({
    url: `/admin/stock/structure/import`,
    method: "post",
    headers: {
      "Content-Type": 'multipart/form-data',
    },
    data: setqs(data)
  });
}


// 获取股权结构列表
export function getStockInfoListApi (data) {
  return request({
    url: `/admin/stock/structure/list`,
    method: "get",
  });
}
// 获取股权结构列表
export function getStockMoreListApi (data) {
  return request({
    url: `/admin/stock/change/list`,
    method: "get",
  });
}


// 删除用户
export function delMessageApi (data) {
  return request({
    url: `/admin/cms/remove/${data}`,
    method: "DELETE",
  });
}
