Subversion Repositories SmartDukaan

Rev

Rev 5944 | Rev 6512 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5944 Rev 6039
Line 503... Line 503...
503
    Parameters:
503
    Parameters:
504
     - catalog_item_id
504
     - catalog_item_id
505
    """
505
    """
506
    pass
506
    pass
507
 
507
 
-
 
508
  def getVatPercentageForItem(self, itemId, price):
-
 
509
    """
-
 
510
    Parameters:
-
 
511
     - itemId
-
 
512
     - price
-
 
513
    """
-
 
514
    pass
-
 
515
 
-
 
516
  def getVatAmountForItem(self, itemId, price):
-
 
517
    """
-
 
518
    Parameters:
-
 
519
     - itemId
-
 
520
     - price
-
 
521
    """
-
 
522
    pass
-
 
523
 
508
 
524
 
509
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
525
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
510
  def __init__(self, iprot, oprot=None):
526
  def __init__(self, iprot, oprot=None):
511
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
527
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
512
 
528
 
Line 2490... Line 2506...
2490
    self._iprot.readMessageEnd()
2506
    self._iprot.readMessageEnd()
2491
    if result.success is not None:
2507
    if result.success is not None:
2492
      return result.success
2508
      return result.success
2493
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isValidCatalogItemId failed: unknown result");
2509
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isValidCatalogItemId failed: unknown result");
2494
 
2510
 
-
 
2511
  def getVatPercentageForItem(self, itemId, price):
-
 
2512
    """
-
 
2513
    Parameters:
-
 
2514
     - itemId
-
 
2515
     - price
-
 
2516
    """
-
 
2517
    self.send_getVatPercentageForItem(itemId, price)
-
 
2518
    return self.recv_getVatPercentageForItem()
-
 
2519
 
-
 
2520
  def send_getVatPercentageForItem(self, itemId, price):
-
 
2521
    self._oprot.writeMessageBegin('getVatPercentageForItem', TMessageType.CALL, self._seqid)
-
 
2522
    args = getVatPercentageForItem_args()
-
 
2523
    args.itemId = itemId
-
 
2524
    args.price = price
-
 
2525
    args.write(self._oprot)
-
 
2526
    self._oprot.writeMessageEnd()
-
 
2527
    self._oprot.trans.flush()
-
 
2528
 
-
 
2529
  def recv_getVatPercentageForItem(self, ):
-
 
2530
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2531
    if mtype == TMessageType.EXCEPTION:
-
 
2532
      x = TApplicationException()
-
 
2533
      x.read(self._iprot)
-
 
2534
      self._iprot.readMessageEnd()
-
 
2535
      raise x
-
 
2536
    result = getVatPercentageForItem_result()
-
 
2537
    result.read(self._iprot)
-
 
2538
    self._iprot.readMessageEnd()
-
 
2539
    if result.success is not None:
-
 
2540
      return result.success
-
 
2541
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getVatPercentageForItem failed: unknown result");
-
 
2542
 
-
 
2543
  def getVatAmountForItem(self, itemId, price):
-
 
2544
    """
-
 
2545
    Parameters:
-
 
2546
     - itemId
-
 
2547
     - price
-
 
2548
    """
-
 
2549
    self.send_getVatAmountForItem(itemId, price)
-
 
2550
    return self.recv_getVatAmountForItem()
-
 
2551
 
-
 
2552
  def send_getVatAmountForItem(self, itemId, price):
-
 
2553
    self._oprot.writeMessageBegin('getVatAmountForItem', TMessageType.CALL, self._seqid)
-
 
2554
    args = getVatAmountForItem_args()
-
 
2555
    args.itemId = itemId
-
 
2556
    args.price = price
-
 
2557
    args.write(self._oprot)
-
 
2558
    self._oprot.writeMessageEnd()
-
 
2559
    self._oprot.trans.flush()
-
 
2560
 
-
 
2561
  def recv_getVatAmountForItem(self, ):
-
 
2562
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2563
    if mtype == TMessageType.EXCEPTION:
-
 
2564
      x = TApplicationException()
-
 
2565
      x.read(self._iprot)
-
 
2566
      self._iprot.readMessageEnd()
-
 
2567
      raise x
-
 
2568
    result = getVatAmountForItem_result()
-
 
2569
    result.read(self._iprot)
-
 
2570
    self._iprot.readMessageEnd()
-
 
2571
    if result.success is not None:
-
 
2572
      return result.success
-
 
2573
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getVatAmountForItem failed: unknown result");
-
 
2574
 
2495
 
2575
 
2496
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2576
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2497
  def __init__(self, handler):
2577
  def __init__(self, handler):
2498
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2578
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2499
    self._processMap["addItem"] = Processor.process_addItem
2579
    self._processMap["addItem"] = Processor.process_addItem
