You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

handler.tpl 646 B

12345678910111213141516171819202122
  1. package {{.PkgName}}
  2. import (
  3. "github.com/zeromicro/go-zero/rest/httpx"
  4. "gitlink.org.cn/jcce-pcm/utils/result"
  5. "net/http"
  6. {{.ImportPackages}}
  7. )
  8. func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc {
  9. return func(w http.ResponseWriter, r *http.Request) {
  10. {{if .HasRequest}}var req types.{{.RequestType}}
  11. if err := httpx.Parse(r, &req); err != nil {
  12. result.ParamErrorResult(r,w,err)
  13. return
  14. }
  15. {{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx)
  16. {{if .HasResp}}resp, {{end}}err := l.{{.Call}}({{if .HasRequest}}&req{{end}})
  17. result.HttpResult(r, w, {{if .HasResp}}resp{{else}}nil{{end}}, err)
  18. }
  19. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.