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/virtually/contract.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 OperationContractContractAllPosition = "/matchmaking.v1.Contract/ContractAllPosition" | |
| const OperationContractContractCancel = "/matchmaking.v1.Contract/ContractCancel" | |
| const OperationContractContractPlaceOrder = "/matchmaking.v1.Contract/ContractPlaceOrder" | |
| const OperationContractContractPosition = "/matchmaking.v1.Contract/ContractPosition" | |
| const OperationContractContractUpdatePlaceOrder = "/matchmaking.v1.Contract/ContractUpdatePlaceOrder" | |
| const OperationContractGetBotContractTrade = "/matchmaking.v1.Contract/GetBotContractTrade" | |
| 
 | |
| type ContractHTTPServer interface { | |
| 	// ContractAllPosition ContractAllPosition 合约一键平仓 | |
| 	ContractAllPosition(context.Context, *AllContractRequest) (*AllContractReply, error) | |
| 	// ContractCancel ContractCancel 合约撤单 | |
| 	ContractCancel(context.Context, *CancelContractRequest) (*ContractReply, error) | |
| 	// ContractPlaceOrder ContractPlaceOrder 合约下单 | |
| 	ContractPlaceOrder(context.Context, *ContractRequest) (*ContractReply, error) | |
| 	// ContractPosition ContractPosition 合约平仓 | |
| 	ContractPosition(context.Context, *CancelContractRequest) (*ContractReply, error) | |
| 	// ContractUpdatePlaceOrder ContractUpdatePlaceOrder 合约设置止盈止损 | |
| 	ContractUpdatePlaceOrder(context.Context, *UpdateContractRequest) (*ContractReply, error) | |
| 	// GetBotContractTrade GetBotContractTrade 合约列表查询 | |
| 	GetBotContractTrade(context.Context, *GetBotContractTradeRequest) (*GetBotContractTradeReply, error) | |
| } | |
| 
 | |
| func RegisterContractHTTPServer(s *http.Server, srv ContractHTTPServer) { | |
| 	r := s.Route("/") | |
| 	r.POST("/order_contract/contract_list", _Contract_GetBotContractTrade0_HTTP_Handler(srv)) | |
| 	r.POST("/order_contract/contract_place_order", _Contract_ContractPlaceOrder0_HTTP_Handler(srv)) | |
| 	r.POST("/order_contract/contract_update_order", _Contract_ContractUpdatePlaceOrder0_HTTP_Handler(srv)) | |
| 	r.POST("/order_contract/contract_position", _Contract_ContractPosition0_HTTP_Handler(srv)) | |
| 	r.POST("/order_contract/contract_all_position", _Contract_ContractAllPosition0_HTTP_Handler(srv)) | |
| 	r.POST("/order_contract/contract_cancel", _Contract_ContractCancel0_HTTP_Handler(srv)) | |
| } | |
| 
 | |
