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/shareUs.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 OperationShareUsGetBotStockTrade = "/matchmaking.v1.ShareUs/GetBotStockTrade"
|
|
const OperationShareUsShareAllPosition = "/matchmaking.v1.ShareUs/ShareAllPosition"
|
|
const OperationShareUsShareCancel = "/matchmaking.v1.ShareUs/ShareCancel"
|
|
const OperationShareUsSharePlaceOrder = "/matchmaking.v1.ShareUs/SharePlaceOrder"
|
|
const OperationShareUsSharePosition = "/matchmaking.v1.ShareUs/SharePosition"
|
|
const OperationShareUsShareUpdateOrder = "/matchmaking.v1.ShareUs/ShareUpdateOrder"
|
|
|
|
type ShareUsHTTPServer interface {
|
|
// GetBotStockTrade GetBotStockTrade 美股列表查询
|
|
GetBotStockTrade(context.Context, *GetUsBotStockTradeRequest) (*GetUsBotStockTradeReply, error)
|
|
// ShareAllPosition ShareCancel 美股一键平仓
|
|
ShareAllPosition(context.Context, *AllUsOrderRequest) (*AllUsOrderReply, error)
|
|
// ShareCancel ShareCancel 美股撤单
|
|
ShareCancel(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error)
|
|
// SharePlaceOrder SharePlaceOrder 美股下单
|
|
SharePlaceOrder(context.Context, *UsOrderRequest) (*UsOrderReply, error)
|
|
// SharePosition SharePosition 美股平仓
|
|
SharePosition(context.Context, *CancelUsOrderRequest) (*UsOrderReply, error)
|
|
// ShareUpdateOrder ShareUpdateOrder 美股设置止盈止损
|
|
ShareUpdateOrder(context.Context, *UpdateUsOrderRequest) (*UsOrderReply, error)
|
|
}
|
|
|
|
func RegisterShareUsHTTPServer(s *http.Server, srv ShareUsHTTPServer) {
|
|
r := s.Route("/")
|
|
r.POST("/order_shareus/share_list", _ShareUs_GetBotStockTrade0_HTTP_Handler(srv))
|
|
r.POST("/order_shareus/share_place_order", _ShareUs_SharePlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_shareus/share_update_order", _ShareUs_ShareUpdateOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_shareus/share_position", _ShareUs_SharePosition0_HTTP_Handler(srv))
|
|
r.POST("/order_shareus/share_all_position", _ShareUs_ShareAllPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_shareus/share_cancel", _ShareUs_ShareCancel0_HTTP_Handler(srv))
|
|
}
|
|
|
|
func _ShareUs_GetBotStockTrade0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in GetUsBotStockTradeRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareUsGetBotStockTrade)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.GetBotStockTrade(ctx, req.(*GetUsBotStockTradeRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*GetUsBotStockTradeReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareUs_SharePlaceOrder0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in UsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareUsSharePlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.SharePlaceOrder(ctx, req.(*UsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*UsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareUs_ShareUpdateOrder0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in UpdateUsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareUsShareUpdateOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareUpdateOrder(ctx, req.(*UpdateUsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*UsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareUs_SharePosition0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelUsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareUsSharePosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.SharePosition(ctx, req.(*CancelUsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*UsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareUs_ShareAllPosition0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in AllUsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareUsShareAllPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareAllPosition(ctx, req.(*AllUsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*AllUsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareUs_ShareCancel0_HTTP_Handler(srv ShareUsHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelUsOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareUsShareCancel)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareCancel(ctx, req.(*CancelUsOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*UsOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
type ShareUsHTTPClient interface {
|
|
GetBotStockTrade(ctx context.Context, req *GetUsBotStockTradeRequest, opts ...http.CallOption) (rsp *GetUsBotStockTradeReply, err error)
|
|
ShareAllPosition(ctx context.Context, req *AllUsOrderRequest, opts ...http.CallOption) (rsp *AllUsOrderReply, err error)
|
|
ShareCancel(ctx context.Context, req *CancelUsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error)
|
|
SharePlaceOrder(ctx context.Context, req *UsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error)
|
|
SharePosition(ctx context.Context, req *CancelUsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error)
|
|
ShareUpdateOrder(ctx context.Context, req *UpdateUsOrderRequest, opts ...http.CallOption) (rsp *UsOrderReply, err error)
|
|
}
|
|
|
|
type ShareUsHTTPClientImpl struct {
|
|
cc *http.Client
|
|
}
|
|
|
|
func NewShareUsHTTPClient(client *http.Client) ShareUsHTTPClient {
|
|
return &ShareUsHTTPClientImpl{client}
|
|
}
|
|
|
|
func (c *ShareUsHTTPClientImpl) GetBotStockTrade(ctx context.Context, in *GetUsBotStockTradeRequest, opts ...http.CallOption) (*GetUsBotStockTradeReply, error) {
|
|
var out GetUsBotStockTradeReply
|
|
pattern := "/order_shareus/share_list"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareUsGetBotStockTrade))
|
|
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 *ShareUsHTTPClientImpl) ShareAllPosition(ctx context.Context, in *AllUsOrderRequest, opts ...http.CallOption) (*AllUsOrderReply, error) {
|
|
var out AllUsOrderReply
|
|
pattern := "/order_shareus/share_all_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareUsShareAllPosition))
|
|
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 *ShareUsHTTPClientImpl) ShareCancel(ctx context.Context, in *CancelUsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) {
|
|
var out UsOrderReply
|
|
pattern := "/order_shareus/share_cancel"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareUsShareCancel))
|
|
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 *ShareUsHTTPClientImpl) SharePlaceOrder(ctx context.Context, in *UsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) {
|
|
var out UsOrderReply
|
|
pattern := "/order_shareus/share_place_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareUsSharePlaceOrder))
|
|
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 *ShareUsHTTPClientImpl) SharePosition(ctx context.Context, in *CancelUsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) {
|
|
var out UsOrderReply
|
|
pattern := "/order_shareus/share_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareUsSharePosition))
|
|
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 *ShareUsHTTPClientImpl) ShareUpdateOrder(ctx context.Context, in *UpdateUsOrderRequest, opts ...http.CallOption) (*UsOrderReply, error) {
|
|
var out UsOrderReply
|
|
pattern := "/order_shareus/share_update_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareUsShareUpdateOrder))
|
|
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
|
|
}
|
|
|