seckillActivity.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import request from '@/config/axios'
  2. import { Sku, SpuRespVO } from '@/api/mall/product/spu'
  3. export interface SeckillActivityVO {
  4. id: number
  5. spuIds: number[]
  6. name: string
  7. status: number
  8. remark: string
  9. startTime: Date
  10. endTime: Date
  11. sort: number
  12. configIds: string
  13. orderCount: number
  14. userCount: number
  15. totalPrice: number
  16. totalLimitCount: number
  17. singleLimitCount: number
  18. stock: number
  19. totalStock: number
  20. products: SeckillProductVO[]
  21. }
  22. export interface SeckillProductVO {
  23. spuId: number
  24. skuId: number
  25. seckillPrice: number
  26. stock: number
  27. }
  28. type SkuExtension = Sku & {
  29. productConfig: SeckillProductVO
  30. }
  31. export interface SpuExtension extends SpuRespVO {
  32. skus: SkuExtension[] // 重写类型
  33. }
  34. // 查询秒杀活动列表
  35. export const getSeckillActivityPage = async (params) => {
  36. return await request.get({ url: '/promotion/seckill-activity/page', params })
  37. }
  38. // 查询秒杀活动详情
  39. export const getSeckillActivity = async (id: number) => {
  40. return await request.get({ url: '/promotion/seckill-activity/get?id=' + id })
  41. }
  42. // 新增秒杀活动
  43. export const createSeckillActivity = async (data: SeckillActivityVO) => {
  44. return await request.post({ url: '/promotion/seckill-activity/create', data })
  45. }
  46. // 修改秒杀活动
  47. export const updateSeckillActivity = async (data: SeckillActivityVO) => {
  48. return await request.put({ url: '/promotion/seckill-activity/update', data })
  49. }
  50. // 删除秒杀活动
  51. export const deleteSeckillActivity = async (id: number) => {
  52. return await request.delete({ url: '/promotion/seckill-activity/delete?id=' + id })
  53. }
  54. // 导出秒杀活动 Excel
  55. export const exportSeckillActivityApi = async (params) => {
  56. return await request.download({ url: '/promotion/seckill-activity/export-excel', params })
  57. }