import { ResourceModule } from ".";

export const http = ResourceModule.http({
  // resource
  deleteResource(id: string) {
    return this.request(`/source/delete/${id}`, { method: "POST" });
  },
  createResource(data: any) {
    return this.request("/source/create", { method: "POST", data });
  },
  updateResouce(data: any) {
    return this.request("/source/update", { method: "POST", data });
  },

  //   templates
  queryTplsDetail(id: string) {
    return this.request(`/tpls/detail/${id}`, { method: "GET" });
  },
  
  sourceGen(data) {
    return this.request(`/sourceGen/create`, { method: "POST", data});
  },


  //   promotion
  createPromotion(data: any) {
    return this.request("/h5/create", { method: "POST", data });
  },

  updatePromotion(data: any) {
    return this.request("/h5/update", { method: "POST", data });
  },

  deletePromotion(id: string) {
    return this.request(`/h5/delete/${id}`, { method: "POST" });
  },


   //   comp
   createComp(data: any) {
    return this.request("/frame/create", { method: "POST", data });
  },

  updateComp(data: any) {
    return this.request("/frame/update", { method: "POST", data });
  },

  deleteComp(id: string) {
    return this.request(`/frame/delete/${id}`, { method: "POST" });
  },
});
