import request from '../utils/request'

const api = {
  Validate: '/Coupon/Validate',
  AdminList: '/Admin/Coupon/List',
  AdminDetail: '/Admin/Coupon/Detail',
  AdminSave: '/Admin/Coupon/Save'
}

export function validateCoupon(data) {
  return request({
    url: api.Validate,
    method: 'post',
    data
  })
}

export function adminCouponList(params) {
  return request({
    url: api.AdminList,
    method: 'get',
    params
  })
}

export function adminCouponDetail(params) {
  return request({
    url: api.AdminDetail,
    method: 'get',
    params
  })
}

export function adminSaveCoupon(data) {
  return request({
    url: api.AdminSave,
    method: 'post',
    data
  })
}
