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

// 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/shareSgd.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 OperationShareSgdGetBotStockSgdTrade = "/matchmaking.v1.ShareSgd/GetBotStockSgdTrade"
const OperationShareSgdShareSgdAllPosition = "/matchmaking.v1.ShareSgd/ShareSgdAllPosition"
const OperationShareSgdShareSgdCancel = "/matchmaking.v1.ShareSgd/ShareSgdCancel"
const OperationShareSgdShareSgdPlaceOrder = "/matchmaking.v1.ShareSgd/ShareSgdPlaceOrder"
const OperationShareSgdShareSgdPosition = "/matchmaking.v1.ShareSgd/ShareSgdPosition"
const OperationShareSgdShareSgdUpdateOrder = "/matchmaking.v1.ShareSgd/ShareSgdUpdateOrder"
type ShareSgdHTTPServer interface {
// GetBotStockSgdTrade GetBotStockSgdTrade 新加坡股列表查询
GetBotStockSgdTrade(context.Context, *GetSgdBotStockTradeRequest) (*GetBotStockSgdTradeReply, error)
// ShareSgdAllPosition ShareSgdAllPosition 新加坡股一键平仓
ShareSgdAllPosition(context.Context, *AllSgdOrderRequest) (*AllSgdOrderReply, error)
// ShareSgdCancel ShareSgdCancel 新加坡股撤单
ShareSgdCancel(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error)
// ShareSgdPlaceOrder ShareSgdPlaceOrder 新加坡股下单
ShareSgdPlaceOrder(context.Context, *ShareSgdOrderRequest) (*SgdOrderReply, error)
// ShareSgdPosition ShareSgdPosition 新加坡股平仓
ShareSgdPosition(context.Context, *CancelSgdOrderRequest) (*SgdOrderReply, error)
// ShareSgdUpdateOrder ShareSgdUpdateOrder 新加坡股设置止盈止损
ShareSgdUpdateOrder(context.Context, *UpdateSgdOrderRequest) (*SgdOrderReply, error)
}
func RegisterShareSgdHTTPServer(s *http.Server, srv ShareSgdHTTPServer) {
r := s.Route("/")
r.POST("/order_sharesgd/share_list", _ShareSgd_GetBotStockSgdTrade0_HTTP_Handler(srv))
r.POST("/order_sharesgd/share_place_order", _ShareSgd_ShareSgdPlaceOrder0_HTTP_Handler(srv))
r.POST("/order_sharesgd/share_update_order", _ShareSgd_ShareSgdUpdateOrder0_HTTP_Handler(srv))
r.POST("/order_sharesgd/share_position", _ShareSgd_ShareSgdPosition0_HTTP_Handler(srv))
r.POST("/order_sharesgd/share_all_position", _ShareSgd_ShareSgdAllPosition0_HTTP_Handler(srv))
r.POST("/order_sharesgd/share_cancel", _ShareSgd_ShareSgdCancel0_HTTP_Handler(srv))
}
func _ShareSgd_GetBotStockSgdTrade0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetSgdBotStockTradeRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationShareSgdGetBotStockSgdTrade)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetBotStockSgdTrade(ctx, req.(*GetSgdBotStockTradeRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*GetBotStockSgdTradeReply)
return ctx.Result(200, reply)
}
}
func _ShareSgd_ShareSgdPlaceOrder0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in ShareSgdOrderRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationShareSgdShareSgdPlaceOrder)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ShareSgdPlaceOrder(ctx, req.(*ShareSgdOrderRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SgdOrderReply)
return ctx.Result(200, reply)
}
}
func _ShareSgd_ShareSgdUpdateOrder0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in UpdateSgdOrderRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationShareSgdShareSgdUpdateOrder)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ShareSgdUpdateOrder(ctx, req.(*UpdateSgdOrderRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SgdOrderReply)
return ctx.Result(200, reply)
}
}
func _ShareSgd_ShareSgdPosition0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in CancelSgdOrderRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationShareSgdShareSgdPosition)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ShareSgdPosition(ctx, req.(*CancelSgdOrderRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SgdOrderReply)
return ctx.Result(200, reply)
}
}
func _ShareSgd_ShareSgdAllPosition0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in AllSgdOrderRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationShareSgdShareSgdAllPosition)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ShareSgdAllPosition(ctx, req.(*AllSgdOrderRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*AllSgdOrderReply)
return ctx.Result(200, reply)
}
}
func _ShareSgd_ShareSgdCancel0_HTTP_Handler(srv ShareSgdHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in CancelSgdOrderRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationShareSgdShareSgdCancel)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ShareSgdCancel(ctx, req.(*CancelSgdOrderRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SgdOrderReply)
return ctx.Result(200, reply)
}
}
type ShareSgdHTTPClient interface {
GetBotStockSgdTrade(ctx context.Context, req *GetSgdBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockSgdTradeReply, err error)
ShareSgdAllPosition(ctx context.Context, req *AllSgdOrderRequest, opts ...http.CallOption) (rsp *AllSgdOrderReply, err error)
ShareSgdCancel(ctx context.Context, req *CancelSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error)
ShareSgdPlaceOrder(ctx context.Context, req *ShareSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error)
ShareSgdPosition(ctx context.Context, req *CancelSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error)
ShareSgdUpdateOrder(ctx context.Context, req *UpdateSgdOrderRequest, opts ...http.CallOption) (rsp *SgdOrderReply, err error)
}
type ShareSgdHTTPClientImpl struct {
cc *http.Client
}
func NewShareSgdHTTPClient(client *http.Client) ShareSgdHTTPClient {
return &ShareSgdHTTPClientImpl{client}
}
func (c *ShareSgdHTTPClientImpl) GetBotStockSgdTrade(ctx context.Context, in *GetSgdBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockSgdTradeReply, error) {
var out GetBotStockSgdTradeReply
pattern := "/order_sharesgd/share_list"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationShareSgdGetBotStockSgdTrade))
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 *ShareSgdHTTPClientImpl) ShareSgdAllPosition(ctx context.Context, in *AllSgdOrderRequest, opts ...http.CallOption) (*AllSgdOrderReply, error) {
var out AllSgdOrderReply
pattern := "/order_sharesgd/share_all_position"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationShareSgdShareSgdAllPosition))
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 *ShareSgdHTTPClientImpl) ShareSgdCancel(ctx context.Context, in *CancelSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) {
var out SgdOrderReply
pattern := "/order_sharesgd/share_cancel"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationShareSgdShareSgdCancel))
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 *ShareSgdHTTPClientImpl) ShareSgdPlaceOrder(ctx context.Context, in *ShareSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) {
var out SgdOrderReply
pattern := "/order_sharesgd/share_place_order"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationShareSgdShareSgdPlaceOrder))
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 *ShareSgdHTTPClientImpl) ShareSgdPosition(ctx context.Context, in *CancelSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) {
var out SgdOrderReply
pattern := "/order_sharesgd/share_position"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationShareSgdShareSgdPosition))
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 *ShareSgdHTTPClientImpl) ShareSgdUpdateOrder(ctx context.Context, in *UpdateSgdOrderRequest, opts ...http.CallOption) (*SgdOrderReply, error) {
var out SgdOrderReply
pattern := "/order_sharesgd/share_update_order"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationShareSgdShareSgdUpdateOrder))
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
}