2023-06-17 21:20:28 +08:00
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
export interface SeckillConfigVO {
|
|
|
|
id: number
|
|
|
|
name: string
|
2023-06-19 10:20:43 +08:00
|
|
|
startTime: string
|
|
|
|
endTime: string
|
2023-06-17 21:20:28 +08:00
|
|
|
picUrl: string
|
|
|
|
status: number
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询秒杀时段配置列表
|
|
|
|
export const getSeckillConfigPage = async (params) => {
|
|
|
|
return await request.get({ url: '/promotion/seckill-config/page', params })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询秒杀时段配置详情
|
|
|
|
export const getSeckillConfig = async (id: number) => {
|
|
|
|
return await request.get({ url: '/promotion/seckill-config/get?id=' + id })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 新增秒杀时段配置
|
|
|
|
export const createSeckillConfig = async (data: SeckillConfigVO) => {
|
|
|
|
return await request.post({ url: '/promotion/seckill-config/create', data })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 修改秒杀时段配置
|
|
|
|
export const updateSeckillConfig = async (data: SeckillConfigVO) => {
|
|
|
|
return await request.put({ url: '/promotion/seckill-config/update', data })
|
|
|
|
}
|
|
|
|
|
2023-06-19 10:20:43 +08:00
|
|
|
// 修改时段配置状态
|
|
|
|
export const updateSeckillConfigStatus = (id: number, status: number) => {
|
|
|
|
const data = {
|
|
|
|
id,
|
|
|
|
status
|
|
|
|
}
|
|
|
|
return request.put({ url: '/promotion/seckill-config/update-status', data: data })
|
|
|
|
}
|
|
|
|
|
2023-06-17 21:20:28 +08:00
|
|
|
// 删除秒杀时段配置
|
|
|
|
export const deleteSeckillConfig = async (id: number) => {
|
|
|
|
return await request.delete({ url: '/promotion/seckill-config/delete?id=' + id })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 导出秒杀时段配置 Excel
|
|
|
|
export const exportSeckillConfigApi = async (params) => {
|
|
|
|
return await request.download({ url: '/promotion/seckill-config/export-excel', params })
|
|
|
|
}
|