seckillConfig.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import request from '@/config/axios'
  2. export interface SeckillConfigVO {
  3. id: number
  4. name: string
  5. startTime: string
  6. endTime: string
  7. sliderPicUrls: string[]
  8. status: number
  9. }
  10. // 查询秒杀时段配置列表
  11. export const getSeckillConfigPage = async (params) => {
  12. return await request.get({ url: '/promotion/seckill-config/page', params })
  13. }
  14. // 查询秒杀时段配置详情
  15. export const getSeckillConfig = async (id: number) => {
  16. return await request.get({ url: '/promotion/seckill-config/get?id=' + id })
  17. }
  18. // 获得所有开启状态的秒杀时段精简列表
  19. export const getListAllSimple = async () => {
  20. return await request.get({ url: '/promotion/seckill-config/list-all-simple' })
  21. }
  22. // 新增秒杀时段配置
  23. export const createSeckillConfig = async (data: SeckillConfigVO) => {
  24. return await request.post({ url: '/promotion/seckill-config/create', data })
  25. }
  26. // 修改秒杀时段配置
  27. export const updateSeckillConfig = async (data: SeckillConfigVO) => {
  28. return await request.put({ url: '/promotion/seckill-config/update', data })
  29. }
  30. // 修改时段配置状态
  31. export const updateSeckillConfigStatus = (id: number, status: number) => {
  32. const data = {
  33. id,
  34. status
  35. }
  36. return request.put({ url: '/promotion/seckill-config/update-status', data: data })
  37. }
  38. // 删除秒杀时段配置
  39. export const deleteSeckillConfig = async (id: number) => {
  40. return await request.delete({ url: '/promotion/seckill-config/delete?id=' + id })
  41. }