Documentation ¶
Index ¶
- Constants
- func InsPlHlds(colCnt int, rowCnt int) string
- type Batch
- type Charge
- type DistOrderArg
- type DistOrderGetArg
- type GetSettleOrdersRequest
- type MsgContent
- type OrderDetail
- func (o *OrderDetail) Decrypt(c *encoding.EncryptConfig)
- func (o *OrderDetail) Encrypt(c *encoding.EncryptConfig)
- func (o *OrderDetail) GetFields(except *types.FieldMask) []string
- func (o *OrderDetail) GetPtrs(fields *types.FieldMask, vptr map[int]interface{}) []interface{}
- func (o *OrderDetail) GetVals(fields *types.FieldMask, asString bool) []interface{}
- type OrderInfo
- type OrderMain
- type OrderMainQuerier
- type OrderPayCharge
- type OrderSKU
- type OrderStockCnt
- type Promotion
- type PromotionGroup
- type PromotionOrder
- type SKUStock
- type SKUStockLog
- type SettleOrder
- type SettleOrders
- type SkuCnt
- type Ticket
- type TicketSend
Constants ¶
View Source
const ( CacheKeyOrderList = "order_ls" //订单列表缓存 CacheKeyOrderMn = "order_mn" //order_main缓存 CacheKeyOrderCnt = "order_cnt" //订单数缓存 CacheKeyOrderDt = "order_dt" //order_detail缓存 CacheKeyOrderSKU = "order_sku" //order_sku缓存 CacheKeyOrderPayCh = "order_ch" //order_pay_charge缓存 CacheKeyStock = "stock:%d" // 库存数 redis key 前缀 CacheKeyStockL = "locked:%d" // 锁定库存数 redisKey 前缀 CacheKeySku = "sku:%d" // skuId => sku redis key 前缀 CacheKeyItemSku = "sku.item:%d" // itemId => sku redis key 前缀 // 票相关 key CacheKeyScreenSales = "ticket:screen.sales" // hash {sid:cnt} 各场次总的出票数 CacheKeyScreenDailySales = "ticket:screen.daily" // hash {sid:cnt} 各场次的当日销量 CacheKeyUserBuyScreen = "ticket:user.screen:%d" // hash {sid:cnt} 用户购买各场次票数量 CacheKeyOrderTickets = "ticket:order.tks:%d" // 一笔订单下所有电子票信息 CacheKeyScreenTickets = "ticket:screens.tks:%d:%d" // 一个场次下用户电子票信息 CacheKeyTicketQr = "ticket:qr.tk:%s" // 一个二维码对应电子票信息 CacheKeyTicket = "ticket:tk:%d" // 单张电子票信息 CacheKeyTicketPool = "ticket:pool:%d" // sku票池 CacheKeyTicketSend = "ticket:send:%d" // 票的赠送信息 send_tid => ticket_send CacheKeyTicketRecv = "ticket:recv:%d" // 票的赠送信息 recv_tid => ticket_send RedisExpireStock = 120 // 库存量缓存过期时间 RedisExpireStockTmp = 2 // 库存量缓存过期时间 RedisExpireSku = 1800 // SKU信息缓存过期时间 RedisExpireSkuTmp = 2 // SKU信息缓存过期时间 RedisExpireTenMin = 600 // 过期时间 10 分钟 RedisExpireTenMinTmp = 2 // 过期时间 10 分钟 RedisExpireOneDay = 86400 // 过期时间 1 天 RedisExpireOneDayTmp = 2 // 过期时间 1 天 兼容版 CacheKeyPromo = "%d:promotion:sales" //拼团活动缓存 CacheKeyPromoGroup = "%d:promotion:group:sales" //团缓存 CacheKeyPromoOrder = "%d:promotion:order:sales" //拼团订单缓存 CacheKeyPromoOrders = "%d:promotion:orders:sales" //拼团团订单缓存 RedisExpirePromo = 1 // 过期时间5分钟 to do RedisExpirePromoGroup = 1 // 过期时间5分钟 to do RedisExpirePromoOrder = 1 // 过期时间5分钟 to do RedisExpirePromoOrders = 1 // 过期时间5分钟 to do )
缓存key的常量
View Source
const ( OrderPaid = 2 OrderRefunded = 3 OrderRefundPartly = 2 OrderRefundedAll = 4 )
Order...主订单表状态
View Source
const ( DistOrderNormal = 1 DistOrderRefunded = 2 DistOrderPartlyRefunded = 3 )
DistOrder...分销订单表状态
View Source
const SpecsSeparator = "_"
SpecsSeparator sku 规格分隔符
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Batch ¶
type Batch struct { ScreenID int64 // 场次 ID TicketPriceID int64 // 票价 ID 就是 sku_stock SKUID SkAlert int64 // 库存预警数 TotalStock int64 // 总库存数 }
Batch 批量库存操作
type Charge ¶
type Charge struct { ID string Paid bool Refunded bool OrderID int64 DeviceType int64 Channel int64 Amount int64 TimePaid xtime.Time }
Charge 支付回调结构体
type DistOrderArg ¶
type DistOrderArg struct { Oid uint64 `form:"oid" validate:"required"` CmAmount uint64 `form:"cm_amount" validate:"min=1,required"` CmMethod int64 `form:"cm_method" validate:"min=1,required"` CmPrice uint64 `form:"cm_price" validate:"min=1,required"` Duid uint64 `form:"dist_user" validate:"min=0"` Stat int64 `form:"status" validate:"min=0"` Pid uint64 `form:"pid" validate:"min=0"` Count uint64 `form:"count" validate:"min=1,required"` Sid uint64 `form:"sid" validate:"min=0"` Type int64 `form:"type" validate:"min=0"` RefStat int64 `form:"refund_status" validate:"min=0"` PayAmount uint64 `form:"payment_amount" validate:"min=0"` Serial string `form:"serial" validate:"required"` }
DistOrderArg 分销订单同步入参
type DistOrderGetArg ¶
type DistOrderGetArg struct {
Oid uint64 `form:"oid" validate:"required"`
}
DistOrderGetArg 分销订单查询入参
type GetSettleOrdersRequest ¶
type GetSettleOrdersRequest struct { Date string `form:"date" validate:"required"` Ref byte `form:"ref"` ExtParams string `form:"extParams" validate:"omitempty,numeric"` PageSize int `form:"pagesize"` }
GetSettleOrdersRequest 获取结算订单请求
type MsgContent ¶
MsgContent 支付回调 msgContent 字段的结构 由于 MsgContent 可能增/减字段故使用 map 兼容
func (MsgContent) ToCharge ¶
func (m MsgContent) ToCharge() (charge *Charge, err error)
ToCharge 生成 charge 结构
type OrderDetail ¶
type OrderDetail struct { OrderID int64 `json:"order_id"` Buyer string `json:"buyer"` Tel string `json:"tel"` PersonalID string `json:"personal_id"` ExpressCO string `json:"express_co"` ExpressNO string `json:"express_no"` ExpressType int16 `json:"express_type"` Remark string `json:"remark"` DeviceType int16 `json:"device_type"` IP []byte `json:"ip"` Coupon *_type.OrderCoupon `json:"coupon"` DeliverDetail *_type.OrderDeliver `json:"deliver_detail"` Detail *_type.OrderExtra `json:"detail"` MSource string `json:"msource"` CTime time.Time `json:"-"` MTime time.Time `json:"-"` }
OrderDetail 订单详情表信息
func (*OrderDetail) Decrypt ¶
func (o *OrderDetail) Decrypt(c *encoding.EncryptConfig)
Decrypt 解密order_detail字段
func (*OrderDetail) Encrypt ¶
func (o *OrderDetail) Encrypt(c *encoding.EncryptConfig)
Encrypt 加密order_detail的字段
func (*OrderDetail) GetFields ¶
func (o *OrderDetail) GetFields(except *types.FieldMask) []string
GetFields 获取order_detail字段名称
type OrderInfo ¶
type OrderInfo struct { Oid uint64 `json:"oid"` CmAmount uint64 `json:"cm_amount"` CmMethod int64 `json:"cm_method"` CmPrice uint64 `json:"cm_price"` Duid uint64 `json:"duid"` Stat int64 `json:"status"` Pid uint64 `json:"pid"` Count uint64 `json:"count"` Sid uint64 `json:"sid"` Type int64 `json:"type"` PayAmount uint64 `json:"pay_amount"` Serial string `json:"serial_num"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` }
OrderInfo 订单同步字段
type OrderMain ¶
type OrderMain struct { OrderID int64 `json:"order_id"` UID string `json:"uid"` OrderType int16 `json:"order_type"` ItemID int64 `json:"item_id"` ItemInfo *_type.OrderItemInfo `json:"item_info"` Count int64 `json:"count"` TotalMoney int64 `json:"total_money"` PayMoney int64 `json:"pay_money"` ExpressFee int64 `json:"express_fee"` PayChannel int16 `json:"pay_channel"` PayTime int64 `json:"pay_time"` Source string `json:"source"` Status int16 `json:"status"` SubStatus int16 `json:"sub_status"` RefundStatus int16 `json:"refund_status"` IsDeleted int16 `json:"is_deleted"` CTime time.Time `json:"ctime"` MTime time.Time `json:"mtime"` }
OrderMain 订单主表结构
type OrderPayCharge ¶
type OrderPayCharge _type.OrderPayCharge
OrderPayCharge 订单支付表结构
type OrderSKU ¶
type OrderSKU _type.OrderSKU
OrderSKU order_sku表结构
type Promotion ¶
type Promotion struct { PromoID int64 `json:"promo_id"` Type int16 `json:"type"` ItemID int64 `json:"item_id"` SKUID int64 `json:"sku_id"` Extra int64 `json:"extra"` ExpireSec int64 `json:"expire_sec"` SKUCount int64 `json:"sku_count"` Amount int64 `json:"amount"` BuyerCount int64 `json:"buyer_count"` BeginTime int64 `json:"begin_time"` EndTime int64 `json:"end_time"` Status int16 `json:"status"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` PrivSKUID int64 `json:"priv_sku_id"` UsableCoupons string `json:"usable_coupons"` }
Promotion 活动表
type PromotionGroup ¶
type PromotionGroup struct { PromoID int64 `json:"promo_id"` GroupID int64 `json:"group_id"` UID int64 `json:"uid"` OrderCount int64 `json:"order_count"` Status int16 `json:"status"` ExpireAt int64 `json:"expire_at"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` }
PromotionGroup 拼团表
type PromotionOrder ¶
type PromotionOrder struct { PromoID int64 `json:"promo_id"` GroupID int64 `json:"group_id"` OrderID int64 `json:"order_id"` IsMaster int16 `json:"is_master"` UID int64 `json:"uid"` Status int16 `json:"status"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` SKUID int64 `json:"sku_id"` }
PromotionOrder 拼团订单表
type SKUStock ¶
type SKUStock struct { SKUID int64 `db:"sku_id"` ParentSKUID int64 `db:"parent_sku_id"` ItemID int64 `db:"item_id"` Specs string `db:"specs"` TotalStock int64 `db:"total_stock"` Stock int64 `db:"stock"` LockedStock int64 `db:"locked_stock"` SkAlert int64 `db:"sk_alert"` Ctime time.Time `db:"ctime,autogen"` Mtime time.Time `db:"mtime,autogen"` }
SKUStock sku 库存
type SKUStockLog ¶
type SKUStockLog struct { ID int64 `db:"id"` SKUID int64 `db:"sku_id"` OpType int16 `db:"op_type"` SrcID int64 `db:"src_id"` Stock int64 `db:"stock"` CanceledAt time.Time `db:"canceled_at"` Ctime time.Time `db:"ctime,autogen"` Mtime time.Time `db:"mtime,autogen"` }
SKUStockLog sku 库存操作日志
type SettleOrder ¶
type SettleOrder struct { ID int64 `json:"-"` OrderID int64 `json:"order_id"` RefID int64 `json:"ref_id"` RefundApplyTime time.Time `json:"-"` }
SettleOrder 获取结算订单返回
type SettleOrders ¶
type SettleOrders struct { Data []*SettleOrder `json:"data"` ExtParams string `json:"extParams"` }
SettleOrders 获取结算订单返回
type Ticket ¶
type Ticket struct { ID int64 `json:"id"` UID int64 `json:"uid"` OID int64 `json:"oid"` SID int64 `json:"sid"` Price int64 `json:"price"` Src int16 `json:"src"` Type int16 `json:"type"` Status int16 `json:"status"` Qr string `json:"qr"` RefID int64 `json:"ref_id"` SkuID int64 `json:"sku_id"` SeatID int64 `json:"seat_id"` Seat string `json:"seat"` RefundApplyTime xtime.Time `json:"refund_apply_time"` ETime xtime.Time `json:"etime"` CTime xtime.Time `json:"ctime"` MTime xtime.Time `json:"mtime"` }
Ticket ticket 表结构
type TicketSend ¶
type TicketSend struct { ID int64 `json:"id"` SID int64 `son:"sid"` SendTID int64 `json:"send_tid"` RecvTID int64 `json:"recv_tid"` SendUID int64 `json:"send_uid"` RecvUID int64 `json:"recv_uid"` RecvTel string `json:"recv_tel"` Status int16 `json:"status"` CTime xtime.Time `json:"ctime"` MTime xtime.Time `json:"mtime"` OID int64 `json:"oid"` }
TicketSend ticket_send 表结构
Source Files ¶
Click to show internal directories.
Click to hide internal directories.