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.
319 lines
11 KiB
319 lines
11 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/money/money.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 OperationMoneyGetBotMoneyTrade = "/matchmaking.v1.Money/GetBotMoneyTrade"
|
|
const OperationMoneyMoneyAllPosition = "/matchmaking.v1.Money/MoneyAllPosition"
|
|
const OperationMoneyMoneyCancel = "/matchmaking.v1.Money/MoneyCancel"
|
|
const OperationMoneyMoneyOneClickRedemption = "/matchmaking.v1.Money/MoneyOneClickRedemption"
|
|
const OperationMoneyMoneyPlaceOrder = "/matchmaking.v1.Money/MoneyPlaceOrder"
|
|
const OperationMoneyMoneyPosition = "/matchmaking.v1.Money/MoneyPosition"
|
|
const OperationMoneyMoneyUpdatePlaceOrder = "/matchmaking.v1.Money/MoneyUpdatePlaceOrder"
|
|
|
|
type MoneyHTTPServer interface {
|
|
// GetBotMoneyTrade GetBotMoneyTrade 综合列表查询
|
|
GetBotMoneyTrade(context.Context, *GetBotMoneyTradeRequest) (*GetBotMoneyTradeReply, error)
|
|
// MoneyAllPosition MoneyAllPosition 综合一键平仓
|
|
MoneyAllPosition(context.Context, *AllMoneyRequest) (*AllMoneyReply, error)
|
|
// MoneyCancel MoneyCancel 综合撤单
|
|
MoneyCancel(context.Context, *CancelMoneyRequest) (*MoneyReply, error)
|
|
// MoneyOneClickRedemption MoneyOneClickRedemption 现货一键兑换
|
|
MoneyOneClickRedemption(context.Context, *MoneyRequest) (*MoneyReply, error)
|
|
// MoneyPlaceOrder MoneyPlaceOrder 综合下单
|
|
MoneyPlaceOrder(context.Context, *MoneyRequest) (*MoneyReply, error)
|
|
// MoneyPosition MoneyPosition 综合平仓
|
|
MoneyPosition(context.Context, *CancelMoneyRequest) (*MoneyReply, error)
|
|
// MoneyUpdatePlaceOrder MoneyUpdatePlaceOrder 综合设置止盈止损
|
|
MoneyUpdatePlaceOrder(context.Context, *UpdateMoneyRequest) (*MoneyReply, error)
|
|
}
|
|
|
|
func RegisterMoneyHTTPServer(s *http.Server, srv MoneyHTTPServer) {
|
|
r := s.Route("/")
|
|
r.POST("/order_money/money_list", _Money_GetBotMoneyTrade0_HTTP_Handler(srv))
|
|
r.POST("/order_money/money_place_order", _Money_MoneyPlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_money/money_update_order", _Money_MoneyUpdatePlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_money/money_position", _Money_MoneyPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_money/money_all_position", _Money_MoneyAllPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_money/money_cancel", _Money_MoneyCancel0_HTTP_Handler(srv))
|
|
r.POST("/order_money/money_one_click_redemption", _Money_MoneyOneClickRedemption0_HTTP_Handler(srv))
|
|
}
|
|
|
|
func _Money_GetBotMoneyTrade0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in GetBotMoneyTradeRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationMoneyGetBotMoneyTrade)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.GetBotMoneyTrade(ctx, req.(*GetBotMoneyTradeRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*GetBotMoneyTradeReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Money_MoneyPlaceOrder0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in MoneyRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationMoneyMoneyPlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.MoneyPlaceOrder(ctx, req.(*MoneyRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*MoneyReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Money_MoneyUpdatePlaceOrder0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in UpdateMoneyRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationMoneyMoneyUpdatePlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.MoneyUpdatePlaceOrder(ctx, req.(*UpdateMoneyRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*MoneyReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Money_MoneyPosition0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelMoneyRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationMoneyMoneyPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.MoneyPosition(ctx, req.(*CancelMoneyRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*MoneyReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Money_MoneyAllPosition0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in AllMoneyRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationMoneyMoneyAllPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.MoneyAllPosition(ctx, req.(*AllMoneyRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*AllMoneyReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Money_MoneyCancel0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelMoneyRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationMoneyMoneyCancel)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.MoneyCancel(ctx, req.(*CancelMoneyRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*MoneyReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _Money_MoneyOneClickRedemption0_HTTP_Handler(srv MoneyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in MoneyRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationMoneyMoneyOneClickRedemption)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.MoneyOneClickRedemption(ctx, req.(*MoneyRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*MoneyReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
type MoneyHTTPClient interface {
|
|
GetBotMoneyTrade(ctx context.Context, req *GetBotMoneyTradeRequest, opts ...http.CallOption) (rsp *GetBotMoneyTradeReply, err error)
|
|
MoneyAllPosition(ctx context.Context, req *AllMoneyRequest, opts ...http.CallOption) (rsp *AllMoneyReply, err error)
|
|
MoneyCancel(ctx context.Context, req *CancelMoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error)
|
|
MoneyOneClickRedemption(ctx context.Context, req *MoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error)
|
|
MoneyPlaceOrder(ctx context.Context, req *MoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error)
|
|
MoneyPosition(ctx context.Context, req *CancelMoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error)
|
|
MoneyUpdatePlaceOrder(ctx context.Context, req *UpdateMoneyRequest, opts ...http.CallOption) (rsp *MoneyReply, err error)
|
|
}
|
|
|
|
type MoneyHTTPClientImpl struct {
|
|
cc *http.Client
|
|
}
|
|
|
|
func NewMoneyHTTPClient(client *http.Client) MoneyHTTPClient {
|
|
return &MoneyHTTPClientImpl{client}
|
|
}
|
|
|
|
func (c *MoneyHTTPClientImpl) GetBotMoneyTrade(ctx context.Context, in *GetBotMoneyTradeRequest, opts ...http.CallOption) (*GetBotMoneyTradeReply, error) {
|
|
var out GetBotMoneyTradeReply
|
|
pattern := "/order_money/money_list"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationMoneyGetBotMoneyTrade))
|
|
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 *MoneyHTTPClientImpl) MoneyAllPosition(ctx context.Context, in *AllMoneyRequest, opts ...http.CallOption) (*AllMoneyReply, error) {
|
|
var out AllMoneyReply
|
|
pattern := "/order_money/money_all_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationMoneyMoneyAllPosition))
|
|
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 *MoneyHTTPClientImpl) MoneyCancel(ctx context.Context, in *CancelMoneyRequest, opts ...http.CallOption) (*MoneyReply, error) {
|
|
var out MoneyReply
|
|
pattern := "/order_money/money_cancel"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationMoneyMoneyCancel))
|
|
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 *MoneyHTTPClientImpl) MoneyOneClickRedemption(ctx context.Context, in *MoneyRequest, opts ...http.CallOption) (*MoneyReply, error) {
|
|
var out MoneyReply
|
|
pattern := "/order_money/money_one_click_redemption"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationMoneyMoneyOneClickRedemption))
|
|
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 *MoneyHTTPClientImpl) MoneyPlaceOrder(ctx context.Context, in *MoneyRequest, opts ...http.CallOption) (*MoneyReply, error) {
|
|
var out MoneyReply
|
|
pattern := "/order_money/money_place_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationMoneyMoneyPlaceOrder))
|
|
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 *MoneyHTTPClientImpl) MoneyPosition(ctx context.Context, in *CancelMoneyRequest, opts ...http.CallOption) (*MoneyReply, error) {
|
|
var out MoneyReply
|
|
pattern := "/order_money/money_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationMoneyMoneyPosition))
|
|
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 *MoneyHTTPClientImpl) MoneyUpdatePlaceOrder(ctx context.Context, in *UpdateMoneyRequest, opts ...http.CallOption) (*MoneyReply, error) {
|
|
var out MoneyReply
|
|
pattern := "/order_money/money_update_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationMoneyMoneyUpdatePlaceOrder))
|
|
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
|
|
}
|
|
|