/*
 * @Author: wenjie 1454560336@qq.com
 * @Date: 2024-05-20 16:59:06
 * @LastEditors: wenjie 1454560336@qq.com
 * @LastEditTime: 2024-09-06 11:32:09
 * @FilePath: \admin-manage\src\api\coupon.js
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
 */
import request from '@/utils/request'

// 获取优惠券列表
export function getCouponList(params) {
  return request({
    url: '/zswl-cloud-shop/couponInfo/search',
    method: 'get',
    params
  })
}

// 获取优惠券详情
export function detail(params) {
  return request({
    url: '/zswl-cloud-shop/couponInfo/detail',
    method: 'get',
    params
  })
}
// 优惠券创建修改
export function saveOrUpdate(data) {
    return request({
      url: '/zswl-cloud-shop/couponInfo/saveOrUpdate',
      method: 'post',
      data
    })
}

// 优惠券删除
export function delCoupon(params) {
    return request({
      url: '/zswl-cloud-shop/couponInfo/del',
      method: 'get',
      params
    })
}

// 优惠券停止
export function stop(params) {
  return request({
    url: '/zswl-cloud-shop/couponInfo/stop',
    method: 'get',
    params
  })
}


// 根据优惠券id查询商品列表
export function getGoodsInfoByCoupon(params) {
  return request({
    url: '/zswl-cloud-shop/couponInfo/getGoodsInfoByCoupon',
    method: 'get',
    params
  })
}
