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/shareGbx.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 OperationShareGbxGetBotStockGbxTrade = "/matchmaking.v1.ShareGbx/GetBotStockGbxTrade"
|
|
const OperationShareGbxShareGbxAllPosition = "/matchmaking.v1.ShareGbx/ShareGbxAllPosition"
|
|
const OperationShareGbxShareGbxCancel = "/matchmaking.v1.ShareGbx/ShareGbxCancel"
|
|
const OperationShareGbxShareGbxPlaceOrder = "/matchmaking.v1.ShareGbx/ShareGbxPlaceOrder"
|
|
const OperationShareGbxShareGbxPosition = "/matchmaking.v1.ShareGbx/ShareGbxPosition"
|
|
const OperationShareGbxShareGbxUpdateOrder = "/matchmaking.v1.ShareGbx/ShareGbxUpdateOrder"
|
|
|
|
type ShareGbxHTTPServer interface {
|
|
// GetBotStockGbxTrade GetBotStockGbxTrade 英股列表查询
|
|
GetBotStockGbxTrade(context.Context, *GetBotStockGbxTradeRequest) (*GetBotStockGbxTradeReply, error)
|
|
// ShareGbxAllPosition ShareGbxAllPosition 英股一键平仓
|
|
ShareGbxAllPosition(context.Context, *AllGbxOrderRequest) (*AllGbxOrderReply, error)
|
|
// ShareGbxCancel ShareGbxCancel 英股撤单
|
|
ShareGbxCancel(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error)
|
|
// ShareGbxPlaceOrder ShareGbxPlaceOrder 英股下单
|
|
ShareGbxPlaceOrder(context.Context, *OrderGbxRequest) (*OrderGbxReply, error)
|
|
// ShareGbxPosition ShareGbxPosition 英股平仓
|
|
ShareGbxPosition(context.Context, *CancelGbxOrderRequest) (*OrderGbxReply, error)
|
|
// ShareGbxUpdateOrder ShareGbxUpdateOrder 英股设置止盈止损
|
|
ShareGbxUpdateOrder(context.Context, *UpdateGbxOrderRequest) (*OrderGbxReply, error)
|
|
}
|
|
|
|
func RegisterShareGbxHTTPServer(s *http.Server, srv ShareGbxHTTPServer) {
|
|
r := s.Route("/")
|
|
r.POST("/order_sharegbx/share_list", _ShareGbx_GetBotStockGbxTrade0_HTTP_Handler(srv))
|
|
r.POST("/order_sharegbx/share_place_order", _ShareGbx_ShareGbxPlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharegbx/share_update_order", _ShareGbx_ShareGbxUpdateOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharegbx/share_position", _ShareGbx_ShareGbxPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharegbx/share_all_position", _ShareGbx_ShareGbxAllPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharegbx/share_cancel", _ShareGbx_ShareGbxCancel0_HTTP_Handler(srv))
|
|
}
|
|
|
|
func _ShareGbx_GetBotStockGbxTrade0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in GetBotStockGbxTradeRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareGbxGetBotStockGbxTrade)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.GetBotStockGbxTrade(ctx, req.(*GetBotStockGbxTradeRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*GetBotStockGbxTradeReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareGbx_ShareGbxPlaceOrder0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in OrderGbxRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareGbxShareGbxPlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareGbxPlaceOrder(ctx, req.(*OrderGbxRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*OrderGbxReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareGbx_ShareGbxUpdateOrder0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in UpdateGbxOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareGbxShareGbxUpdateOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareGbxUpdateOrder(ctx, req.(*UpdateGbxOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*OrderGbxReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareGbx_ShareGbxPosition0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelGbxOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareGbxShareGbxPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareGbxPosition(ctx, req.(*CancelGbxOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*OrderGbxReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareGbx_ShareGbxAllPosition0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in AllGbxOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareGbxShareGbxAllPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareGbxAllPosition(ctx, req.(*AllGbxOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*AllGbxOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareGbx_ShareGbxCancel0_HTTP_Handler(srv ShareGbxHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelGbxOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareGbxShareGbxCancel)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareGbxCancel(ctx, req.(*CancelGbxOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*OrderGbxReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
type ShareGbxHTTPClient interface {
|
|
GetBotStockGbxTrade(ctx context.Context, req *GetBotStockGbxTradeRequest, opts ...http.CallOption) (rsp *GetBotStockGbxTradeReply, err error)
|
|
ShareGbxAllPosition(ctx context.Context, req *AllGbxOrderRequest, opts ...http.CallOption) (rsp *AllGbxOrderReply, err error)
|
|
ShareGbxCancel(ctx context.Context, req *CancelGbxOrderRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error)
|
|
ShareGbxPlaceOrder(ctx context.Context, req *OrderGbxRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error)
|
|
ShareGbxPosition(ctx context.Context, req *CancelGbxOrderRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error)
|
|
ShareGbxUpdateOrder(ctx context.Context, req *UpdateGbxOrderRequest, opts ...http.CallOption) (rsp *OrderGbxReply, err error)
|
|
}
|
|
|
|
type ShareGbxHTTPClientImpl struct {
|
|
cc *http.Client
|
|
}
|
|
|
|
func NewShareGbxHTTPClient(client *http.Client) ShareGbxHTTPClient {
|
|
return &ShareGbxHTTPClientImpl{client}
|
|
}
|
|
|
|
func (c *ShareGbxHTTPClientImpl) GetBotStockGbxTrade(ctx context.Context, in *GetBotStockGbxTradeRequest, opts ...http.CallOption) (*GetBotStockGbxTradeReply, error) {
|
|
var out GetBotStockGbxTradeReply
|
|
pattern := "/order_sharegbx/share_list"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareGbxGetBotStockGbxTrade))
|
|
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 *ShareGbxHTTPClientImpl) ShareGbxAllPosition(ctx context.Context, in *AllGbxOrderRequest, opts ...http.CallOption) (*AllGbxOrderReply, error) {
|
|
var out AllGbxOrderReply
|
|
pattern := "/order_sharegbx/share_all_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareGbxShareGbxAllPosition))
|
|
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 *ShareGbxHTTPClientImpl) ShareGbxCancel(ctx context.Context, in *CancelGbxOrderRequest, opts ...http.CallOption) (*OrderGbxReply, error) {
|
|
var out OrderGbxReply
|
|
pattern := "/order_sharegbx/share_cancel"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareGbxShareGbxCancel))
|
|
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 *ShareGbxHTTPClientImpl) ShareGbxPlaceOrder(ctx context.Context, in *OrderGbxRequest, opts ...http.CallOption) (*OrderGbxReply, error) {
|
|
var out OrderGbxReply
|
|
pattern := "/order_sharegbx/share_place_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareGbxShareGbxPlaceOrder))
|
|
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 *ShareGbxHTTPClientImpl) ShareGbxPosition(ctx context.Context, in *CancelGbxOrderRequest, opts ...http.CallOption) (*OrderGbxReply, error) {
|
|
var out OrderGbxReply
|
|
pattern := "/order_sharegbx/share_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareGbxShareGbxPosition))
|
|
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 *ShareGbxHTTPClientImpl) ShareGbxUpdateOrder(ctx context.Context, in *UpdateGbxOrderRequest, opts ...http.CallOption) (*OrderGbxReply, error) {
|
|
var out OrderGbxReply
|
|
pattern := "/order_sharegbx/share_update_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareGbxShareGbxUpdateOrder))
|
|
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
|
|
}
|
|
|