Documentation ¶
Index ¶
Constants ¶
View Source
const ( ActivityUserRangeAll = "all" ActivityUserRangeImport = "import" ActivityUserRangeNew = "new" )
View Source
const ( WriteMysql = "writeMysql" ReadMysql = "readMysql" )
Variables ¶
View Source
var ( Success = ErrorCode{Code: 0, Msg: "success"} ErrActivityNotExists = ErrorCode{Code: 10001, Msg: "活动不存在"} ErrCouponNotInActivity = ErrorCode{Code: 10002, Msg: "优惠券不在活动范围内"} ErrUserNotInActivity = ErrorCode{Code: 10003, Msg: "用户不在活动范围内"} ErrUserAlreadyGetCoupon = ErrorCode{Code: 10004, Msg: "用户已领取优惠券"} ErrActivityAlreadyEnd = ErrorCode{Code: 10005, Msg: "活动已结束"} ErrActivityNotStart = ErrorCode{Code: 10006, Msg: "活动未开始"} ErrActivityStateOffline = ErrorCode{Code: 10007, Msg: "活动已下线"} ErrActivityAuditReject = ErrorCode{Code: 10008, Msg: "活动审核未通过"} ErrTemplateCodeInvalid = ErrorCode{Code: 10009, Msg: "优惠券模板编码无效"} ErrActivityParamsError = ErrorCode{Code: 10010, Msg: "活动参数错误"} ErrActivityCouponTooHot = ErrorCode{Code: 10011, Msg: "活动优惠券太火爆"} ErrActivityCouponNoStock = ErrorCode{Code: 10012, Msg: "活动优惠券已抢完"} )
Functions ¶
This section is empty.
Types ¶
type Activity ¶
type Activity struct { Id int64 Name string State int //1启用、2-禁用 AuditState int //1-通过、2-驳回 AuditTime int64 StartTime int64 EndTime int64 CreateTime int64 UpdateTime int64 UserRange string //all-全部、import-导入、new-新注册 }
func FindActivityById ¶
type ActivityCoupon ¶
type ActivityCoupon struct { ActivityId int64 TemplateCode string Num int //投放数量 OneAccountNum int //单账号领取数量 }
func FindActivityCouponList ¶
func FindActivityCouponList(activityId int64) (res []*ActivityCoupon, err error)
func (*ActivityCoupon) TableName ¶
func (t *ActivityCoupon) TableName() string
type ActivityCouponGroupView ¶
func FindActivityCouponGroup ¶
func FindActivityCouponGroup(activityId int64, templateCode string) (res *ActivityCouponGroupView, err error)
type ActivityUserImport ¶
func FindActivityUserImportList ¶
func FindActivityUserImportList(activityId int64) (res []*ActivityUserImport, err error)
func (*ActivityUserImport) TableName ¶
func (t *ActivityUserImport) TableName() string
type CouponTemplate ¶
type CouponTemplate struct { Id int64 TemplateCode string Type string Amount int64 Threshold int64 ExpireType int StartTime int64 EndTime int64 Days int Stock int }
func (*CouponTemplate) TableName ¶
func (t *CouponTemplate) TableName() string
type UseCoupon ¶
type User ¶
type UserActivityCouponGroupView ¶
type UserActivityCouponGroupView struct { ActivityId int64 UserId int64 TemplateCode string Num int }
func FindUserActivityCouponGroup ¶
func FindUserActivityCouponGroup(activityId, userId int64, templateCode string) (res *UserActivityCouponGroupView, err error)
Click to show internal directories.
Click to hide internal directories.