sse_logic.tpl 557 B

1234567891011121314151617181920212223242526272829
  1. // Code scaffolded by goctl. Safe to edit.
  2. // goctl {{.version}}
  3. package {{.pkgName}}
  4. import (
  5. {{.imports}}
  6. )
  7. type {{.logic}} struct {
  8. logx.Logger
  9. ctx context.Context
  10. svcCtx *svc.ServiceContext
  11. }
  12. {{if .hasDoc}}{{.doc}}{{end}}
  13. func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}} {
  14. return &{{.logic}}{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *{{.logic}}) {{.function}}({{.request}}) {{.responseType}} {
  21. // todo: add your logic here and delete this line
  22. {{.returnString}}
  23. }