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-07-10 16:39:22 +08:00
|
|
|
sliderPicUrls: string[]
|
2023-06-17 21:20:28 +08:00
|
|
|
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 })
|
|
|
|
}
|
|
|
|
|
2023-06-22 17:31:36 +08:00
|
|
|
// 获得所有开启状态的秒杀时段精简列表
|
|
|
|
export const getListAllSimple = async () => {
|
|
|
|
return await request.get({ url: '/promotion/seckill-config/list-all-simple' })
|
|
|
|
}
|
|
|
|
|
2023-06-17 21:20:28 +08:00
|
|
|
// 新增秒杀时段配置
|
|
|
|
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 })
|
|
|
|
}
|