mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 17:20:24 +08:00
8c0bb27136
Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
27 lines
488 B
Smarty
27 lines
488 B
Smarty
package {{.pkgName}}
|
|
|
|
import (
|
|
{{.imports}}
|
|
)
|
|
|
|
type {{.logic}} struct {
|
|
logx.Logger
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
}
|
|
|
|
{{if .hasDoc}}{{.doc}}{{end}}
|
|
func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}} {
|
|
return &{{.logic}}{
|
|
Logger: logx.WithContext(ctx),
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
func (l *{{.logic}}) {{.function}}({{.request}}) {{.responseType}} {
|
|
// todo: add your logic here and delete this line
|
|
|
|
{{.returnString}}
|
|
}
|