Line 2555... Line 2635...
2555
    self._processMap["addupdateVoucherForItem"] = Processor.process_addupdateVoucherForItem
2635
    self._processMap["addupdateVoucherForItem"] = Processor.process_addupdateVoucherForItem
2556
    self._processMap["deleteVoucherForItem"] = Processor.process_deleteVoucherForItem
2636
    self._processMap["deleteVoucherForItem"] = Processor.process_deleteVoucherForItem
2557
    self._processMap["getVoucherAmount"] = Processor.process_getVoucherAmount
2637
    self._processMap["getVoucherAmount"] = Processor.process_getVoucherAmount
2558
    self._processMap["getAllItemVouchers"] = Processor.process_getAllItemVouchers
2638
    self._processMap["getAllItemVouchers"] = Processor.process_getAllItemVouchers
2559
    self._processMap["isValidCatalogItemId"] = Processor.process_isValidCatalogItemId
2639
    self._processMap["isValidCatalogItemId"] = Processor.process_isValidCatalogItemId
-
 
2640
    self._processMap["getVatPercentageForItem"] = Processor.process_getVatPercentageForItem
-
 
2641
    self._processMap["getVatAmountForItem"] = Processor.process_getVatAmountForItem
2560
 
2642
 
2561
  def process(self, iprot, oprot):
2643
  def process(self, iprot, oprot):
2562
    (name, type, seqid) = iprot.readMessageBegin()
2644
    (name, type, seqid) = iprot.readMessageBegin()
2563
    if name not in self._processMap:
2645
    if name not in self._processMap:
2564
      iprot.skip(TType.STRUCT)
2646
      iprot.skip(TType.STRUCT)
Line 3353... Line 3435...
3353
    oprot.writeMessageBegin("isValidCatalogItemId", TMessageType.REPLY, seqid)
3435
    oprot.writeMessageBegin("isValidCatalogItemId", TMessageType.REPLY, seqid)
3354
    result.write(oprot)
3436
    result.write(oprot)
3355
    oprot.writeMessageEnd()
3437
    oprot.writeMessageEnd()
3356
    oprot.trans.flush()
3438
    oprot.trans.flush()
3357
 
3439
 
-
 
3440
  def process_getVatPercentageForItem(self, seqid, iprot, oprot):
-
 
3441
    args = getVatPercentageForItem_args()
-
 
3442
    args.read(iprot)
-
 
3443
    iprot.readMessageEnd()
-
 
3444
    result = getVatPercentageForItem_result()
-
 
3445
    result.success = self._handler.getVatPercentageForItem(args.itemId, args.price)
-
 
3446
    oprot.writeMessageBegin("getVatPercentageForItem", TMessageType.REPLY, seqid)
-
 
3447
    result.write(oprot)
-
 
3448
    oprot.writeMessageEnd()
-
 
3449
    oprot.trans.flush()
-
 
3450
 
-
 
3451
  def process_getVatAmountForItem(self, seqid, iprot, oprot):
-
 
3452
    args = getVatAmountForItem_args()
-
 
3453
    args.read(iprot)
-
 
3454
    iprot.readMessageEnd()
-
 
3455
    result = getVatAmountForItem_result()
-
 
3456
    result.success = self._handler.getVatAmountForItem(args.itemId, args.price)
-
 
3457
    oprot.writeMessageBegin("getVatAmountForItem", TMessageType.REPLY, seqid)
-
 
3458
    result.write(oprot)
-
 
3459
    oprot.writeMessageEnd()
-
 
3460
    oprot.trans.flush()
-
 
3461
 
3358
 
3462
 
3359
# HELPER FUNCTIONS AND STRUCTURES
3463
# HELPER FUNCTIONS AND STRUCTURES
3360
 
3464
 
3361
class addItem_args:
3465
class addItem_args:
3362
  """
3466
  """
Line 11535... Line 11639...
11535
      oprot.writeFieldEnd()
11639
      oprot.writeFieldEnd()
11536
    oprot.writeFieldStop()
11640
    oprot.writeFieldStop()
11537
    oprot.writeStructEnd()
11641
    oprot.writeStructEnd()
11538
 
11642
 
11539
  def validate(self):
11643
  def validate(self):
-
 
11644
    return
-
 
11645
 
-
 
11646
 
-
 
11647
  def __repr__(self):
-
 
11648
    L = ['%s=%r' % (key, value)
-
 
11649
      for key, value in self.__dict__.iteritems()]
-
 
11650
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11651
 
-
 
11652
  def __eq__(self, other):
-
 
11653
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11654
 
-
 
11655
  def __ne__(self, other):
-
 
11656
    return not (self == other)
-
 
11657
 
-
 
11658
class getVatPercentageForItem_args:
-
 
11659
  """
-
 
11660
  Attributes:
-
 
11661
   - itemId
-
 
11662
   - price
-
 
11663
  """
