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
10 KiB
279 lines
10 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/share/shareBrl.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 OperationShareBrlGetBotStockBrlTrade = "/matchmaking.v1.ShareBrl/GetBotStockBrlTrade"
|
|
const OperationShareBrlShareBrlAllPosition = "/matchmaking.v1.ShareBrl/ShareBrlAllPosition"
|
|
const OperationShareBrlShareBrlCancel = "/matchmaking.v1.ShareBrl/ShareBrlCancel"
|
|
const OperationShareBrlShareBrlPlaceOrder = "/matchmaking.v1.ShareBrl/ShareBrlPlaceOrder"
|
|
const OperationShareBrlShareBrlPosition = "/matchmaking.v1.ShareBrl/ShareBrlPosition"
|
|
const OperationShareBrlShareBrlUpdateOrder = "/matchmaking.v1.ShareBrl/ShareBrlUpdateOrder"
|
|
|
|
type ShareBrlHTTPServer interface {
|
|
// GetBotStockBrlTrade GetBotStockBrlTrade 巴西国股列表查询
|
|
GetBotStockBrlTrade(context.Context, *GetBrlBotStockTradeRequest) (*GetBotStockBrlTradeReply, error)
|
|
// ShareBrlAllPosition ShareBrlAllPosition 巴西国股一键平仓
|
|
ShareBrlAllPosition(context.Context, *AllBrlOrderRequest) (*AllBrlOrderReply, error)
|
|
// ShareBrlCancel ShareBrlCancel 巴西国股撤单
|
|
ShareBrlCancel(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error)
|
|
// ShareBrlPlaceOrder ShareBrlPlaceOrder 巴西国股下单
|
|
ShareBrlPlaceOrder(context.Context, *ShareBrlOrderRequest) (*BrlOrderReply, error)
|
|
// ShareBrlPosition ShareBrlPosition 巴西国股平仓
|
|
ShareBrlPosition(context.Context, *CancelBrlOrderRequest) (*BrlOrderReply, error)
|
|
// ShareBrlUpdateOrder ShareBrlUpdateOrder 巴西国股设置止盈止损
|
|
ShareBrlUpdateOrder(context.Context, *UpdateBrlOrderRequest) (*BrlOrderReply, error)
|
|
}
|
|
|
|
func RegisterShareBrlHTTPServer(s *http.Server, srv ShareBrlHTTPServer) {
|
|
r := s.Route("/")
|
|
r.POST("/order_sharebrl/share_list", _ShareBrl_GetBotStockBrlTrade0_HTTP_Handler(srv))
|
|
r.POST("/order_sharebrl/share_place_order", _ShareBrl_ShareBrlPlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharebrl/share_update_order", _ShareBrl_ShareBrlUpdateOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharebrl/share_position", _ShareBrl_ShareBrlPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharebrl/share_all_position", _ShareBrl_ShareBrlAllPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharebrl/share_cancel", _ShareBrl_ShareBrlCancel0_HTTP_Handler(srv))
|
|
}
|
|
|
|
func _ShareBrl_GetBotStockBrlTrade0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in GetBrlBotStockTradeRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareBrlGetBotStockBrlTrade)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.GetBotStockBrlTrade(ctx, req.(*GetBrlBotStockTradeRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*GetBotStockBrlTradeReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareBrl_ShareBrlPlaceOrder0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in ShareBrlOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareBrlShareBrlPlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareBrlPlaceOrder(ctx, req.(*ShareBrlOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*BrlOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareBrl_ShareBrlUpdateOrder0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in UpdateBrlOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareBrlShareBrlUpdateOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareBrlUpdateOrder(ctx, req.(*UpdateBrlOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*BrlOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareBrl_ShareBrlPosition0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelBrlOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareBrlShareBrlPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareBrlPosition(ctx, req.(*CancelBrlOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*BrlOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareBrl_ShareBrlAllPosition0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in AllBrlOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareBrlShareBrlAllPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareBrlAllPosition(ctx, req.(*AllBrlOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*AllBrlOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareBrl_ShareBrlCancel0_HTTP_Handler(srv ShareBrlHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelBrlOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareBrlShareBrlCancel)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareBrlCancel(ctx, req.(*CancelBrlOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*BrlOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
type ShareBrlHTTPClient interface {
|
|
GetBotStockBrlTrade(ctx context.Context, req *GetBrlBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockBrlTradeReply, err error)
|
|
ShareBrlAllPosition(ctx context.Context, req *AllBrlOrderRequest, opts ...http.CallOption) (rsp *AllBrlOrderReply, err error)
|
|
ShareBrlCancel(ctx context.Context, req *CancelBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error)
|
|
ShareBrlPlaceOrder(ctx context.Context, req *ShareBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error)
|
|
ShareBrlPosition(ctx context.Context, req *CancelBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error)
|
|
ShareBrlUpdateOrder(ctx context.Context, req *UpdateBrlOrderRequest, opts ...http.CallOption) (rsp *BrlOrderReply, err error)
|
|
}
|
|
|
|
type ShareBrlHTTPClientImpl struct {
|
|
cc *http.Client
|
|
}
|
|
|
|
func NewShareBrlHTTPClient(client *http.Client) ShareBrlHTTPClient {
|
|
return &ShareBrlHTTPClientImpl{client}
|
|
}
|
|
|
|
func (c *ShareBrlHTTPClientImpl) GetBotStockBrlTrade(ctx context.Context, in *GetBrlBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockBrlTradeReply, error) {
|
|
var out GetBotStockBrlTradeReply
|
|
pattern := "/order_sharebrl/share_list"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareBrlGetBotStockBrlTrade))
|
|
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 *ShareBrlHTTPClientImpl) ShareBrlAllPosition(ctx context.Context, in *AllBrlOrderRequest, opts ...http.CallOption) (*AllBrlOrderReply, error) {
|
|
var out AllBrlOrderReply
|
|
pattern := "/order_sharebrl/share_all_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareBrlShareBrlAllPosition))
|
|
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 *ShareBrlHTTPClientImpl) ShareBrlCancel(ctx context.Context, in *CancelBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) {
|
|
var out BrlOrderReply
|
|
pattern := "/order_sharebrl/share_cancel"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareBrlShareBrlCancel))
|
|
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 *ShareBrlHTTPClientImpl) ShareBrlPlaceOrder(ctx context.Context, in *ShareBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) {
|
|
var out BrlOrderReply
|
|
pattern := "/order_sharebrl/share_place_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareBrlShareBrlPlaceOrder))
|
|
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 *ShareBrlHTTPClientImpl) ShareBrlPosition(ctx context.Context, in *CancelBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) {
|
|
var out BrlOrderReply
|
|
pattern := "/order_sharebrl/share_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareBrlShareBrlPosition))
|
|
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 *ShareBrlHTTPClientImpl) ShareBrlUpdateOrder(ctx context.Context, in *UpdateBrlOrderRequest, opts ...http.CallOption) (*BrlOrderReply, error) {
|
|
var out BrlOrderReply
|
|
pattern := "/order_sharebrl/share_update_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareBrlShareBrlUpdateOrder))
|
|
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
|
|
}
|
|
|