| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- // Code generated by protoc-gen-go-http. DO NOT EDIT.
- // versions:
- // protoc-gen-go-http v2.0.0
- package wx
- import (
- context "context"
- base "git.ikuban.com/server/base-protobuf/kuban/api/base"
- reply "git.ikuban.com/server/kratos-utils/http/reply"
- common "git.ikuban.com/server/pw-protobuf/api/common"
- http "github.com/go-kratos/kratos/v2/transport/http"
- binding "github.com/go-kratos/kratos/v2/transport/http/binding"
- ioutil "io/ioutil"
- time "time"
- )
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the kratos package it is being compiled against.
- var _ = new(context.Context)
- var _ = binding.EncodeURL
- var _ = ioutil.Discard
- var _ = new(time.Time)
- var _ = new(reply.SuccessReply)
- var _ = new(base.Html)
- const _ = http.SupportPackageIsVersion1
- type WxHTTPServer interface {
- WxConf(context.Context, *common.WxConfReq) (*common.WxConfResponse, error)
- }
- func RegisterWxHTTPServer(s *http.Server, srv WxHTTPServer) {
- r := s.Route("/")
- r.POST("/api/wx/jssdk/config", _Wx_WxConf0_HTTP_Handler(srv))
- }
- func _Wx_WxConf0_HTTP_Handler(srv WxHTTPServer) func(ctx http.Context) error {
- return func(ctx http.Context) error {
- var in common.WxConfReq
- if err := ctx.Bind(&in); err != nil {
- return err
- }
- if err := ctx.BindQuery(&in); err != nil {
- return err
- }
- http.SetOperation(ctx, "/api.wx.Wx/WxConf")
- h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.WxConf(ctx, req.(*common.WxConfReq))
- })
- out, err := h(ctx, &in)
- if err != nil {
- return err
- }
- success := &reply.SuccessReply{
- Code: 0,
- }
- if out != nil {
- success.Data = out
- }
- return ctx.Result(200, success)
- }
- }
- type WxHTTPClient interface {
- WxConf(ctx context.Context, req *common.WxConfReq, opts ...http.CallOption) (rsp *common.WxConfResponse, err error)
- }
- type WxHTTPClientImpl struct {
- cc *http.Client
- }
- func NewWxHTTPClient(client *http.Client) WxHTTPClient {
- return &WxHTTPClientImpl{client}
- }
- func (c *WxHTTPClientImpl) WxConf(ctx context.Context, in *common.WxConfReq, opts ...http.CallOption) (*common.WxConfResponse, error) {
- var out common.WxConfResponse
- pattern := "/api/wx/jssdk/config"
- path := binding.EncodeURL(pattern, in, false)
- opts = append(opts, http.Operation("/api.wx.Wx/WxConf"))
- opts = append(opts, http.PathTemplate(pattern))
- err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
- if err != nil {
- return nil, err
- }
- return &out, err
- }
|