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/shareJpy.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 OperationShareJpyGetBotStockJpyTrade = "/matchmaking.v1.ShareJpy/GetBotStockJpyTrade"
|
|
const OperationShareJpyShareJpyAllPosition = "/matchmaking.v1.ShareJpy/ShareJpyAllPosition"
|
|
const OperationShareJpyShareJpyCancel = "/matchmaking.v1.ShareJpy/ShareJpyCancel"
|
|
const OperationShareJpyShareJpyPlaceOrder = "/matchmaking.v1.ShareJpy/ShareJpyPlaceOrder"
|
|
const OperationShareJpyShareJpyPosition = "/matchmaking.v1.ShareJpy/ShareJpyPosition"
|
|
const OperationShareJpyShareJpyUpdateOrder = "/matchmaking.v1.ShareJpy/ShareJpyUpdateOrder"
|
|
|
|
type ShareJpyHTTPServer interface {
|
|
// GetBotStockJpyTrade GetBotStockJpyTrade 日本股列表查询
|
|
GetBotStockJpyTrade(context.Context, *GetJpyBotStockTradeRequest) (*GetBotStockJpyTradeReply, error)
|
|
// ShareJpyAllPosition ShareJpyAllPosition 日本股一键平仓
|
|
ShareJpyAllPosition(context.Context, *AllJpyOrderRequest) (*AllJpyOrderReply, error)
|
|
// ShareJpyCancel ShareJpyCancel 日本股撤单
|
|
ShareJpyCancel(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error)
|
|
// ShareJpyPlaceOrder ShareJpyPlaceOrder 日本股下单
|
|
ShareJpyPlaceOrder(context.Context, *ShareJpyOrderRequest) (*JpyOrderReply, error)
|
|
// ShareJpyPosition ShareJpyPosition 日本股平仓
|
|
ShareJpyPosition(context.Context, *CancelJpyOrderRequest) (*JpyOrderReply, error)
|
|
// ShareJpyUpdateOrder ShareJpyUpdateOrder 日本股设置止盈止损
|
|
ShareJpyUpdateOrder(context.Context, *UpdateJpyOrderRequest) (*JpyOrderReply, error)
|
|
}
|
|
|
|
func RegisterShareJpyHTTPServer(s *http.Server, srv ShareJpyHTTPServer) {
|
|
r := s.Route("/")
|
|
r.POST("/order_sharejpy/share_list", _ShareJpy_GetBotStockJpyTrade0_HTTP_Handler(srv))
|
|
r.POST("/order_sharejpy/share_place_order", _ShareJpy_ShareJpyPlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharejpy/share_update_order", _ShareJpy_ShareJpyUpdateOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharejpy/share_position", _ShareJpy_ShareJpyPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharejpy/share_all_position", _ShareJpy_ShareJpyAllPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharejpy/share_cancel", _ShareJpy_ShareJpyCancel0_HTTP_Handler(srv))
|
|
}
|
|
|
|
func _ShareJpy_GetBotStockJpyTrade0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in GetJpyBotStockTradeRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareJpyGetBotStockJpyTrade)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.GetBotStockJpyTrade(ctx, req.(*GetJpyBotStockTradeRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*GetBotStockJpyTradeReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareJpy_ShareJpyPlaceOrder0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in ShareJpyOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareJpyShareJpyPlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareJpyPlaceOrder(ctx, req.(*ShareJpyOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*JpyOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareJpy_ShareJpyUpdateOrder0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in UpdateJpyOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareJpyShareJpyUpdateOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareJpyUpdateOrder(ctx, req.(*UpdateJpyOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*JpyOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareJpy_ShareJpyPosition0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelJpyOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareJpyShareJpyPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareJpyPosition(ctx, req.(*CancelJpyOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*JpyOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareJpy_ShareJpyAllPosition0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in AllJpyOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareJpyShareJpyAllPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareJpyAllPosition(ctx, req.(*AllJpyOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*AllJpyOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareJpy_ShareJpyCancel0_HTTP_Handler(srv ShareJpyHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelJpyOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareJpyShareJpyCancel)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareJpyCancel(ctx, req.(*CancelJpyOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*JpyOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
type ShareJpyHTTPClient interface {
|
|
GetBotStockJpyTrade(ctx context.Context, req *GetJpyBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockJpyTradeReply, err error)
|
|
ShareJpyAllPosition(ctx context.Context, req *AllJpyOrderRequest, opts ...http.CallOption) (rsp *AllJpyOrderReply, err error)
|
|
ShareJpyCancel(ctx context.Context, req *CancelJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error)
|
|
ShareJpyPlaceOrder(ctx context.Context, req *ShareJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error)
|
|
ShareJpyPosition(ctx context.Context, req *CancelJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error)
|
|
ShareJpyUpdateOrder(ctx context.Context, req *UpdateJpyOrderRequest, opts ...http.CallOption) (rsp *JpyOrderReply, err error)
|
|
}
|
|
|
|
type ShareJpyHTTPClientImpl struct {
|
|
cc *http.Client
|
|
}
|
|
|
|
func NewShareJpyHTTPClient(client *http.Client) ShareJpyHTTPClient {
|
|
return &ShareJpyHTTPClientImpl{client}
|
|
}
|
|
|
|
func (c *ShareJpyHTTPClientImpl) GetBotStockJpyTrade(ctx context.Context, in *GetJpyBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockJpyTradeReply, error) {
|
|
var out GetBotStockJpyTradeReply
|
|
pattern := "/order_sharejpy/share_list"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareJpyGetBotStockJpyTrade))
|
|
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 *ShareJpyHTTPClientImpl) ShareJpyAllPosition(ctx context.Context, in *AllJpyOrderRequest, opts ...http.CallOption) (*AllJpyOrderReply, error) {
|
|
var out AllJpyOrderReply
|
|
pattern := "/order_sharejpy/share_all_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareJpyShareJpyAllPosition))
|
|
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 *ShareJpyHTTPClientImpl) ShareJpyCancel(ctx context.Context, in *CancelJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) {
|
|
var out JpyOrderReply
|
|
pattern := "/order_sharejpy/share_cancel"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareJpyShareJpyCancel))
|
|
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 *ShareJpyHTTPClientImpl) ShareJpyPlaceOrder(ctx context.Context, in *ShareJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) {
|
|
var out JpyOrderReply
|
|
pattern := "/order_sharejpy/share_place_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareJpyShareJpyPlaceOrder))
|
|
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 *ShareJpyHTTPClientImpl) ShareJpyPosition(ctx context.Context, in *CancelJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) {
|
|
var out JpyOrderReply
|
|
pattern := "/order_sharejpy/share_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareJpyShareJpyPosition))
|
|
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 *ShareJpyHTTPClientImpl) ShareJpyUpdateOrder(ctx context.Context, in *UpdateJpyOrderRequest, opts ...http.CallOption) (*JpyOrderReply, error) {
|
|
var out JpyOrderReply
|
|
pattern := "/order_sharejpy/share_update_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareJpyShareJpyUpdateOrder))
|
|
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
|
|
}
|
|
|