Skip to content

Update template.go #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions go/patterns/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,7 @@ func (lottery *Lottery) Run(ctx *Context) (err error) {
// checkSerialNo 校验活动编号(serial_no)是否存在
func (lottery *Lottery) checkSerialNo(ctx *Context) (err error) {
fmt.Println(runFuncName(), "校验活动编号(serial_no)是否存在、并获取活动信息...")
// 获取活动信息伪代码
ctx.ActInfo = &ActInfo{
// 假设当前的活动类型为按抽奖次数抽奖
ActivityType: ConstActTypeTimes,
}


// 获取当前抽奖类型的具体行为
switch ctx.ActInfo.ActivityType {
Expand Down Expand Up @@ -247,6 +243,7 @@ func (lottery *Lottery) packagePrizeInfo(ctx *Context) (err error) {
}

func main() {
ctx:=&Context{&ActInfo{ActivityType: ConstActTypeAmount} }
(&Lottery{}).Run(&Context{})
}

Expand Down