-
 
11664
 
-
 
11665
  thrift_spec = (
-
 
11666
    None, # 0
-
 
11667
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
11668
    (2, TType.DOUBLE, 'price', None, None, ), # 2
-
 
11669
  )
-
 
11670
 
-
 
11671
  def __init__(self, itemId=None, price=None,):
-
 
11672
    self.itemId = itemId
-
 
11673
    self.price = price
-
 
11674
 
-
 
11675
  def read(self, iprot):
-
 
11676
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11677
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11678
      return
-
 
11679
    iprot.readStructBegin()
-
 
11680
    while True:
-
 
11681
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11682
      if ftype == TType.STOP:
-
 
11683
        break
-
 
11684
      if fid == 1:
-
 
11685
        if ftype == TType.I64:
-
 
11686
          self.itemId = iprot.readI64();
-
 
11687
        else:
-
 
11688
          iprot.skip(ftype)
-
 
11689
      elif fid == 2:
-
 
11690
        if ftype == TType.DOUBLE:
-
 
11691
          self.price = iprot.readDouble();
-
 
11692
        else:
-
 
11693
          iprot.skip(ftype)
-
 
11694
      else:
-
 
11695
        iprot.skip(ftype)
-
 
11696
      iprot.readFieldEnd()
-
 
11697
    iprot.readStructEnd()
-
 
11698
 
-
 
11699
  def write(self, oprot):
-
 
11700
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11701
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11702
      return
-
 
11703
    oprot.writeStructBegin('getVatPercentageForItem_args')
-
 
11704
    if self.itemId is not None:
-
 
11705
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
11706
      oprot.writeI64(self.itemId)
-
 
11707
      oprot.writeFieldEnd()
-
 
11708
    if self.price is not None:
-
 
11709
      oprot.writeFieldBegin('price', TType.DOUBLE, 2)
-
 
11710
      oprot.writeDouble(self.price)
-
 
11711
      oprot.writeFieldEnd()
-
 
11712
    oprot.writeFieldStop()
-
 
11713
    oprot.writeStructEnd()
-
 
11714
 
-
 
11715
  def validate(self):
-
 
11716
    return
-
 
11717
 
-
 
11718
 
-
 
11719
  def __repr__(self):
-
 
11720
    L = ['%s=%r' % (key, value)
-
 
11721
      for key, value in self.__dict__.iteritems()]
-
 
11722
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11723
 
-
 
11724
  def __eq__(self, other):
-
 
11725
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11726
 
-
 
11727
  def __ne__(self, other):
-
 
11728
    return not (self == other)
-
 
11729
 
-
 
11730
class getVatPercentageForItem_result:
-
 
11731
  """
-
 
11732
  Attributes:
-
 
11733
   - success
-
 
11734
  """
-
 
11735
 
-
 
11736
  thrift_spec = (
-
 
11737
    (0, TType.DOUBLE, 'success', None, None, ), # 0
-
 
11738
  )
-
 
11739
 
-
 
11740
  def __init__(self, success=None,):
-
 
11741
    self.success = success
-
 
11742
 
-
 
11743
  def read(self, iprot):
-
 
11744
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11745
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11746
      return
-
 
11747
    iprot.readStructBegin()
-
 
11748
    while True:
-
 
11749
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11750
      if ftype == TType.STOP:
-
 
11751
        break
-
 
11752
      if fid == 0:
-
 
11753
        if ftype == TType.DOUBLE:
-
 
11754
          self.success = iprot.readDouble();
-
 
11755
        else:
-
 
11756
          iprot.skip(ftype)
-
 
11757
      else:
-
 
11758
        iprot.skip(ftype)
-
 
11759
      iprot.readFieldEnd()
-
 
11760
    iprot.readStructEnd()
-
 
11761
 
-
 
11762
  def write(self, oprot):
-
 
11763
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11764
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11765
      return
-
 
11766
    oprot.writeStructBegin('getVatPercentageForItem_result')
-
 
11767
    if self.success is not None:
-
 
11768
      oprot.writeFieldBegin('success', TType.DOUBLE, 0)
-
 
11769
      oprot.writeDouble(self.success)
-
 
11770
      oprot.writeFieldEnd()
-
 
11771
    oprot.writeFieldStop()
-
 
11772
    oprot.writeStructEnd()
-
 
11773
 
-
 
11774
  def validate(self):
-
 
11775
    return
-
 
11776
 
-
 
11777
 
-
 
11778
  def __repr__(self):
-
 
11779
    L = ['%s=%r' % (key, value)
-
 
11780
      for key, value in self.__dict__.iteritems()]
-
 
11781
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11782
 
-
 
11783
  def __eq__(self, other):
-
 
11784
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11785
 
-
 
11786
  def __ne__(self, other):
-
 
11787
    return not (self == other)
