make svcCtx as a member for better code generation

This commit is contained in:
kevin
2020-08-31 12:32:13 +08:00
parent 7b17b3604a
commit 36174ba5cc
2 changed files with 6 additions and 2 deletions

View File

@@ -22,13 +22,15 @@ import (
)
type {{.logicName}} struct {
ctx context.Context
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func New{{.logicName}}(ctx context.Context,svcCtx *svc.ServiceContext) *{{.logicName}} {
return &{{.logicName}}{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}