model

package
v0.0.0-...-5a65518 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

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

func FindActivityById(activityId int64) (res *Activity, err error)

func (*Activity) TableName

func (t *Activity) TableName() string

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

type ActivityCouponGroupView struct {
	ActivityId   int64
	TemplateCode string
	Num          int
}

func FindActivityCouponGroup

func FindActivityCouponGroup(activityId int64, templateCode string) (res *ActivityCouponGroupView, err error)

type ActivityUserImport

type ActivityUserImport struct {
	ActivityId int64
	UserId     int64
}

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 ErrorCode

type ErrorCode struct {
	Code int
	Msg  string
}

func NewErrorCode

func NewErrorCode(code int, msg string) ErrorCode

func NewErrorCodeErr

func NewErrorCodeErr(code int, err error) ErrorCode

func (ErrorCode) Error

func (e ErrorCode) Error() string

type UseCoupon

type UseCoupon struct {
	UserId       int64
	ActivityId   int64
	TemplateCode string
	CouponCode   string
	State        int //1-正常、2-已锁定、3-已核销、4-已作废
	CreateTime   int64
	StartTime    int64
	EndTime      int64
	Source       int //1-自主领取、2-系统发放、3-运营发放
}

func (*UseCoupon) TableName

func (t *UseCoupon) TableName() string

type User

type User struct {
	Id            int64
	Account       string
	Name          string
	Phone         string
	Password      string
	State         int //1-正常、2-锁定、3-已注销
	CreateTime    int64
	UpdateTime    int64
	LastLoginTime int64
	RealNameState int //0-未实名、1-已实名
	IdNumber      string
}

func (*User) TableName

func (t *User) TableName() string

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL