logic.tpl 458 B

12345678910111213141516171819202122232425
  1. package {{.pkgName}}
  2. import (
  3. {{.imports}}
  4. )
  5. type {{.logic}} struct {
  6. logx.Logger
  7. ctx context.Context
  8. svcCtx *svc.ServiceContext
  9. }
  10. func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}} {
  11. return &{{.logic}}{
  12. Logger: logx.WithContext(ctx),
  13. ctx: ctx,
  14. svcCtx: svcCtx,
  15. }
  16. }
  17. func (l *{{.logic}}) {{.function}}({{.request}}) {{.responseType}} {
  18. // todo: add your logic here and delete this line
  19. {{.returnString}}
  20. }