Compare commits
	
		
			2 Commits
		
	
	
		
			829928da9b
			...
			ec0ad25aec
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ec0ad25aec | |||
| a439342ba2 | 
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -17,6 +17,19 @@ var _ = proto.Marshal | |||||||
| var _ = fmt.Errorf | var _ = fmt.Errorf | ||||||
| var _ = math.Inf | var _ = math.Inf | ||||||
| 
 | 
 | ||||||
|  | func (this *OrderCreateRecord) Validate() error { | ||||||
|  | 	for _, item := range this.AddRecords { | ||||||
|  | 		if item != nil { | ||||||
|  | 			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { | ||||||
|  | 				return github_com_mwitkow_go_proto_validators.FieldError("AddRecords", err) | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  | func (this *OrderCreateAddRecord) Validate() error { | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
| func (this *OrderRecordsRequestV2) Validate() error { | func (this *OrderRecordsRequestV2) Validate() error { | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
| @ -280,13 +293,13 @@ func (this *BundleExtendRecordsListResponse) Validate() error { | |||||||
| func (this *BundleExtendRecordItem) Validate() error { | func (this *BundleExtendRecordItem) Validate() error { | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
| func (this *GetBundleBalanceReq) Validate() error { | func (this *GetBundleBalanceListReq) Validate() error { | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
| func (this *BundleBalanceItem) Validate() error { | func (this *BundleBalanceItem) Validate() error { | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
| func (this *GetBundleBalanceResp) Validate() error { | func (this *GetBundleBalanceListResp) Validate() error { | ||||||
| 	for _, item := range this.Data { | 	for _, item := range this.Data { | ||||||
| 		if item != nil { | 		if item != nil { | ||||||
| 			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { | 			if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { | ||||||
| @ -296,3 +309,15 @@ func (this *GetBundleBalanceResp) Validate() error { | |||||||
| 	} | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  | func (this *CreateBundleBalanceReq) Validate() error { | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  | func (this *CreateBundleBalanceResp) Validate() error { | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  | func (this *AddBundleBalanceReq) Validate() error { | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  | func (this *AddBundleBalanceResp) Validate() error { | ||||||
|  | 	return nil | ||||||
|  | } | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| // Code generated by protoc-gen-go-triple. DO NOT EDIT.
 | // Code generated by protoc-gen-go-triple. DO NOT EDIT.
 | ||||||
| // versions:
 | // versions:
 | ||||||
| // - protoc-gen-go-triple v1.0.8
 | // - protoc-gen-go-triple v1.0.8
 | ||||||
| // - protoc             v5.29.2
 | // - protoc             v4.24.0--rc1
 | ||||||
| // source: pb/bundle.proto
 | // source: pb/bundle.proto
 | ||||||
| 
 | 
 | ||||||
| package bundle | package bundle | ||||||
| @ -37,7 +37,7 @@ type BundleClient interface { | |||||||
| 	BundleDetailV2(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponseV2, common.ErrorWithAttachment) | 	BundleDetailV2(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponseV2, common.ErrorWithAttachment) | ||||||
| 	BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) | 	BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) | ||||||
| 	BundleDetail(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponse, common.ErrorWithAttachment) | 	BundleDetail(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponse, common.ErrorWithAttachment) | ||||||
| 	CreateOrderRecord(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) | 	CreateOrderRecord(ctx context.Context, in *OrderCreateRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) | ||||||
| 	UpdateOrderRecord(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) | 	UpdateOrderRecord(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) | ||||||
| 	UpdateOrderRecordByOrderNo(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) | 	UpdateOrderRecordByOrderNo(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) | ||||||
| 	OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment) | 	OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment) | ||||||
| @ -59,7 +59,9 @@ type BundleClient interface { | |||||||
| 	// 余量管理
 | 	// 余量管理
 | ||||||
| 	BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) | 	BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) | ||||||
| 	BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment) | 	BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment) | ||||||
| 	GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment) | 	GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment) | ||||||
|  | 	CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment) | ||||||
|  | 	AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| type bundleClient struct { | type bundleClient struct { | ||||||
| @ -76,7 +78,7 @@ type BundleClientImpl struct { | |||||||
| 	BundleDetailV2                       func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponseV2, error) | 	BundleDetailV2                       func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponseV2, error) | ||||||
| 	BundleList                           func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error) | 	BundleList                           func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error) | ||||||
| 	BundleDetail                         func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error) | 	BundleDetail                         func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error) | ||||||
| 	CreateOrderRecord                    func(ctx context.Context, in *OrderRecord) (*CommonResponse, error) | 	CreateOrderRecord                    func(ctx context.Context, in *OrderCreateRecord) (*CommonResponse, error) | ||||||
| 	UpdateOrderRecord                    func(ctx context.Context, in *OrderRecord) (*CommonResponse, error) | 	UpdateOrderRecord                    func(ctx context.Context, in *OrderRecord) (*CommonResponse, error) | ||||||
| 	UpdateOrderRecordByOrderNo           func(ctx context.Context, in *OrderRecord) (*CommonResponse, error) | 	UpdateOrderRecordByOrderNo           func(ctx context.Context, in *OrderRecord) (*CommonResponse, error) | ||||||
| 	OrderRecordsList                     func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error) | 	OrderRecordsList                     func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error) | ||||||
| @ -95,7 +97,9 @@ type BundleClientImpl struct { | |||||||
| 	CalculatePrice                       func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error) | 	CalculatePrice                       func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error) | ||||||
| 	BundleExtend                         func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error) | 	BundleExtend                         func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error) | ||||||
| 	BundleExtendRecordsList              func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | 	BundleExtendRecordsList              func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | ||||||
| 	GetBundleBalance                     func(ctx context.Context, in *GetBundleBalanceReq) (*GetBundleBalanceResp, error) | 	GetBundleBalanceList                 func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) | ||||||
|  | 	CreateBundleBalance                  func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) | ||||||
|  | 	AddBundleBalance                     func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient { | func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient { | ||||||
| @ -164,7 +168,7 @@ func (c *bundleClient) BundleDetail(ctx context.Context, in *BundleDetailRequest | |||||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleDetail", in, out) | 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleDetail", in, out) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (c *bundleClient) CreateOrderRecord(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { | func (c *bundleClient) CreateOrderRecord(ctx context.Context, in *OrderCreateRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { | ||||||
| 	out := new(CommonResponse) | 	out := new(CommonResponse) | ||||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateOrderRecord", in, out) | 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateOrderRecord", in, out) | ||||||
| @ -278,10 +282,22 @@ func (c *bundleClient) BundleExtendRecordsList(ctx context.Context, in *BundleEx | |||||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleExtendRecordsList", in, out) | 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleExtendRecordsList", in, out) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (c *bundleClient) GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment) { | func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment) { | ||||||
| 	out := new(GetBundleBalanceResp) | 	out := new(GetBundleBalanceListResp) | ||||||
| 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||||
| 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalance", in, out) | 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceList", in, out) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func (c *bundleClient) CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment) { | ||||||
|  | 	out := new(CreateBundleBalanceResp) | ||||||
|  | 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||||
|  | 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateBundleBalance", in, out) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func (c *bundleClient) AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment) { | ||||||
|  | 	out := new(AddBundleBalanceResp) | ||||||
|  | 	interfaceKey := ctx.Value(constant.InterfaceKey).(string) | ||||||
|  | 	return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddBundleBalance", in, out) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // BundleServer is the server API for Bundle service.
 | // BundleServer is the server API for Bundle service.
 | ||||||
| @ -297,7 +313,7 @@ type BundleServer interface { | |||||||
| 	BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error) | 	BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error) | ||||||
| 	BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error) | 	BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error) | ||||||
| 	BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error) | 	BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error) | ||||||
| 	CreateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error) | 	CreateOrderRecord(context.Context, *OrderCreateRecord) (*CommonResponse, error) | ||||||
| 	UpdateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error) | 	UpdateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error) | ||||||
| 	UpdateOrderRecordByOrderNo(context.Context, *OrderRecord) (*CommonResponse, error) | 	UpdateOrderRecordByOrderNo(context.Context, *OrderRecord) (*CommonResponse, error) | ||||||
| 	OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error) | 	OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error) | ||||||
| @ -319,7 +335,9 @@ type BundleServer interface { | |||||||
| 	// 余量管理
 | 	// 余量管理
 | ||||||
| 	BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) | 	BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) | ||||||
| 	BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | 	BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) | ||||||
| 	GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) | 	GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) | ||||||
|  | 	CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) | ||||||
|  | 	AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error) | ||||||
| 	mustEmbedUnimplementedBundleServer() | 	mustEmbedUnimplementedBundleServer() | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -355,7 +373,7 @@ func (UnimplementedBundleServer) BundleList(context.Context, *BundleListRequest) | |||||||
| func (UnimplementedBundleServer) BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error) { | func (UnimplementedBundleServer) BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error) { | ||||||
| 	return nil, status.Errorf(codes.Unimplemented, "method BundleDetail not implemented") | 	return nil, status.Errorf(codes.Unimplemented, "method BundleDetail not implemented") | ||||||
| } | } | ||||||
| func (UnimplementedBundleServer) CreateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error) { | func (UnimplementedBundleServer) CreateOrderRecord(context.Context, *OrderCreateRecord) (*CommonResponse, error) { | ||||||
| 	return nil, status.Errorf(codes.Unimplemented, "method CreateOrderRecord not implemented") | 	return nil, status.Errorf(codes.Unimplemented, "method CreateOrderRecord not implemented") | ||||||
| } | } | ||||||
| func (UnimplementedBundleServer) UpdateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error) { | func (UnimplementedBundleServer) UpdateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error) { | ||||||
| @ -412,8 +430,14 @@ func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequ | |||||||
| func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) { | func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) { | ||||||
| 	return nil, status.Errorf(codes.Unimplemented, "method BundleExtendRecordsList not implemented") | 	return nil, status.Errorf(codes.Unimplemented, "method BundleExtendRecordsList not implemented") | ||||||
| } | } | ||||||
| func (UnimplementedBundleServer) GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) { | func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) { | ||||||
| 	return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalance not implemented") | 	return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented") | ||||||
|  | } | ||||||
|  | func (UnimplementedBundleServer) CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) { | ||||||
|  | 	return nil, status.Errorf(codes.Unimplemented, "method CreateBundleBalance not implemented") | ||||||
|  | } | ||||||
|  | func (UnimplementedBundleServer) AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error) { | ||||||
|  | 	return nil, status.Errorf(codes.Unimplemented, "method AddBundleBalance not implemented") | ||||||
| } | } | ||||||
| func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) { | func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) { | ||||||
| 	s.proxyImpl = impl | 	s.proxyImpl = impl | ||||||
| @ -705,7 +729,7 @@ func _Bundle_BundleDetail_Handler(srv interface{}, ctx context.Context, dec func | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func _Bundle_CreateOrderRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | func _Bundle_CreateOrderRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||||
| 	in := new(OrderRecord) | 	in := new(OrderCreateRecord) | ||||||
| 	if err := dec(in); err != nil { | 	if err := dec(in); err != nil { | ||||||
| 		return nil, err | 		return nil, err | ||||||
| 	} | 	} | ||||||
| @ -1255,8 +1279,8 @@ func _Bundle_BundleExtendRecordsList_Handler(srv interface{}, ctx context.Contex | |||||||
| 	return interceptor(ctx, in, info, handler) | 	return interceptor(ctx, in, info, handler) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||||
| 	in := new(GetBundleBalanceReq) | 	in := new(GetBundleBalanceListReq) | ||||||
| 	if err := dec(in); err != nil { | 	if err := dec(in); err != nil { | ||||||
| 		return nil, err | 		return nil, err | ||||||
| 	} | 	} | ||||||
| @ -1268,7 +1292,65 @@ func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec | |||||||
| 	for k, v := range md { | 	for k, v := range md { | ||||||
| 		invAttachment[k] = v | 		invAttachment[k] = v | ||||||
| 	} | 	} | ||||||
| 	invo := invocation.NewRPCInvocation("GetBundleBalance", args, invAttachment) | 	invo := invocation.NewRPCInvocation("GetBundleBalanceList", args, invAttachment) | ||||||
|  | 	if interceptor == nil { | ||||||
|  | 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||||
|  | 		return result, result.Error() | ||||||
|  | 	} | ||||||
|  | 	info := &grpc_go.UnaryServerInfo{ | ||||||
|  | 		Server:     srv, | ||||||
|  | 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||||
|  | 	} | ||||||
|  | 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||||
|  | 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||||
|  | 		return result, result.Error() | ||||||
|  | 	} | ||||||
|  | 	return interceptor(ctx, in, info, handler) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func _Bundle_CreateBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||||
|  | 	in := new(CreateBundleBalanceReq) | ||||||
|  | 	if err := dec(in); err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  | 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||||
|  | 	args := []interface{}{} | ||||||
|  | 	args = append(args, in) | ||||||
|  | 	md, _ := metadata.FromIncomingContext(ctx) | ||||||
|  | 	invAttachment := make(map[string]interface{}, len(md)) | ||||||
|  | 	for k, v := range md { | ||||||
|  | 		invAttachment[k] = v | ||||||
|  | 	} | ||||||
|  | 	invo := invocation.NewRPCInvocation("CreateBundleBalance", args, invAttachment) | ||||||
|  | 	if interceptor == nil { | ||||||
|  | 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||||
|  | 		return result, result.Error() | ||||||
|  | 	} | ||||||
|  | 	info := &grpc_go.UnaryServerInfo{ | ||||||
|  | 		Server:     srv, | ||||||
|  | 		FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), | ||||||
|  | 	} | ||||||
|  | 	handler := func(ctx context.Context, req interface{}) (interface{}, error) { | ||||||
|  | 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||||
|  | 		return result, result.Error() | ||||||
|  | 	} | ||||||
|  | 	return interceptor(ctx, in, info, handler) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func _Bundle_AddBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { | ||||||
|  | 	in := new(AddBundleBalanceReq) | ||||||
|  | 	if err := dec(in); err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  | 	base := srv.(dubbo3.Dubbo3GrpcService) | ||||||
|  | 	args := []interface{}{} | ||||||
|  | 	args = append(args, in) | ||||||
|  | 	md, _ := metadata.FromIncomingContext(ctx) | ||||||
|  | 	invAttachment := make(map[string]interface{}, len(md)) | ||||||
|  | 	for k, v := range md { | ||||||
|  | 		invAttachment[k] = v | ||||||
|  | 	} | ||||||
|  | 	invo := invocation.NewRPCInvocation("AddBundleBalance", args, invAttachment) | ||||||
| 	if interceptor == nil { | 	if interceptor == nil { | ||||||
| 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | 		result := base.XXX_GetProxyImpl().Invoke(ctx, invo) | ||||||
| 		return result, result.Error() | 		return result, result.Error() | ||||||
| @ -1404,8 +1486,16 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{ | |||||||
| 			Handler:    _Bundle_BundleExtendRecordsList_Handler, | 			Handler:    _Bundle_BundleExtendRecordsList_Handler, | ||||||
| 		}, | 		}, | ||||||
| 		{ | 		{ | ||||||
| 			MethodName: "GetBundleBalance", | 			MethodName: "GetBundleBalanceList", | ||||||
| 			Handler:    _Bundle_GetBundleBalance_Handler, | 			Handler:    _Bundle_GetBundleBalanceList_Handler, | ||||||
|  | 		}, | ||||||
|  | 		{ | ||||||
|  | 			MethodName: "CreateBundleBalance", | ||||||
|  | 			Handler:    _Bundle_CreateBundleBalance_Handler, | ||||||
|  | 		}, | ||||||
|  | 		{ | ||||||
|  | 			MethodName: "AddBundleBalance", | ||||||
|  | 			Handler:    _Bundle_AddBundleBalance_Handler, | ||||||
| 		}, | 		}, | ||||||
| 	}, | 	}, | ||||||
| 	Streams:  []grpc_go.StreamDesc{}, | 	Streams:  []grpc_go.StreamDesc{}, | ||||||
|  | |||||||
| @ -72,7 +72,7 @@ func NewRouter() *gin.Engine { | |||||||
| 		} | 		} | ||||||
| 		webAcRouter := privateGroup.Group("/user") | 		webAcRouter := privateGroup.Group("/user") | ||||||
| 		//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
 | 		//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
 | ||||||
