import request from "@/utils/request";
import { Account_BaseUrl } from "@/api/config";
const baseURL = Account_BaseUrl + "/admin";
// 供应商
const Api = {
  /** 通知消息列表*/
  getList(params: any) {
    return request<any>({
      url: `${baseURL}/syncNotice`,
      method: "get",
      params,
    });
  },
  /** 全部*/
  getAllList(params: any) {
    return request<any>({
      url: `${baseURL}/list`,
      method: "get",
      params,
    });
  },
  get(id: string | number) {
    return request<any>({
      url: `${baseURL}/` + id,
      method: "get",
    });
  },
  add(data: any) {
    return request<any>({
      url: `${baseURL}`,
      method: "post",
      data,
    });
  },
  edit(data: any) {
    return request<any>({
      url: `${baseURL}/syncNotice/read`,
      method: "put",
      data,
    });
  },

  delete(id: string | number) {
    return request<any>({
      url: `${baseURL}/syncNotice?id=` + id,
      method: "delete",
    });
  },
  // 清空已读
  syncNoticeclear() {
    return request<any>({
      url: `${baseURL}/syncNotice/clear`,
      method: "delete",
    });
  },
};

export default Api;
