11
This commit is contained in:
parent
99cfbbf6f7
commit
c4e72efcb5
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,12 @@ var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
func (this *OrderInfoByOrderNoRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *OrderInfoByOrderNoResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *OrderCreateRecord) Validate() error {
|
||||
for _, item := range this.AddRecords {
|
||||
if item != nil {
|
||||
@ -293,6 +299,9 @@ func (this *BundleExtendRecordsListResponse) Validate() error {
|
||||
func (this *BundleExtendRecordItem) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetBundleBalanceListReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetBundleBalanceReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
@ -309,3 +318,59 @@ func (this *GetBundleBalanceResp) Validate() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetBundleBalanceListResp) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
func (this *GetUsedRecordListReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetUsedRecordListResp) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *WorkCastItem) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetImageWorkDetailReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetVedioWorkDetailReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetImageWorkDetailResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetVedioeWorkDetailResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ToBeComfirmedWorksReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ToBeComfirmedWorksResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ type BundleClient interface {
|
||||
CreateOrderAddRecord(ctx context.Context, in *OrderAddRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||
PackagePriceAndTime(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*PackagePriceAndTimeResponse, common.ErrorWithAttachment)
|
||||
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment)
|
||||
OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
|
||||
//增值套餐
|
||||
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
|
||||
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
||||
@ -59,7 +60,14 @@ type BundleClient interface {
|
||||
// 余量管理
|
||||
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)
|
||||
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)
|
||||
// 使用记录
|
||||
GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment)
|
||||
GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment)
|
||||
GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment)
|
||||
ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type bundleClient struct {
|
||||
@ -85,6 +93,7 @@ type BundleClientImpl struct {
|
||||
CreateOrderAddRecord func(ctx context.Context, in *OrderAddRecord) (*CommonResponse, error)
|
||||
PackagePriceAndTime func(ctx context.Context, in *OrderRecord) (*PackagePriceAndTimeResponse, error)
|
||||
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||
@ -95,7 +104,13 @@ type BundleClientImpl struct {
|
||||
CalculatePrice func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error)
|
||||
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, 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)
|
||||
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
|
||||
GetImageWorkDetail func(ctx context.Context, in *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
|
||||
GetVedioWorkDetail func(ctx context.Context, in *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
|
||||
ToBeComfirmedWorks func(ctx context.Context, in *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
|
||||
}
|
||||
|
||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||
@ -218,6 +233,12 @@ func (c *bundleClient) OrderRecordsListV2(ctx context.Context, in *OrderRecordsR
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderRecordsListV2", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment) {
|
||||
out := new(OrderInfoByOrderNoResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderListByOrderNo", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
||||
out := new(CreateValueAddBundleResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
@ -278,10 +299,46 @@ func (c *bundleClient) BundleExtendRecordsList(ctx context.Context, in *BundleEx
|
||||
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) {
|
||||
out := new(GetBundleBalanceResp)
|
||||
func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment) {
|
||||
out := new(GetBundleBalanceListResp)
|
||||
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)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment) {
|
||||
out := new(GetUsedRecordListResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetUsedRecordList", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment) {
|
||||
out := new(GetImageWorkDetailResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetImageWorkDetail", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment) {
|
||||
out := new(GetVedioeWorkDetailResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetVedioWorkDetail", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment) {
|
||||
out := new(ToBeComfirmedWorksResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ToBeComfirmedWorks", in, out)
|
||||
}
|
||||
|
||||
// BundleServer is the server API for Bundle service.
|
||||
@ -306,6 +363,7 @@ type BundleServer interface {
|
||||
CreateOrderAddRecord(context.Context, *OrderAddRecord) (*CommonResponse, error)
|
||||
PackagePriceAndTime(context.Context, *OrderRecord) (*PackagePriceAndTimeResponse, error)
|
||||
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||
//增值套餐
|
||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
@ -319,7 +377,14 @@ type BundleServer interface {
|
||||
// 余量管理
|
||||
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, 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)
|
||||
// 使用记录
|
||||
GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
|
||||
GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
|
||||
GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
|
||||
ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
|
||||
mustEmbedUnimplementedBundleServer()
|
||||
}
|
||||
|
||||
@ -382,6 +447,9 @@ func (UnimplementedBundleServer) PackagePriceAndTime(context.Context, *OrderReco
|
||||
func (UnimplementedBundleServer) OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OrderRecordsListV2 not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OrderListByOrderNo not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
||||
}
|
||||
@ -412,8 +480,26 @@ func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequ
|
||||
func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method BundleExtendRecordsList not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalance not implemented")
|
||||
func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
|
||||
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 (UnimplementedBundleServer) GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUsedRecordList not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetImageWorkDetail not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetVedioWorkDetail not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented")
|
||||
}
|
||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
@ -965,6 +1051,35 @@ func _Bundle_OrderRecordsListV2_Handler(srv interface{}, ctx context.Context, de
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_OrderListByOrderNo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(OrderInfoByOrderNoRequest)
|
||||
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("OrderListByOrderNo", 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_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateValueAddBundleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@ -1255,8 +1370,8 @@ func _Bundle_BundleExtendRecordsList_Handler(srv interface{}, ctx context.Contex
|
||||
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) {
|
||||
in := new(GetBundleBalanceReq)
|
||||
func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBundleBalanceListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -1268,7 +1383,181 @@ func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec
|
||||
for k, v := range md {
|
||||
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 {
|
||||
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_GetUsedRecordList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUsedRecordListReq)
|
||||
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("GetUsedRecordList", 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_GetImageWorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetImageWorkDetailReq)
|
||||
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("GetImageWorkDetail", 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_GetVedioWorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetVedioWorkDetailReq)
|
||||
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("GetVedioWorkDetail", 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_ToBeComfirmedWorks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ToBeComfirmedWorksReq)
|
||||
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("ToBeComfirmedWorks", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
@ -1363,6 +1652,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "OrderRecordsListV2",
|
||||
Handler: _Bundle_OrderRecordsListV2_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "OrderListByOrderNo",
|
||||
Handler: _Bundle_OrderListByOrderNo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateValueAddBundle",
|
||||
Handler: _Bundle_CreateValueAddBundle_Handler,
|
||||
@ -1404,8 +1697,32 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
Handler: _Bundle_BundleExtendRecordsList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBundleBalance",
|
||||
Handler: _Bundle_GetBundleBalance_Handler,
|
||||
MethodName: "GetBundleBalanceList",
|
||||
Handler: _Bundle_GetBundleBalanceList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateBundleBalance",
|
||||
Handler: _Bundle_CreateBundleBalance_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddBundleBalance",
|
||||
Handler: _Bundle_AddBundleBalance_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUsedRecordList",
|
||||
Handler: _Bundle_GetUsedRecordList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetImageWorkDetail",
|
||||
Handler: _Bundle_GetImageWorkDetail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetVedioWorkDetail",
|
||||
Handler: _Bundle_GetVedioWorkDetail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ToBeComfirmedWorks",
|
||||
Handler: _Bundle_ToBeComfirmedWorks_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
|
@ -28,6 +28,7 @@ func CreateBundleOrderAddSignature(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if req.Language == "" {
|
||||
req.Language = c.GetHeader("Accept-Language")
|
||||
service.Error(c, errors.New(common.MissLanguageTypes))
|
||||
return
|
||||
}
|
||||
@ -65,13 +66,13 @@ func CreateBundleOrderAddSignature(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
// 获取套餐详情(待替换逻辑)
|
||||
bundleDetail, err := service.BundleProvider.BundleDetail(context.Background(), &bundle.BundleDetailRequest{
|
||||
Uuid: req.BundleUuid,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
//bundleDetail, err := service.BundleProvider.BundleDetail(context.Background(), &bundle.BundleDetailRequest{
|
||||
// Uuid: req.BundleUuid,
|
||||
//})
|
||||
//if err != nil {
|
||||
// service.Error(c, err)
|
||||
// return
|
||||
//}
|
||||
// todo 需要判断购买的增值服务是否为可用时长 如果为可以用时长 合同截止日期为购买时长时间 否则合同截止日期为主套餐截止日期
|
||||
// 处理多个增值服务
|
||||
type ValueAddServiceInfo struct {
|
||||
@ -80,7 +81,7 @@ func CreateBundleOrderAddSignature(c *gin.Context) {
|
||||
ID int32
|
||||
}
|
||||
// 计算总金额和确定截止日期
|
||||
var expirationDate string
|
||||
//var expirationDate string
|
||||
var addPriceList []*bundle.AddPriceOptionsInfo
|
||||
var totalAmount float32
|
||||
for _, svc := range req.AddPriceOptionsList {
|
||||
@ -110,8 +111,8 @@ func CreateBundleOrderAddSignature(c *gin.Context) {
|
||||
Num: svc.Num,
|
||||
Unit: valueAddInfo.Unit,
|
||||
})
|
||||
// 如果是可用时长服务,计算新的截止日期
|
||||
if valueAddInfo.ServiceType == 5 {
|
||||
// 如果是可用时长服务,计算新的截止日期 todo 不需要计算到期时间 在完成支付时添加
|
||||
/*if valueAddInfo.ServiceType == 5 {
|
||||
endDate := orderRecordResp.OrderRecord.ExpirationTime
|
||||
if endDate == "9999-12-31" {
|
||||
service.Error(c, errors.New(common.ErrorPermanentPackage))
|
||||
@ -125,27 +126,27 @@ func CreateBundleOrderAddSignature(c *gin.Context) {
|
||||
newDeadline := calculateExpirationDate(t, svc.Num, valueAddInfo.Unit)
|
||||
expirationDate = newDeadline
|
||||
//}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// 如果没有可用时长服务,使用主套餐截止日期
|
||||
if expirationDate == "" {
|
||||
expirationDate = orderRecordResp.OrderRecord.ExpirationTime
|
||||
}
|
||||
//if expirationDate == "" {
|
||||
// expirationDate = orderRecordResp.OrderRecord.ExpirationTime
|
||||
//}
|
||||
req.CustomerNum = userInfo.SubNum
|
||||
req.CustomerName = userInfo.Name
|
||||
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
|
||||
req.Source = 2
|
||||
req.SignedTime = common.GetBeijingTime()
|
||||
req.ExpirationDate = expirationDate
|
||||
//req.SignedTime = common.GetBeijingTime()
|
||||
//req.ExpirationDate = expirationDate
|
||||
req.AddPriceOptionsList = addPriceList
|
||||
req.OrderUUID = orderRecordResp.OrderRecord.Uuid
|
||||
// 当前 未将 签名 写入合同中
|
||||
signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, totalAmount, expirationDate)
|
||||
if signContractErr != nil {
|
||||
service.Error(c, signContractErr)
|
||||
return
|
||||
}
|
||||
req.SignContract = signContract
|
||||
// 当前 未将 签名 写入合同中 todo 购买增值服务取消签约合同
|
||||
//signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, totalAmount, expirationDate)
|
||||
//if signContractErr != nil {
|
||||
// service.Error(c, signContractErr)
|
||||
// return
|
||||
//}
|
||||
//req.SignContract = signContract
|
||||
// 创建增值服务订单记录
|
||||
res, err := service.BundleProvider.CreateOrderAddRecord(context.Background(), &req)
|
||||
if err != nil {
|
||||
@ -182,6 +183,7 @@ func CreateBundleOrderSignature(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if req.Language == "" {
|
||||
req.Language = c.GetHeader("Accept-Language")
|
||||
service.Error(c, errors.New(common.MissLanguageTypes))
|
||||
return
|
||||
}
|
||||
@ -309,7 +311,7 @@ func CreateBundleOrderSignature(c *gin.Context) {
|
||||
req.SignedTime = common.GetBeijingTime()
|
||||
req.Status = bundleModel.OrderSigned
|
||||
req.AddRecords = addRecords
|
||||
req.ExpirationTime = expirationDay
|
||||
//req.ExpirationTime = expirationDay //过期日期取消 在完成支付是更新
|
||||
req.PayType = 1
|
||||
|
||||
res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req)
|
||||
|
@ -23,7 +23,14 @@ const (
|
||||
ThePackageHasExpired = "当前套餐已过期"
|
||||
ErrorPermanentPackage = "永久套餐无需购买"
|
||||
)
|
||||
const (
|
||||
OrderTypePackage = 1 // 套餐
|
||||
OrderTypeAddon = 2 // 增值服务
|
||||
|
||||
TimeUnitDay = 1
|
||||
TimeUnitMonth = 2
|
||||
TimeUnitYear = 3
|
||||
)
|
||||
const (
|
||||
ErrorExportOrderInfo = "导出订单信息失败"
|
||||
)
|
||||
|
@ -363,7 +363,75 @@ func AntomWebhook(c *gin.Context) {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
//添加余额
|
||||
orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{
|
||||
OrderNo: resp.OutTradeNo,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
//购买套餐
|
||||
switch orderLimit.Type {
|
||||
case common.OrderTypePackage:
|
||||
//如果是购买套餐 1:创建新的余量信息CreateBundleBalance 2 添加扩展记录BundleExtend
|
||||
_, err = service.BundleProvider.CreateBundleBalance(context.Background(), &bundle.CreateBundleBalanceReq{
|
||||
UserId: int32(orderLimit.UserId),
|
||||
OrderUUID: orderLimit.OrderUUID,
|
||||
AccountNumber: orderLimit.AccountNumber,
|
||||
VideoNumber: orderLimit.VideoNumber,
|
||||
ImageNumber: orderLimit.ImageNumber,
|
||||
DataAnalysisNumber: orderLimit.DataNumber,
|
||||
ExpansionPacksNumber: 1,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
case common.OrderTypeAddon:
|
||||
//如果是购买增值服务 1:修改余量信息AddBundleBalance 2 添加扩展记录BundleExtend
|
||||
_, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{
|
||||
UserId: int32(orderLimit.UserId),
|
||||
OrderUUID: orderLimit.OrderUUID,
|
||||
AccountNumber: orderLimit.AccountNumber,
|
||||
VideoNumber: orderLimit.VideoNumber,
|
||||
ImageNumber: orderLimit.ImageNumber,
|
||||
DataAnalysisNumber: orderLimit.DataNumber,
|
||||
ExpansionPacksNumber: 1,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
default:
|
||||
service.Error(c, errors.New("无效的订单类型"))
|
||||
return
|
||||
}
|
||||
var timeUnit uint32
|
||||
switch orderLimit.Unit {
|
||||
case "天":
|
||||
timeUnit = common.TimeUnitDay
|
||||
case "月":
|
||||
timeUnit = common.TimeUnitMonth
|
||||
case "年":
|
||||
timeUnit = common.TimeUnitYear
|
||||
default:
|
||||
timeUnit = 0
|
||||
}
|
||||
_, err = service.BundleProvider.BundleExtend(context.Background(), &bundle.BundleExtendRequest{
|
||||
UserId: int64(orderLimit.UserId),
|
||||
AccountAdditional: uint32(orderLimit.AccountNumber),
|
||||
VideoAdditional: uint32(orderLimit.VideoNumber),
|
||||
ImagesAdditional: uint32(orderLimit.ImageNumber),
|
||||
DataAdditional: uint32(orderLimit.DataNumber),
|
||||
AvailableDurationAdditional: uint32(orderLimit.Duration),
|
||||
TimeUnit: timeUnit,
|
||||
AssociatedorderNumber: resp.OutTradeNo, //增值服务订单号
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
service.Success(c)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user