| 		webAcRouter.Use(middleware.CheckLogin(service.AccountFieeProvider)) | 		webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider)) | ||||||
| 		{ | 		{ | ||||||
| 			webAcRouter.POST("list", account.UserList)         //用户列表
 | 			webAcRouter.POST("list", account.UserList)         //用户列表
 | ||||||
| 			webAcRouter.POST("approval", account.UserApproval) //实名审核
 | 			webAcRouter.POST("approval", account.UserApproval) //实名审核
 | ||||||
|  | |||||||
| @ -80,77 +80,57 @@ func CreateBundleOrderAddSignature(c *gin.Context) { | |||||||
| 		Options *bundle.ValueAddPriceOptions | 		Options *bundle.ValueAddPriceOptions | ||||||
| 		ID      int32 | 		ID      int32 | ||||||
| 	} | 	} | ||||||
| 
 | 	// 计算总金额和确定截止日期
 | ||||||
| 	var ( | 	var expirationDate string | ||||||
| 		valueAddServices []ValueAddServiceInfo | 	var addPriceList []*bundle.AddPriceOptionsInfo | ||||||
| 		totalAmount      float64 | 	var totalAmount float32 | ||||||
| 		mainDeadline     = orderRecordResp.OrderRecord.ExpirationTime | 	for _, svc := range req.AddPriceOptionsList { | ||||||
| 	) |  | ||||||
| 	for _, opt := range req.AddPriceOptionsList { |  | ||||||
| 		valueAddInfo, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &bundle.ValueAddServiceDetailRequest{ | 		valueAddInfo, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &bundle.ValueAddServiceDetailRequest{ | ||||||
| 			Uuid:     opt.ValueUid, | 			Uuid:     svc.ValueUid, | ||||||
| 			Language: req.Language, | 			Language: req.Language, | ||||||
| 		}) | 		}) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			service.Error(c, err) | 			service.Error(c, err) | ||||||
| 			return | 			return | ||||||
| 		} | 		} | ||||||
| 		// 找到匹配的选项
 | 		valuePrice, err := service.BundleProvider.CalculatePrice(context.Background(), &bundle.CalculatePriceRequest{ | ||||||
| 		var selectedOption *bundle.ValueAddPriceOptions | 			Uuid:     svc.ValueUid, | ||||||
| 		for _, option := range valueAddInfo.Options { | 			Num:      svc.Num, | ||||||
| 			if int32(option.Id) == opt.Id { | 			Language: req.Language, | ||||||
| 				selectedOption = option |  | ||||||
| 				break |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		if selectedOption == nil { |  | ||||||
| 			service.Error(c, errors.New("未找到匹配的价格选项")) |  | ||||||
| 			return |  | ||||||
| 		} |  | ||||||
| 		valueAddServices = append(valueAddServices, ValueAddServiceInfo{ |  | ||||||
| 			Service: valueAddInfo, |  | ||||||
| 			Options: selectedOption, |  | ||||||
| 			ID:      opt.Id, |  | ||||||
| 		}) | 		}) | ||||||
| 	} |  | ||||||
| 	// 计算总金额和确定截止日期
 |  | ||||||
| 	var expirationDate string |  | ||||||
| 	var addPriceList []*bundle.AddPriceOptionsInfo |  | ||||||
| 	for _, svc := range valueAddServices { |  | ||||||
| 		price, err := strconv.ParseFloat(svc.Options.Price, 64) |  | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			service.Error(c, errors.New("价格格式错误")) | 			service.Error(c, err) | ||||||
| 			return | 			return | ||||||
| 		} | 		} | ||||||
| 		var nowAmount float64 | 		totalAmount += valuePrice.Price | ||||||
| 		switch svc.Service.PriceMode { |  | ||||||
| 		case 1: // 数量×单价模式
 |  | ||||||
| 			nowAmount = float64(svc.Options.Num) * price |  | ||||||
| 			totalAmount += float64(svc.Options.Num) * price |  | ||||||
| 		case 2: // 固定价格模式
 |  | ||||||
| 			nowAmount = price |  | ||||||
| 			totalAmount += price |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		addPriceList = append(addPriceList, &bundle.AddPriceOptionsInfo{ | 		addPriceList = append(addPriceList, &bundle.AddPriceOptionsInfo{ | ||||||
| 			ValueUid:     svc.Service.Uuid, | 			ValueUid:     valueAddInfo.Uuid, | ||||||
| 			ServiceType:  svc.Service.ServiceType, | 			ServiceType:  valueAddInfo.ServiceType, | ||||||
| 			CurrencyType: svc.Service.PriceType, | 			CurrencyType: valueAddInfo.PriceType, | ||||||
| 			Amount:       float32(nowAmount), | 			Amount:       valuePrice.Price, | ||||||
| 			Num:          svc.Options.Num, | 			Num:          svc.Num, | ||||||
| 			Unit:         svc.Service.Unit, | 			Unit:         valueAddInfo.Unit, | ||||||
| 		}) | 		}) | ||||||
| 		// 如果是可用时长服务,计算新的截止日期
 | 		// 如果是可用时长服务,计算新的截止日期
 | ||||||
| 		if svc.Service.ServiceType == 5 { | 		if valueAddInfo.ServiceType == 5 { | ||||||
| 			newDeadline := calculateExpirationDate(svc.Options.Num, svc.Service.Unit) | 			endDate := orderRecordResp.OrderRecord.ExpirationTime | ||||||
| 			if expirationDate == "" || newDeadline > expirationDate { | 			if endDate == "9999-12-31" { | ||||||
| 				expirationDate = newDeadline | 				service.Error(c, errors.New(common.ErrorPermanentPackage)) | ||||||
|  | 				return | ||||||
| 			} | 			} | ||||||
|  | 			t, err := time.Parse("2006-01-02", endDate) | ||||||
|  | 			if err != nil { | ||||||
|  | 				fmt.Println("解析时间出错:", err) | ||||||
|  | 				return | ||||||
|  | 			} | ||||||
|  | 			newDeadline := calculateExpirationDate(t, svc.Num, valueAddInfo.Unit) | ||||||
|  | 			expirationDate = newDeadline | ||||||
|  | 			//}
 | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	// 如果没有可用时长服务,使用主套餐截止日期
 | 	// 如果没有可用时长服务,使用主套餐截止日期
 | ||||||
| 	if expirationDate == "" { | 	if expirationDate == "" { | ||||||
| 		expirationDate = mainDeadline | 		expirationDate = orderRecordResp.OrderRecord.ExpirationTime | ||||||
| 	} | 	} | ||||||
| 	req.CustomerNum = userInfo.SubNum | 	req.CustomerNum = userInfo.SubNum | ||||||
| 	req.CustomerName = userInfo.Name | 	req.CustomerName = userInfo.Name | ||||||
| @ -160,7 +140,7 @@ func CreateBundleOrderAddSignature(c *gin.Context) { | |||||||
| 	req.ExpirationDate = expirationDate | 	req.ExpirationDate = expirationDate | ||||||
| 	req.AddPriceOptionsList = addPriceList | 	req.AddPriceOptionsList = addPriceList | ||||||
| 	// 当前 未将 签名 写入合同中
 | 	// 当前 未将 签名 写入合同中
 | ||||||
| 	signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, float32(totalAmount), expirationDate) | 	signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, totalAmount, expirationDate) | ||||||
| 	if signContractErr != nil { | 	if signContractErr != nil { | ||||||
| 		service.Error(c, signContractErr) | 		service.Error(c, signContractErr) | ||||||
| 		return | 		return | ||||||
| @ -176,21 +156,21 @@ func CreateBundleOrderAddSignature(c *gin.Context) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // 计算截止日期辅助函数
 | // 计算截止日期辅助函数
 | ||||||
| func calculateExpirationDate(num int32, unit string) string { | func calculateExpirationDate(startDate time.Time, num int32, unit string) string { | ||||||
| 	now := time.Now() | 	//now := time.Now()
 | ||||||
| 	switch unit { | 	switch unit { | ||||||
| 	case "天": | 	case "天": | ||||||
| 		return now.AddDate(0, 0, int(num)).Format("2006-01-02") | 		return startDate.AddDate(0, 0, int(num)).Format("2006-01-02") | ||||||
| 	case "月": | 	case "月": | ||||||
| 		return now.AddDate(0, int(num), 0).Format("2006-01-02") | 		return startDate.AddDate(0, int(num), 0).Format("2006-01-02") | ||||||
| 	case "年": | 	case "年": | ||||||
| 		return now.AddDate(int(num), 0, 0).Format("2006-01-02") | 		return startDate.AddDate(int(num), 0, 0).Format("2006-01-02") | ||||||
| 	default: | 	default: | ||||||
| 		return "" | 		return "" | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| func CreateBundleOrderSignature(c *gin.Context) { | func CreateBundleOrderSignature(c *gin.Context) { | ||||||
| 	var req bundle.OrderRecord | 	var req bundle.OrderCreateRecord | ||||||
| 
 | 
 | ||||||
| 	if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { | 	if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { | ||||||
| 		service.Error(c, err) | 		service.Error(c, err) | ||||||
| @ -255,19 +235,12 @@ func CreateBundleOrderSignature(c *gin.Context) { | |||||||
| 		service.Error(c, lastOrderRecordErr) | 		service.Error(c, lastOrderRecordErr) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	lastContractNo := "" | 	lastContractNo := "" | ||||||
| 
 |  | ||||||
| 	if lastOrderRecord.OrderRecords != nil { | 	if lastOrderRecord.OrderRecords != nil { | ||||||
| 		for _, lastOrder := range lastOrderRecord.OrderRecords { | 		for _, lastOrder := range lastOrderRecord.OrderRecords { | ||||||
| 			lastContractNo = lastOrder.ContractNo | 			lastContractNo = lastOrder.ContractNo | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	req.CustomerNum = userInfo.SubNum |  | ||||||
| 	req.CustomerName = userInfo.Name |  | ||||||
| 	req.CustomerID = strconv.FormatUint(userInfo.ID, 10) |  | ||||||
| 
 |  | ||||||
| 	// 获取 套餐信息
 | 	// 获取 套餐信息
 | ||||||
| 	bundleDetailReq := &bundle.BundleDetailRequest{ | 	bundleDetailReq := &bundle.BundleDetailRequest{ | ||||||
| 		Uuid: req.BundleUuid, | 		Uuid: req.BundleUuid, | ||||||
| @ -277,69 +250,70 @@ func CreateBundleOrderSignature(c *gin.Context) { | |||||||
| 		service.Error(c, detailErr) | 		service.Error(c, detailErr) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	//获取增值套餐信息
 |  | ||||||
| 	//if req.ValueAddBundleUuid != "" {
 |  | ||||||
| 	//	valueAddBundleDetail, err := service.BundleProvider.ValueAddBundleDetail(context.Background(), &bundle.ValueAddBundleDetailRequest{
 |  | ||||||
| 	//		Uuid: req.ValueAddBundleUuid,
 |  | ||||||
| 	//	})
 |  | ||||||
| 	//	if err != nil {
 |  | ||||||
| 	//		service.Error(c, err)
 |  | ||||||
| 	//		return
 |  | ||||||
| 	//	}
 |  | ||||||
| 	//
 |  | ||||||
| 	//	req.ValueAddBundleUuid = valueAddBundleDetail.Data.Uuid
 |  | ||||||
| 	//	req.ValueAddOriginalPrice = valueAddBundleDetail.Data.OriginalPrice
 |  | ||||||
| 	//	req.ValueAddDiscountPrice = valueAddBundleDetail.Data.DiscountPrice
 |  | ||||||
| 	//	req.AddBundleCommonUid = valueAddBundleDetail.Data.AddBundleCommonUid
 |  | ||||||
| 	//
 |  | ||||||
| 	//	if valueAddBundleDetail.Data.Choose { // 可选条数
 |  | ||||||
| 	//		req.ValueAddBundleAmount = valueAddBundleDetail.Data.DiscountPrice * float32(req.Num)
 |  | ||||||
| 	//		discount, _ := new(big.Float).Sub(big.NewFloat(float64(valueAddBundleDetail.Data.OriginalPrice)), big.NewFloat(float64(valueAddBundleDetail.Data.DiscountPrice))).Float32()
 |  | ||||||
| 	//		req.ValueAddSavedAmount = discount * float32(req.Num)
 |  | ||||||
| 	//	} else { // 固定条数
 |  | ||||||
| 	//		req.ValueAddBundleAmount = valueAddBundleDetail.Data.TotalPrice
 |  | ||||||
| 	//		req.ValueAddSavedAmount = valueAddBundleDetail.Data.SavedAmount
 |  | ||||||
| 	//	}
 |  | ||||||
| 	//
 |  | ||||||
| 	//	req.TotalAmount, _ = new(big.Float).Add(big.NewFloat(float64(req.ValueAddBundleAmount)), big.NewFloat(float64(bundleDetail.Bundle.Price))).Float32()
 |  | ||||||
| 	//}
 |  | ||||||
| 
 |  | ||||||
| 	req.BundleName = bundleDetail.Bundle.Name |  | ||||||
| 	req.Amount = bundleDetail.Bundle.Price |  | ||||||
| 	req.AmountType = bundleDetail.Bundle.PriceType |  | ||||||
| 	req.BundleCommonUid = bundleDetail.Bundle.BundleCommonUid |  | ||||||
| 	req.TotalAmount = bundleDetail.Bundle.Price |  | ||||||
| 	req.PayType = 1 // 默认 人民币
 |  | ||||||
| 	//获取过期时间和增值服务金额
 | 	//获取过期时间和增值服务金额
 | ||||||
| 	PriceAndTime, err := service.BundleProvider.PackagePriceAndTime(context.Background(), &req) | 	var addRecords []*bundle.OrderCreateAddRecord | ||||||
|  | 	var addTotalPrice float32 | ||||||
|  | 	var expirationDay string | ||||||
|  | 	for _, i := range req.AddRecords { | ||||||
|  | 		price, err := service.BundleProvider.CalculatePrice(context.Background(), &bundle.CalculatePriceRequest{ | ||||||
|  | 			Uuid:     i.ValueUid, | ||||||
|  | 			Num:      i.Num, | ||||||
|  | 			Language: req.Language, | ||||||
|  | 		}) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			service.Error(c, err) | 			service.Error(c, err) | ||||||
| 			return | 			return | ||||||
| 		} | 		} | ||||||
| 	//套餐金额+增值服务金额
 | 		addTotalPrice += price.Price | ||||||
| 	totalAmount := PriceAndTime.Price + bundleDetail.Bundle.Price | 		addService, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &bundle.ValueAddServiceDetailRequest{ | ||||||
| 	req.ContractNo = common.GenerateContractNo(lastContractNo) | 			Uuid:     i.ValueUid, | ||||||
| 
 | 			Language: req.Language, | ||||||
|  | 		}) | ||||||
|  | 		if err != nil { | ||||||
|  | 			service.Error(c, err) | ||||||
|  | 			return | ||||||
|  | 		} | ||||||
|  | 		addRecords = append(addRecords, &bundle.OrderCreateAddRecord{ | ||||||
|  | 			ServiceType:   addService.ServiceType, | ||||||
|  | 			ValueUid:      i.ValueUid, | ||||||
|  | 			CurrencyType:  addService.PriceType, | ||||||
|  | 			Amount:        price.Price, | ||||||
|  | 			Num:           i.Num, | ||||||
|  | 			Unit:          addService.Unit, | ||||||
|  | 			Source:        1, | ||||||
|  | 			PaymentStatus: 1, | ||||||
|  | 		}) | ||||||
|  | 		//服务类型为时长 计算
 | ||||||
|  | 		if addService.ServiceType == 5 { | ||||||
|  | 			expirationDay = calculateExpirationDate(time.Now(), i.Num, addService.Unit) | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
| 	// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
 | 	// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
 | ||||||
| 	signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, totalAmount, PriceAndTime.Time) | 	signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, addTotalPrice, expirationDay) | ||||||
| 	if signContractErr != nil { | 	if signContractErr != nil { | ||||||
| 		service.Error(c, signContractErr) | 		service.Error(c, signContractErr) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 
 | 	req.CustomerNum = userInfo.SubNum | ||||||
|  | 	req.CustomerName = userInfo.Name | ||||||
|  | 	req.CustomerID = strconv.FormatUint(userInfo.ID, 10) | ||||||
|  | 	req.BundleName = bundleDetail.Bundle.Name | ||||||
|  | 	req.Amount = bundleDetail.Bundle.Price | ||||||
|  | 	req.AmountType = bundleDetail.Bundle.PriceType | ||||||
|  | 	req.BundleCommonUid = bundleDetail.Bundle.BundleCommonUid | ||||||
|  | 	req.TotalAmount = bundleDetail.Bundle.Price + addTotalPrice | ||||||
|  | 	req.ContractNo = common.GenerateContractNo(lastContractNo) | ||||||
| 	req.SignContract = signContract | 	req.SignContract = signContract | ||||||
| 
 |  | ||||||
| 	req.SignedTime = common.GetBeijingTime() | 	req.SignedTime = common.GetBeijingTime() | ||||||
| 
 |  | ||||||
| 	req.Status = bundleModel.OrderSigned | 	req.Status = bundleModel.OrderSigned | ||||||
|  | 	req.AddRecords = addRecords | ||||||
|  | 	req.ExpirationTime = expirationDay | ||||||
| 
 | 
 | ||||||
| 	res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req) | 	res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		service.Error(c, err) | 		service.Error(c, err) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	service.Success(c, res) | 	service.Success(c, res) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,6 +21,7 @@ const ( | |||||||
| 	HadOrder                 = "您已购买过套餐,无法再次购买" | 	HadOrder                 = "您已购买过套餐,无法再次购买" | ||||||
| 	InvalidValueAddBundleNum = "套餐数量无效" | 	InvalidValueAddBundleNum = "套餐数量无效" | ||||||
| 	ThePackageHasExpired     = "当前套餐已过期" | 	ThePackageHasExpired     = "当前套餐已过期" | ||||||
|  | 	ErrorPermanentPackage    = "永久套餐无需购买" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| const ( | const ( | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user