-
 
11788
 
-
 
11789
class getVatAmountForItem_args:
-
 
11790
  """
-
 
11791
  Attributes:
-
 
11792
   - itemId
-
 
11793
   - price
-
 
11794
  """
-
 
11795
 
-
 
11796
  thrift_spec = (
-
 
11797
    None, # 0
-
 
11798
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
11799
    (2, TType.DOUBLE, 'price', None, None, ), # 2
-
 
11800
  )
-
 
11801
 
-
 
11802
  def __init__(self, itemId=None, price=None,):
-
 
11803
    self.itemId = itemId
-
 
11804
    self.price = price
-
 
11805
 
-
 
11806
  def read(self, iprot):
-
 
11807
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11808
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11809
      return
-
 
11810
    iprot.readStructBegin()
-
 
11811
    while True:
-
 
11812
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11813
      if ftype == TType.STOP:
-
 
11814
        break
-
 
11815
      if fid == 1:
-
 
11816
        if ftype == TType.I64:
-
 
11817
          self.itemId = iprot.readI64();
-
 
11818
        else:
-
 
11819
          iprot.skip(ftype)
-
 
11820
      elif fid == 2:
-
 
11821
        if ftype == TType.DOUBLE:
-
 
11822
          self.price = iprot.readDouble();
-
 
11823
        else:
-
 
11824
          iprot.skip(ftype)
-
 
11825
      else:
-
 
11826
        iprot.skip(ftype)
-
 
11827
      iprot.readFieldEnd()
-
 
11828
    iprot.readStructEnd()
-
 
11829
 
-
 
11830
  def write(self, oprot):
-
 
11831
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11832
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11833
      return
-
 
11834
    oprot.writeStructBegin('getVatAmountForItem_args')
-
 
11835
    if self.itemId is not None:
-
 
11836
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
11837
      oprot.writeI64(self.itemId)
-
 
11838
      oprot.writeFieldEnd()
-
 
11839
    if self.price is not None:
-
 
11840
      oprot.writeFieldBegin('price', TType.DOUBLE, 2)
-
 
11841
      oprot.writeDouble(self.price)
-
 
11842
      oprot.writeFieldEnd()
-
 
11843
    oprot.writeFieldStop()
-
 
11844
    oprot.writeStructEnd()
-
 
11845
 
-
 
11846
  def validate(self):
-
 
11847
    return
-
 
11848
 
-
 
11849
 
-
 
11850
  def __repr__(self):
-
 
11851
    L = ['%s=%r' % (key, value)
-
 
11852
      for key, value in self.__dict__.iteritems()]
-
 
11853
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11854
 
-
 
11855
  def __eq__(self, other):
-
 
11856
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11857
 
-
 
11858
  def __ne__(self, other):
-
 
11859
    return not (self == other)
-
 
11860
 
-
 
11861
class getVatAmountForItem_result:
-
 
11862
  """
-
 
11863
  Attributes:
-
 
11864
   - success
-
 
11865
  """
-
 
11866
 
-
 
11867
  thrift_spec = (
-
 
11868
    (0, TType.DOUBLE, 'success', None, None, ), # 0
-
 
11869
  )
-
 
11870
 
-
 
11871
  def __init__(self, success=None,):
-
 
11872
    self.success = success
-
 
11873
 
-
 
11874
  def read(self, iprot):
-
 
11875
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11876
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11877
      return
-
 
11878
    iprot.readStructBegin()
-
 
11879
    while True:
-
 
11880
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11881
      if ftype == TType.STOP:
-
 
11882
        break
-
 
11883
      if fid == 0:
-
 
11884
        if ftype == TType.DOUBLE:
-
 
11885
          self.success = iprot.readDouble();
-
 
11886
        else:
-
 
11887
          iprot.skip(ftype)
-
 
11888
      else:
-
 
11889
        iprot.skip(ftype)
-
 
11890
      iprot.readFieldEnd()
-
 
11891
    iprot.readStructEnd()
-
 
11892
 
-
 
11893
  def write(self, oprot):
-
 
11894
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11895
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11896
      return
-
 
11897
    oprot.writeStructBegin('getVatAmountForItem_result')
-
 
11898
    if self.success is not None:
-
 
11899
      oprot.writeFieldBegin('success', TType.DOUBLE, 0)
-
 
11900
      oprot.writeDouble(self.success)
-
 
11901
      oprot.writeFieldEnd()
-
 
11902
    oprot.writeFieldStop()
-
 
11903
    oprot.writeStructEnd()
-
 
11904
 
-
 
11905
  def validate(self):
11540
    return
11906
    return
11541
 
11907
 
11542
 
11908
 
11543
  def __repr__(self):
11909
  def __repr__(self):
11544
    L = ['%s=%r' % (key, value)
11910
    L = ['%s=%r' % (key, value)