cache.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package model
  2. //缓存key的常量
  3. const (
  4. CacheKeyOrderList = "order_ls" //订单列表缓存
  5. CacheKeyOrderMn = "order_mn" //order_main缓存
  6. CacheKeyOrderCnt = "order_cnt" //订单数缓存
  7. CacheKeyOrderDt = "order_dt" //order_detail缓存
  8. CacheKeyOrderSKU = "order_sku" //order_sku缓存
  9. CacheKeyOrderPayCh = "order_ch" //order_pay_charge缓存
  10. CacheKeyStock = "stock:%d" // 库存数 redis key 前缀
  11. CacheKeyStockL = "locked:%d" // 锁定库存数 redisKey 前缀
  12. CacheKeySku = "sku:%d" // skuId => sku redis key 前缀
  13. CacheKeyItemSku = "sku.item:%d" // itemId => sku redis key 前缀
  14. // 票相关 key
  15. CacheKeyScreenSales = "ticket:screen.sales" // hash {sid:cnt} 各场次总的出票数
  16. CacheKeyScreenDailySales = "ticket:screen.daily" // hash {sid:cnt} 各场次的当日销量
  17. CacheKeyUserBuyScreen = "ticket:user.screen:%d" // hash {sid:cnt} 用户购买各场次票数量
  18. CacheKeyOrderTickets = "ticket:order.tks:%d" // 一笔订单下所有电子票信息
  19. CacheKeyScreenTickets = "ticket:screens.tks:%d:%d" // 一个场次下用户电子票信息
  20. CacheKeyTicketQr = "ticket:qr.tk:%s" // 一个二维码对应电子票信息
  21. CacheKeyTicket = "ticket:tk:%d" // 单张电子票信息
  22. CacheKeyTicketPool = "ticket:pool:%d" // sku票池
  23. CacheKeyTicketSend = "ticket:send:%d" // 票的赠送信息 send_tid => ticket_send
  24. CacheKeyTicketRecv = "ticket:recv:%d" // 票的赠送信息 recv_tid => ticket_send
  25. RedisExpireStock = 120 // 库存量缓存过期时间
  26. RedisExpireStockTmp = 2 // 库存量缓存过期时间
  27. RedisExpireSku = 1800 // SKU信息缓存过期时间
  28. RedisExpireSkuTmp = 2 // SKU信息缓存过期时间
  29. RedisExpireTenMin = 600 // 过期时间 10 分钟
  30. RedisExpireTenMinTmp = 2 // 过期时间 10 分钟
  31. RedisExpireOneDay = 86400 // 过期时间 1 天
  32. RedisExpireOneDayTmp = 2 // 过期时间 1 天 兼容版
  33. CacheKeyPromo = "%d:promotion:sales" //拼团活动缓存
  34. CacheKeyPromoGroup = "%d:promotion:group:sales" //团缓存
  35. CacheKeyPromoOrder = "%d:promotion:order:sales" //拼团订单缓存
  36. CacheKeyPromoOrders = "%d:promotion:orders:sales" //拼团团订单缓存
  37. RedisExpirePromo = 1 // 过期时间5分钟 to do
  38. RedisExpirePromoGroup = 1 // 过期时间5分钟 to do
  39. RedisExpirePromoOrder = 1 // 过期时间5分钟 to do
  40. RedisExpirePromoOrders = 1 // 过期时间5分钟 to do
  41. )