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.

239 lines
8.6 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/order/order.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 OperationOrderShareGiveaways = "/matchmaking.v1.Order/ShareGiveaways"
const OperationOrderSharePreTrade = "/matchmaking.v1.Order/SharePreTrade"
const OperationOrderSharePreTradeByOrderNo = "/matchmaking.v1.Order/SharePreTradeByOrderNo"
const OperationOrderUpdateShareAllStockId = "/matchmaking.v1.Order/UpdateShareAllStockId"
const OperationOrderUpdateShareTradeStockId = "/matchmaking.v1.Order/UpdateShareTradeStockId"
type OrderHTTPServer interface {
// ShareGiveaways ShareGiveaways 股票赠送
ShareGiveaways(context.Context, *SharePreRequest) (*SharePreReply, error)
// SharePreTrade SharePreTrade 新股申购
SharePreTrade(context.Context, *SharePreRequest) (*SharePreReply, error)
// SharePreTradeByOrderNo SharePreTradeByOrderNo 新股申购-订单号
SharePreTradeByOrderNo(context.Context, *SharePreRequest) (*SharePreReply, error)
// UpdateShareAllStockId UpdateShareAllStockId 更新全局的股票StockId
UpdateShareAllStockId(context.Context, *ShareNullRequest) (*SharePreReply, error)
// UpdateShareTradeStockId UpdateShareTradeStockId 更新股票代码stock_id
UpdateShareTradeStockId(context.Context, *ShareTradeStockIdRequest) (*SharePreReply, error)
}
func RegisterOrderHTTPServer(s *http.Server, srv OrderHTTPServer) {
r := s.Route("/")
r.POST("/order_sharepre/share_pre_trade", _Order_SharePreTrade0_HTTP_Handler(srv))
r.POST("/order_sharepre/share_pre_trade_by_order_no", _Order_SharePreTradeByOrderNo0_HTTP_Handler(srv))
r.POST("/order_sharepre/update_stock_id", _Order_UpdateShareTradeStockId0_HTTP_Handler(srv))
r.POST("/order_sharepre/share_giveaways", _Order_ShareGiveaways0_HTTP_Handler(srv))
r.POST("/order_sharepre/update_all_stock_id", _Order_UpdateShareAllStockId0_HTTP_Handler(srv))
}
func _Order_SharePreTrade0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in SharePreRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationOrderSharePreTrade)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.SharePreTrade(ctx, req.(*SharePreRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SharePreReply)
return ctx.Result(200, reply)
}
}
func _Order_SharePreTradeByOrderNo0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in SharePreRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationOrderSharePreTradeByOrderNo)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.SharePreTradeByOrderNo(ctx, req.(*SharePreRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SharePreReply)
return ctx.Result(200, reply)
}
}
func _Order_UpdateShareTradeStockId0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in ShareTradeStockIdRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationOrderUpdateShareTradeStockId)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.UpdateShareTradeStockId(ctx, req.(*ShareTradeStockIdRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SharePreReply)
return ctx.Result(200, reply)
}
}
func _Order_ShareGiveaways0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in SharePreRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationOrderShareGiveaways)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ShareGiveaways(ctx, req.(*SharePreRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SharePreReply)
return ctx.Result(200, reply)
}
}
func _Order_UpdateShareAllStockId0_HTTP_Handler(srv OrderHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in ShareNullRequest
if err := ctx.Bind(&in); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationOrderUpdateShareAllStockId)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.UpdateShareAllStockId(ctx, req.(*ShareNullRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SharePreReply)
return ctx.Result(200, reply)
}
}
type OrderHTTPClient interface {
ShareGiveaways(ctx context.Context, req *SharePreRequest, opts ...http.CallOption) (rsp *SharePreReply, err error)
SharePreTrade(ctx context.Context, req *SharePreRequest, opts ...http.CallOption) (rsp *SharePreReply, err error)
SharePreTradeByOrderNo(ctx context.Context, req *SharePreRequest, opts ...http.CallOption) (rsp *SharePreReply, err error)
UpdateShareAllStockId(ctx context.Context, req *ShareNullRequest, opts ...http.CallOption) (rsp *SharePreReply, err error)
UpdateShareTradeStockId(ctx context.Context, req *ShareTradeStockIdRequest, opts ...http.CallOption) (rsp *SharePreReply, err error)
}
type OrderHTTPClientImpl struct {
cc *http.Client
}
func NewOrderHTTPClient(client *http.Client) OrderHTTPClient {
return &OrderHTTPClientImpl{client}
}
func (c *OrderHTTPClientImpl) ShareGiveaways(ctx context.Context, in *SharePreRequest, opts ...http.CallOption) (*SharePreReply, error) {
var out SharePreReply
pattern := "/order_sharepre/share_giveaways"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationOrderShareGiveaways))
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 *OrderHTTPClientImpl) SharePreTrade(ctx context.Context, in *SharePreRequest, opts ...http.CallOption) (*SharePreReply, error) {
var out SharePreReply
pattern := "/order_sharepre/share_pre_trade"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationOrderSharePreTrade))
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 *OrderHTTPClientImpl) SharePreTradeByOrderNo(ctx context.Context, in *SharePreRequest, opts ...http.CallOption) (*SharePreReply, error) {
var out SharePreReply
pattern := "/order_sharepre/share_pre_trade_by_order_no"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationOrderSharePreTradeByOrderNo))
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 *OrderHTTPClientImpl) UpdateShareAllStockId(ctx context.Context, in *ShareNullRequest, opts ...http.CallOption) (*SharePreReply, error) {
var out SharePreReply
pattern := "/order_sharepre/update_all_stock_id"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationOrderUpdateShareAllStockId))
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 *OrderHTTPClientImpl) UpdateShareTradeStockId(ctx context.Context, in *ShareTradeStockIdRequest, opts ...http.CallOption) (*SharePreReply, error) {
var out SharePreReply
pattern := "/order_sharepre/update_stock_id"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationOrderUpdateShareTradeStockId))
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
}