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/shareTha.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 OperationShareThaGetBotStockThaTrade = "/matchmaking.v1.ShareTha/GetBotStockThaTrade"
|
|
const OperationShareThaShareThaAllPosition = "/matchmaking.v1.ShareTha/ShareThaAllPosition"
|
|
const OperationShareThaShareThaCancel = "/matchmaking.v1.ShareTha/ShareThaCancel"
|
|
const OperationShareThaShareThaPlaceOrder = "/matchmaking.v1.ShareTha/ShareThaPlaceOrder"
|
|
const OperationShareThaShareThaPosition = "/matchmaking.v1.ShareTha/ShareThaPosition"
|
|
const OperationShareThaShareThaUpdateOrder = "/matchmaking.v1.ShareTha/ShareThaUpdateOrder"
|
|
|
|
type ShareThaHTTPServer interface {
|
|
// GetBotStockThaTrade GetBotStockThaTrade 泰股列表查询
|
|
GetBotStockThaTrade(context.Context, *GetThaBotStockTradeRequest) (*GetBotStockThaTradeReply, error)
|
|
// ShareThaAllPosition ShareThaAllPosition 泰股一键平仓
|
|
ShareThaAllPosition(context.Context, *AllThaOrderRequest) (*AllThaOrderReply, error)
|
|
// ShareThaCancel ShareThaCancel 泰股撤单
|
|
ShareThaCancel(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error)
|
|
// ShareThaPlaceOrder ShareThaPlaceOrder 泰股下单
|
|
ShareThaPlaceOrder(context.Context, *ShareThaOrderRequest) (*ThaOrderReply, error)
|
|
// ShareThaPosition ShareThaPosition 泰股平仓
|
|
ShareThaPosition(context.Context, *CancelThaOrderRequest) (*ThaOrderReply, error)
|
|
// ShareThaUpdateOrder ShareThaUpdateOrder 泰股设置止盈止损
|
|
ShareThaUpdateOrder(context.Context, *UpdateThaOrderRequest) (*ThaOrderReply, error)
|
|
}
|
|
|
|
func RegisterShareThaHTTPServer(s *http.Server, srv ShareThaHTTPServer) {
|
|
r := s.Route("/")
|
|
r.POST("/order_sharetha/share_list", _ShareTha_GetBotStockThaTrade0_HTTP_Handler(srv))
|
|
r.POST("/order_sharetha/share_place_order", _ShareTha_ShareThaPlaceOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharetha/share_update_order", _ShareTha_ShareThaUpdateOrder0_HTTP_Handler(srv))
|
|
r.POST("/order_sharetha/share_position", _ShareTha_ShareThaPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharetha/share_all_position", _ShareTha_ShareThaAllPosition0_HTTP_Handler(srv))
|
|
r.POST("/order_sharetha/share_cancel", _ShareTha_ShareThaCancel0_HTTP_Handler(srv))
|
|
}
|
|
|
|
func _ShareTha_GetBotStockThaTrade0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in GetThaBotStockTradeRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareThaGetBotStockThaTrade)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.GetBotStockThaTrade(ctx, req.(*GetThaBotStockTradeRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*GetBotStockThaTradeReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareTha_ShareThaPlaceOrder0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in ShareThaOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareThaShareThaPlaceOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareThaPlaceOrder(ctx, req.(*ShareThaOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*ThaOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareTha_ShareThaUpdateOrder0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in UpdateThaOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareThaShareThaUpdateOrder)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareThaUpdateOrder(ctx, req.(*UpdateThaOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*ThaOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareTha_ShareThaPosition0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelThaOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareThaShareThaPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareThaPosition(ctx, req.(*CancelThaOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*ThaOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareTha_ShareThaAllPosition0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in AllThaOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareThaShareThaAllPosition)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareThaAllPosition(ctx, req.(*AllThaOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*AllThaOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
func _ShareTha_ShareThaCancel0_HTTP_Handler(srv ShareThaHTTPServer) func(ctx http.Context) error {
|
|
return func(ctx http.Context) error {
|
|
var in CancelThaOrderRequest
|
|
if err := ctx.Bind(&in); err != nil {
|
|
return err
|
|
}
|
|
if err := ctx.BindQuery(&in); err != nil {
|
|
return err
|
|
}
|
|
http.SetOperation(ctx, OperationShareThaShareThaCancel)
|
|
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.ShareThaCancel(ctx, req.(*CancelThaOrderRequest))
|
|
})
|
|
out, err := h(ctx, &in)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := out.(*ThaOrderReply)
|
|
return ctx.Result(200, reply)
|
|
}
|
|
}
|
|
|
|
type ShareThaHTTPClient interface {
|
|
GetBotStockThaTrade(ctx context.Context, req *GetThaBotStockTradeRequest, opts ...http.CallOption) (rsp *GetBotStockThaTradeReply, err error)
|
|
ShareThaAllPosition(ctx context.Context, req *AllThaOrderRequest, opts ...http.CallOption) (rsp *AllThaOrderReply, err error)
|
|
ShareThaCancel(ctx context.Context, req *CancelThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error)
|
|
ShareThaPlaceOrder(ctx context.Context, req *ShareThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error)
|
|
ShareThaPosition(ctx context.Context, req *CancelThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error)
|
|
ShareThaUpdateOrder(ctx context.Context, req *UpdateThaOrderRequest, opts ...http.CallOption) (rsp *ThaOrderReply, err error)
|
|
}
|
|
|
|
type ShareThaHTTPClientImpl struct {
|
|
cc *http.Client
|
|
}
|
|
|
|
func NewShareThaHTTPClient(client *http.Client) ShareThaHTTPClient {
|
|
return &ShareThaHTTPClientImpl{client}
|
|
}
|
|
|
|
func (c *ShareThaHTTPClientImpl) GetBotStockThaTrade(ctx context.Context, in *GetThaBotStockTradeRequest, opts ...http.CallOption) (*GetBotStockThaTradeReply, error) {
|
|
var out GetBotStockThaTradeReply
|
|
pattern := "/order_sharetha/share_list"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareThaGetBotStockThaTrade))
|
|
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 *ShareThaHTTPClientImpl) ShareThaAllPosition(ctx context.Context, in *AllThaOrderRequest, opts ...http.CallOption) (*AllThaOrderReply, error) {
|
|
var out AllThaOrderReply
|
|
pattern := "/order_sharetha/share_all_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareThaShareThaAllPosition))
|
|
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 *ShareThaHTTPClientImpl) ShareThaCancel(ctx context.Context, in *CancelThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) {
|
|
var out ThaOrderReply
|
|
pattern := "/order_sharetha/share_cancel"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareThaShareThaCancel))
|
|
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 *ShareThaHTTPClientImpl) ShareThaPlaceOrder(ctx context.Context, in *ShareThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) {
|
|
var out ThaOrderReply
|
|
pattern := "/order_sharetha/share_place_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareThaShareThaPlaceOrder))
|
|
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 *ShareThaHTTPClientImpl) ShareThaPosition(ctx context.Context, in *CancelThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) {
|
|
var out ThaOrderReply
|
|
pattern := "/order_sharetha/share_position"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareThaShareThaPosition))
|
|
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 *ShareThaHTTPClientImpl) ShareThaUpdateOrder(ctx context.Context, in *UpdateThaOrderRequest, opts ...http.CallOption) (*ThaOrderReply, error) {
|
|
var out ThaOrderReply
|
|
pattern := "/order_sharetha/share_update_order"
|
|
path := binding.EncodeURL(pattern, in, false)
|
|
opts = append(opts, http.Operation(OperationShareThaShareThaUpdateOrder))
|
|
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
|
|
}
|
|
|