consts_gen_ctrl_template.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
  2. //
  3. // This Source Code Form is subject to the terms of the MIT License.
  4. // If a copy of the MIT was not distributed with this file,
  5. // You can obtain one at https://github.com/gogf/gf.
  6. package consts
  7. const TemplateGenCtrlControllerEmpty = `
  8. package {Module}
  9. `
  10. const TemplateGenCtrlControllerNewEmpty = `
  11. // =================================================================================
  12. // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
  13. // =================================================================================
  14. package {Module}
  15. import (
  16. {ImportPath}
  17. )
  18. `
  19. const TemplateGenCtrlControllerNewFunc = `
  20. type {CtrlName} struct{}
  21. func {NewFuncName}() {InterfaceName} {
  22. return &{CtrlName}{}
  23. }
  24. `
  25. const TemplateGenCtrlControllerMethodFunc = `
  26. package {Module}
  27. import (
  28. "context"
  29. "github.com/gogf/gf/v2/errors/gcode"
  30. "github.com/gogf/gf/v2/errors/gerror"
  31. "{ImportPath}"
  32. )
  33. func (c *{CtrlName}) {MethodName}(ctx context.Context, req *{Version}.{MethodName}Req) (res *{Version}.{MethodName}Res, err error) {
  34. return nil, gerror.NewCode(gcode.CodeNotImplemented)
  35. }
  36. `
  37. const TemplateGenCtrlApiInterface = `
  38. // =================================================================================
  39. // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
  40. // =================================================================================
  41. package {Module}
  42. import (
  43. {ImportPaths}
  44. )
  45. {Interfaces}
  46. `