| func _Contract_GetBotContractTrade0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { | |
| 	return func(ctx http.Context) error { | |
| 		var in GetBotContractTradeRequest | |
| 		if err := ctx.Bind(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		if err := ctx.BindQuery(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		http.SetOperation(ctx, OperationContractGetBotContractTrade) | |
| 		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { | |
| 			return srv.GetBotContractTrade(ctx, req.(*GetBotContractTradeRequest)) | |
| 		}) | |
| 		out, err := h(ctx, &in) | |
| 		if err != nil { | |
| 			return err | |
| 		} | |
| 		reply := out.(*GetBotContractTradeReply) | |
| 		return ctx.Result(200, reply) | |
| 	} | |
| } | |
| 
 | |
| func _Contract_ContractPlaceOrder0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { | |
| 	return func(ctx http.Context) error { | |
| 		var in ContractRequest | |
| 		if err := ctx.Bind(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		if err := ctx.BindQuery(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		http.SetOperation(ctx, OperationContractContractPlaceOrder) | |
| 		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { | |
| 			return srv.ContractPlaceOrder(ctx, req.(*ContractRequest)) | |
| 		}) | |
| 		out, err := h(ctx, &in) | |
| 		if err != nil { | |
| 			return err | |
| 		} | |
| 		reply := out.(*ContractReply) | |
| 		return ctx.Result(200, reply) | |
| 	} | |
| } | |
| 
 | |
| func _Contract_ContractUpdatePlaceOrder0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { | |
| 	return func(ctx http.Context) error { | |
| 		var in UpdateContractRequest | |
| 		if err := ctx.Bind(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		if err := ctx.BindQuery(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		http.SetOperation(ctx, OperationContractContractUpdatePlaceOrder) | |
| 		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { | |
| 			return srv.ContractUpdatePlaceOrder(ctx, req.(*UpdateContractRequest)) | |
| 		}) | |
| 		out, err := h(ctx, &in) | |
| 		if err != nil { | |
| 			return err | |
| 		} | |
| 		reply := out.(*ContractReply) | |
| 		return ctx.Result(200, reply) | |
| 	} | |
| } | |
| 
 | |
| func _Contract_ContractPosition0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { | |
| 	return func(ctx http.Context) error { | |
| 		var in CancelContractRequest | |
| 		if err := ctx.Bind(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		if err := ctx.BindQuery(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		http.SetOperation(ctx, OperationContractContractPosition) | |
| 		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { | |
| 			return srv.ContractPosition(ctx, req.(*CancelContractRequest)) | |
| 		}) | |
| 		out, err := h(ctx, &in) | |
| 		if err != nil { | |
| 			return err | |
| 		} | |
| 		reply := out.(*ContractReply) | |
| 		return ctx.Result(200, reply) | |
| 	} | |
| } | |
| 
 | |
| func _Contract_ContractAllPosition0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { | |
| 	return func(ctx http.Context) error { | |
| 		var in AllContractRequest | |
| 		if err := ctx.Bind(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		if err := ctx.BindQuery(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		http.SetOperation(ctx, OperationContractContractAllPosition) | |
| 		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { | |
| 			return srv.ContractAllPosition(ctx, req.(*AllContractRequest)) | |
| 		}) | |
| 		out, err := h(ctx, &in) | |
| 		if err != nil { | |
| 			return err | |
| 		} | |
| 		reply := out.(*AllContractReply) | |
| 		return ctx.Result(200, reply) | |
| 	} | |
| } | |
| 
 | |
| func _Contract_ContractCancel0_HTTP_Handler(srv ContractHTTPServer) func(ctx http.Context) error { | |
| 	return func(ctx http.Context) error { | |
| 		var in CancelContractRequest | |
| 		if err := ctx.Bind(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		if err := ctx.BindQuery(&in); err != nil { | |
| 			return err | |
| 		} | |
| 		http.SetOperation(ctx, OperationContractContractCancel) | |
| 		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { | |
| 			return srv.ContractCancel(ctx, req.(*CancelContractRequest)) | |
| 		}) | |
| 		out, err := h(ctx, &in) | |
| 		if err != nil { | |
| 			return err | |
| 		} | |
| 		reply := out.(*ContractReply) | |
| 		return ctx.Result(200, reply) | |
| 	} | |
| } | |
| 
 | |
| type ContractHTTPClient interface { | |
| 	ContractAllPosition(ctx context.Context, req *AllContractRequest, opts ...http.CallOption) (rsp *AllContractReply, err error) | |
| 	ContractCancel(ctx context.Context, req *CancelContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) | |
| 	ContractPlaceOrder(ctx context.Context, req *ContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) | |
| 	ContractPosition(ctx context.Context, req *CancelContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) | |
| 	ContractUpdatePlaceOrder(ctx context.Context, req *UpdateContractRequest, opts ...http.CallOption) (rsp *ContractReply, err error) | |
| 	GetBotContractTrade(ctx context.Context, req *GetBotContractTradeRequest, opts ...http.CallOption) (rsp *GetBotContractTradeReply, err error) | |
| } | |
| 
 | |
| type ContractHTTPClientImpl struct { | |
| 	cc *http.Client | |
| } | |
| 
 | |
| func NewContractHTTPClient(client *http.Client) ContractHTTPClient { | |
| 	return &ContractHTTPClientImpl{client} | |
| } | |
| 
 | |
| func (c *ContractHTTPClientImpl) ContractAllPosition(ctx context.Context, in *AllContractRequest, opts ...http.CallOption) (*AllContractReply, error) { | |
| 	var out AllContractReply | |
| 	pattern := "/order_contract/contract_all_position" | |
| 	path := binding.EncodeURL(pattern, in, false) | |
| 	opts = append(opts, http.Operation(OperationContractContractAllPosition)) | |
| 	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 *ContractHTTPClientImpl) ContractCancel(ctx context.Context, in *CancelContractRequest, opts ...http.CallOption) (*ContractReply, error) { | |
| 	var out ContractReply | |
| 	pattern := "/order_contract/contract_cancel" | |
| 	path := binding.EncodeURL(pattern, in, false) | |
| 	opts = append(opts, http.Operation(OperationContractContractCancel)) | |
| 	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 *ContractHTTPClientImpl) ContractPlaceOrder(ctx context.Context, in *ContractRequest, opts ...http.CallOption) (*ContractReply, error) { | |
| 	var out ContractReply | |
| 	pattern := "/order_contract/contract_place_order" | |
| 	path := binding.EncodeURL(pattern, in, false) | |
| 	opts = append(opts, http.Operation(OperationContractContractPlaceOrder)) | |
| 	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 *ContractHTTPClientImpl) ContractPosition(ctx context.Context, in *CancelContractRequest, opts ...http.CallOption) (*ContractReply, error) { | |
| 	var out ContractReply | |
| 	pattern := "/order_contract/contract_position" | |
| 	path := binding.EncodeURL(pattern, in, false) | |
| 	opts = append(opts, http.Operation(OperationContractContractPosition)) | |
| 	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 *ContractHTTPClientImpl) ContractUpdatePlaceOrder(ctx context.Context, in *UpdateContractRequest, opts ...http.CallOption) (*ContractReply, error) { | |
| 	var out ContractReply | |
| 	pattern := "/order_contract/contract_update_order" | |
| 	path := binding.EncodeURL(pattern, in, false) | |
| 	opts = append(opts, http.Operation(OperationContractContractUpdatePlaceOrder)) | |
| 	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 *ContractHTTPClientImpl) GetBotContractTrade(ctx context.Context, in *GetBotContractTradeRequest, opts ...http.CallOption) (*GetBotContractTradeReply, error) { | |
| 	var out GetBotContractTradeReply | |
| 	pattern := "/order_contract/contract_list" | |
| 	path := binding.EncodeURL(pattern, in, false) | |
| 	opts = append(opts, http.Operation(OperationContractGetBotContractTrade)) | |
| 	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 | |
| }
 | |
| 
 |