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.

279 lines
9.8 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/forex/forex.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 OperationForexForexAllPosition = "/matchmaking.v1.Forex/ForexAllPosition"
const OperationForexForexCancel = "/matchmaking.v1.Forex/ForexCancel"
const OperationForexForexPlaceOrder = "/matchmaking.v1.Forex/ForexPlaceOrder"
const OperationForexForexPosition = "/matchmaking.v1.Forex/ForexPosition"
const OperationForexForexUpdatePlaceOrder = "/matchmaking.v1.Forex/ForexUpdatePlaceOrder"
const OperationForexGetBotForexTrade = "/matchmaking.v1.Forex/GetBotForexTrade"
type ForexHTTPServer interface {
// ForexAllPosition ForexAllPosition 外汇一键平仓
ForexAllPosition(context.Context, *AllForexRequest) (*AllForexReply, error)
// ForexCancel ForexCancel 外汇撤单
ForexCancel(context.Context, *CancelForexRequest) (*ForexReply, error)
// ForexPlaceOrder ForexPlaceOrder 外汇下单
ForexPlaceOrder(context.Context, *ForexRequest) (*ForexReply, error)
// ForexPosition ForexPosition 外汇平仓
ForexPosition(context.Context, *CancelForexRequest) (*ForexReply, error)
// ForexUpdatePlaceOrder ForexUpdatePlaceOrder 外汇设置止盈止损
ForexUpdatePlaceOrder(context.Context, *UpdateForexRequest) (*ForexReply, error)
// GetBotForexTrade GetBotForexTrade 外汇列表查询
GetBotForexTrade(context.Context, *GetBotForexTradeRequest) (*GetBotForexTradeReply, error)
}
func RegisterForexHTTPServer(s *http.Server, srv ForexHTTPServer) {
r := s.Route("/")
r.POST("/order_forex/forex_list", _Forex_GetBotForexTrade0_HTTP_Handler(srv))
r.POST("/order_forex/forex_place_order", _Forex_ForexPlaceOrder0_HTTP_Handler(srv))
r.POST("/order_forex/forex_update_order", _Forex_ForexUpdatePlaceOrder0_HTTP_Handler(srv))
r.POST("/order_forex/forex_position", _Forex_ForexPosition0_HTTP_Handler(srv))
r.POST("/order_forex/forex_all_position", _Forex_ForexAllPosition0_HTTP_Handler(srv))
r.POST("/order_forex/forex_cancel", _Forex_ForexCancel0_HTTP_Handler(srv))
}
func _Forex_GetBotForexTrade0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetBotForexTradeRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationForexGetBotForexTrade)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetBotForexTrade(ctx, req.(*GetBotForexTradeRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*GetBotForexTradeReply)
return ctx.Result(200, reply)
}
}
func _Forex_ForexPlaceOrder0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in ForexRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationForexForexPlaceOrder)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ForexPlaceOrder(ctx, req.(*ForexRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*ForexReply)
return ctx.Result(200, reply)
}
}
func _Forex_ForexUpdatePlaceOrder0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in UpdateForexRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationForexForexUpdatePlaceOrder)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ForexUpdatePlaceOrder(ctx, req.(*UpdateForexRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*ForexReply)
return ctx.Result(200, reply)
}
}
func _Forex_ForexPosition0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in CancelForexRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationForexForexPosition)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ForexPosition(ctx, req.(*CancelForexRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*ForexReply)
return ctx.Result(200, reply)
}
}
func _Forex_ForexAllPosition0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in AllForexRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationForexForexAllPosition)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ForexAllPosition(ctx, req.(*AllForexRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*AllForexReply)
return ctx.Result(200, reply)
}
}
func _Forex_ForexCancel0_HTTP_Handler(srv ForexHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in CancelForexRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationForexForexCancel)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ForexCancel(ctx, req.(*CancelForexRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*ForexReply)
return ctx.Result(200, reply)
}
}
type ForexHTTPClient interface {
ForexAllPosition(ctx context.Context, req *AllForexRequest, opts ...http.CallOption) (rsp *AllForexReply, err error)
ForexCancel(ctx context.Context, req *CancelForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error)
ForexPlaceOrder(ctx context.Context, req *ForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error)
ForexPosition(ctx context.Context, req *CancelForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error)
ForexUpdatePlaceOrder(ctx context.Context, req *UpdateForexRequest, opts ...http.CallOption) (rsp *ForexReply, err error)
GetBotForexTrade(ctx context.Context, req *GetBotForexTradeRequest, opts ...http.CallOption) (rsp *GetBotForexTradeReply, err error)
}
type ForexHTTPClientImpl struct {
cc *http.Client
}
func NewForexHTTPClient(client *http.Client) ForexHTTPClient {
return &ForexHTTPClientImpl{client}
}
func (c *ForexHTTPClientImpl) ForexAllPosition(ctx context.Context, in *AllForexRequest, opts ...http.CallOption) (*AllForexReply, error) {
var out AllForexReply
pattern := "/order_forex/forex_all_position"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationForexForexAllPosition))
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 *ForexHTTPClientImpl) ForexCancel(ctx context.Context, in *CancelForexRequest, opts ...http.CallOption) (*ForexReply, error) {
var out ForexReply
pattern := "/order_forex/forex_cancel"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationForexForexCancel))
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 *ForexHTTPClientImpl) ForexPlaceOrder(ctx context.Context, in *ForexRequest, opts ...http.CallOption) (*ForexReply, error) {
var out ForexReply
pattern := "/order_forex/forex_place_order"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationForexForexPlaceOrder))
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 *ForexHTTPClientImpl) ForexPosition(ctx context.Context, in *CancelForexRequest, opts ...http.CallOption) (*ForexReply, error) {
var out ForexReply
pattern := "/order_forex/forex_position"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationForexForexPosition))
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 *ForexHTTPClientImpl) ForexUpdatePlaceOrder(ctx context.Context, in *UpdateForexRequest, opts ...http.CallOption) (*ForexReply, error) {
var out ForexReply
pattern := "/order_forex/forex_update_order"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationForexForexUpdatePlaceOrder))
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 *ForexHTTPClientImpl) GetBotForexTrade(ctx context.Context, in *GetBotForexTradeRequest, opts ...http.CallOption) (*GetBotForexTradeReply, error) {
var out GetBotForexTradeReply
pattern := "/order_forex/forex_list"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationForexGetBotForexTrade))
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
}