You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
199 lines
7.1 KiB
199 lines
7.1 KiB
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-http v2.7.3
|
|
// - protoc v5.27.1
|
|
// source: matchmaking/v1/virtually/spots.proto
|
|
|
|
package v1
|
|
|
|
import (
|
|
context "context"
|
|
http "github.com/go-kratos/kratos/v2/transport/http"
|
|
binding "github.com/go-kratos/kratos/v2/transport/http/binding"
|
|
)
|
|
|
|
// 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
|
|
|
|
const _ = http.SupportPackageIsVersion1
|
|
|
|
const OperationSpotsGetBotDigitalTrade = "/matchmaking.v1.Spots/GetBotDigitalTrade"
|
|
const OperationSpotsSpotsCancel = "/matchmaking.v1.Spots/SpotsCancel"
|
|
const OperationSpotsSpotsOneClickRedemption = "/matchmaking.v1.Spots/SpotsOneClickRedemption"
|
|
const OperationSpotsSpotsPlaceOrder = "/matchmaking.v1.Spots/SpotsPlaceOrder"
|
|
|
|
type SpotsHTTPServer interface {
|
|
// GetBotDigitalTrade GetBotDigitalTrade 现货列表查询
|
|
GetBotDigitalTrade(context.Context, *GetBotDigitalTradeRequest) (*GetBotDigitalTradeReply, error)
|
|
// SpotsCancel SpotsCancel 现货撤单
|
|
SpotsCancel(context.Context, *CancelSpotsOrderRequest) (*SpotsOrderReply, error)
|
|
// SpotsOneClickRedemption SpotsOneClickRedemption 现货一键兑换
|
|
SpotsOneClickRedemption(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error)
|
|
// SpotsPlaceOrder SpotsPlaceOrder 现货下单
|
|
SpotsPlaceOrder(context.Context, *SpotsOrderRequest) (*SpotsOrderReply, error)
|
|
}
|
|
|
|
func RegisterSpotsHTTPServer(s *http.Server, srv SpotsHTTPServer) {
|
|
r := s.Route("/")
|
|
r.POST("/order_spots/spots_list", _Spots_GetBotDigitalTrade0_HTTP_Handler(srv))
|
|
r.POST("/order_spots/spots_place_order", _Spots_SpotsPlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_spots/spots_cancel", _Spots_SpotsCancel0_HTTP_Handler(srv))
|
|
r.POST("/order_spots/spots_one_click_redemption", _Spots_SpotsOneClickRedemption0_HTTP_Handler(srv))
|
|
}
|
|
|
|
func _Spots_GetBotDigitalTrade0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in GetBotDigitalTradeRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationSpotsGetBotDigitalTrade)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.GetBotDigitalTrade(ctx, req.(*GetBotDigitalTradeRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*GetBotDigitalTradeReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Spots_SpotsPlaceOrder0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in SpotsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationSpotsSpotsPlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.SpotsPlaceOrder(ctx, req.(*SpotsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*SpotsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Spots_SpotsCancel0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelSpotsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationSpotsSpotsCancel)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.SpotsCancel(ctx, req.(*CancelSpotsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*SpotsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Spots_SpotsOneClickRedemption0_HTTP_Handler(srv SpotsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in SpotsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationSpotsSpotsOneClickRedemption)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.SpotsOneClickRedemption(ctx, req.(*SpotsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*SpotsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
type SpotsHTTPClient interface {
|
|
GetBotDigitalTrade(ctx context.Context, req *GetBotDigitalTradeRequest, opts ...http.CallOption) (rsp *GetBotDigitalTradeReply, err error)
|
|
SpotsCancel(ctx context.Context, req *CancelSpotsOrderRequest, opts ...http.CallOption) (rsp *SpotsOrderReply, err error)
|
|
SpotsOneClickRedemption(ctx context.Context, req *SpotsOrderRequest, opts ...http.CallOption) (rsp *SpotsOrderReply, err error)
|
|
SpotsPlaceOrder(ctx context.Context, req *SpotsOrderRequest, opts ...http.CallOption) (rsp *SpotsOrderReply, err error)
|
|
}
|
|
|
|
type SpotsHTTPClientImpl struct {
|
|
cc *http.Client
|
|
}
|
|
|
|
func NewSpotsHTTPClient(client *http.Client) SpotsHTTPClient {
|
|
return &SpotsHTTPClientImpl{client}
|
|
}
|
|
|
|
func (c *SpotsHTTPClientImpl) GetBotDigitalTrade(ctx context.Context, in *GetBotDigitalTradeRequest, opts ...http.CallOption) (*GetBotDigitalTradeReply, error) {
|
|
var out GetBotDigitalTradeReply
|
|
pattern := "/order_spots/spots_list"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationSpotsGetBotDigitalTrade))
|
|
opts = append(opts, http.PathTemplate(pattern))
|
|
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &out, nil
|
|
}
|
|
|
|
func (c *SpotsHTTPClientImpl) SpotsCancel(ctx context.Context, in *CancelSpotsOrderRequest, opts ...http.CallOption) (*SpotsOrderReply, error) {
|
|
var out SpotsOrderReply
|
|
pattern := "/order_spots/spots_cancel"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationSpotsSpotsCancel))
|
|
opts = append(opts, http.PathTemplate(pattern))
|
|
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &out, nil
|
|
}
|
|
|
|
func (c *SpotsHTTPClientImpl) SpotsOneClickRedemption(ctx context.Context, in *SpotsOrderRequest, opts ...http.CallOption) (*SpotsOrderReply, error) {
|
|
var out SpotsOrderReply
|
|
pattern := "/order_spots/spots_one_click_redemption"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationSpotsSpotsOneClickRedemption))
|
|
opts = append(opts, http.PathTemplate(pattern))
|
|
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &out, nil
|
|
}
|
|
|
|
func (c *SpotsHTTPClientImpl) SpotsPlaceOrder(ctx context.Context, in *SpotsOrderRequest, opts ...http.CallOption) (*SpotsOrderReply, error) {
|
|
var out SpotsOrderReply
|
|
pattern := "/order_spots/spots_place_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationSpotsSpotsPlaceOrder))
|
|
opts = append(opts, http.PathTemplate(pattern))
|
|
err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &out, nil
|
|
}
|
|
|