import { PORT1 } from "@/api/config/servicePort";
import { Promotion, ResPage, Result, ReqDelete, ResultData } from "@/api/interface/index";
import http from "@/api";

/**
 * @name 获取渠道第三方渠道
 */
// 获取渠道第三方渠道分页列表
export const promotionSitePaginate = (params: Promotion.ReqPromotionTableListForm) => {
  return http.get<ResPage<Promotion.ResPromotionSite>>(PORT1 + `/agency/promotionSite/paginate`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};

/**
 * @name 创建或修改推广位
 */
// 创建或修改推广位
export const promotionSiteUpdateOrCreate = (params: Promotion.ReqUpdateOrCreate) => {
  return http.post<Result>(PORT1 + `/agency/promotionSite/updateOrCreate`, params, {
    loading: false
  }); // 正常 post json 请求  ==>  application/json
};

/**
 * @name 删除推广位
 */
// 删除推广位
export const promotionSiteDelete = (params: ReqDelete) => {
  return http.post<Result>(PORT1 + `/agency/promotionSite/delete`, params, {
    loading: false
  });
};

/**
 * @name 获取推广商品列表
 */
// 获取推广商品列表
export const getPromotionGoodsList = (params: ReqDelete) => {
  return http.get<ResultData>(PORT1 + `/agency/promotionGoods/list`, params, {
    loading: false
  });
};
