import request from '@/utils/request'

// 获取秒杀活动列表
export function getActivityList(params) {
  return request({
    url: '/sec-kill/goods/list/activity/page',
    method: 'get',
    params
  })
}

// 获取秒杀商品列表
export function getSeckillGoodsList(params) {
  return request({
    url: '/sec-kill/goods/list/spec/page',
    method: 'get',
    params
  })
}

// 更改活动状态 - 关闭
export function closeActivityStatus(params) {
  return request({
    url: '/sec-kill/goods/activity/close',
    method: 'post',
    params
  })
}

// 更改活动状态 - 开启
export function openActivityStatus(params) {
  return request({
    url: '/sec-kill/goods/activity/open',
    method: 'post',
    params
  })
}

// 更改商品状态 - 关闭
export function closeGoodsStatus(params) {
  return request({
    url: '/sec-kill/goods/spec/close',
    method: 'post',
    params
  })
}

// 更改商品状态 - 开启
export function openGoodsStatus(params) {
  return request({
    url: '/sec-kill/goods/spec/close',
    method: 'post',
    params
  })
}

// 删除商品
export function deleteGoods(params) {
  return request({
    url: '/sec-kill/goods/spec/delete',
    method: 'post',
    params
  })
}

// 添加活动
export function addActivity(params) {
  return request({
    url: '/sec-kill/goods/activity/add',
    method: 'post',
    data: params
  })
}

// 编辑活动
export function editActivity(params) {
  return request({
    url: '/sec-kill/goods/activity/update',
    method: 'post',
    data: params
  })
}

// 获取分类列表
export function getClassifyList(params) {
  return request({
    url: '/goods/category/list',
    method: 'get',
    params
  })
}

// 获取商品列表
export function getGoodsList(params) {
  return request({
    url: '/sec-kill/goods/list/spec/select',
    method: 'get',
    params
  })
}

// 获取活动详情
export function getActivityDetail(params) {
  return request({
    url: '/sec-kill/goods/activity/detail',
    method: 'get',
    params
  })
}