Subversion Repositories SmartDukaan

Rev

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

Rev 6050 Rev 6094
Line 1359... Line 1359...
1359
     - rechargeType
1359
     - rechargeType
1360
     - deviceNumber
1360
     - deviceNumber
1361
    """
1361
    """
1362
    pass
1362
    pass
1363
 
1363
 
-
 
1364
  def getRechargeOrdersForDevice(self, deviceNumber):
-
 
1365
    """
-
 
1366
    Parameters:
-
 
1367
     - deviceNumber
-
 
1368
    """
-
 
1369
    pass
-
 
1370
 
-
 
1371
  def addAmountToWallet(self, userId, orderId, amount):
-
 
1372
    """
-
 
1373
    Parameters:
-
 
1374
     - userId
-
 
1375
     - orderId
-
 
1376
     - amount
-
 
1377
    """
-
 
1378
    pass
-
 
1379
 
1364
 
1380
 
1365
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1381
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1366
  def __init__(self, iprot, oprot=None):
1382
  def __init__(self, iprot, oprot=None):
1367
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1383
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1368
 
1384
 
Line 6115... Line 6131...
6115
    self._iprot.readMessageEnd()
6131
    self._iprot.readMessageEnd()
6116
    if result.success is not None:
6132
    if result.success is not None:
6117
      return result.success
6133
      return result.success
6118
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getServiceProviderForDevice failed: unknown result");
6134
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getServiceProviderForDevice failed: unknown result");
6119
 
6135
 
-
 
6136
  def getRechargeOrdersForDevice(self, deviceNumber):
-
 
6137
    """
-
 
6138
    Parameters:
-
 
6139
     - deviceNumber
-
 
6140
    """
-
 
6141
    self.send_getRechargeOrdersForDevice(deviceNumber)
-
 
6142
    return self.recv_getRechargeOrdersForDevice()
-
 
6143
 
-
 
6144
  def send_getRechargeOrdersForDevice(self, deviceNumber):
-
 
6145
    self._oprot.writeMessageBegin('getRechargeOrdersForDevice', TMessageType.CALL, self._seqid)
-
 
6146
    args = getRechargeOrdersForDevice_args()
-
 
6147
    args.deviceNumber = deviceNumber
-
 
6148
    args.write(self._oprot)
-
 
6149
    self._oprot.writeMessageEnd()
-
 
6150
    self._oprot.trans.flush()
-
 
6151
 
-
 
6152
  def recv_getRechargeOrdersForDevice(self, ):
-
 
6153
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
6154
    if mtype == TMessageType.EXCEPTION:
-
 
6155
      x = TApplicationException()
-
 
6156
      x.read(self._iprot)
-
 
6157
      self._iprot.readMessageEnd()
-
 
6158
      raise x
-
 
6159
    result = getRechargeOrdersForDevice_result()
-
 
6160
    result.read(self._iprot)
-
 
6161
    self._iprot.readMessageEnd()
-
 
6162
    if result.success is not None:
-
 
6163
      return result.success
-
 
6164
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getRechargeOrdersForDevice failed: unknown result");
-
 
6165
 
-
 
6166
  def addAmountToWallet(self, userId, orderId, amount):
-
 
6167
    """
-
 
6168
    Parameters:
-
 
6169
     - userId
-
 
6170
     - orderId
-
 
6171
     - amount
-
 
6172
    """
-
 
6173
    self.send_addAmountToWallet(userId, orderId, amount)
-
 
6174
    self.recv_addAmountToWallet()
-
 
6175
 
-
 
6176
  def send_addAmountToWallet(self, userId, orderId, amount):
-
 
6177
    self._oprot.writeMessageBegin('addAmountToWallet', TMessageType.CALL, self._seqid)
-
 
6178
    args = addAmountToWallet_args()
-
 
6179
    args.userId = userId
-
 
6180
    args.orderId = orderId
-
 
6181
    args.amount = amount
-
 
6182
    args.write(self._oprot)
-
 
6183
    self._oprot.writeMessageEnd()
-
 
6184
    self._oprot.trans.flush()
-
 
6185
 
-
 
6186
  def recv_addAmountToWallet(self, ):
-
 
6187
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
6188
    if mtype == TMessageType.EXCEPTION:
-
 
6189
      x = TApplicationException()
-
 
6190
      x.read(self._iprot)
-
 
6191
      self._iprot.readMessageEnd()
-
 
6192
      raise x
-
 
6193
    result = addAmountToWallet_result()
-
 
6194
    result.read(self._iprot)
-
 
6195
    self._iprot.readMessageEnd()
-
 
6196
    return
-
 
6197
 
6120
 
6198
 
6121
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
6199
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
6122
  def __init__(self, handler):
6200
  def __init__(self, handler):
6123
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
6201
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
6124
    self._processMap["createTransaction"] = Processor.process_createTransaction
6202
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 6256... Line 6334...
6256
    self._processMap["getUserWallet"] = Processor.process_getUserWallet
6334
    self._processMap["getUserWallet"] = Processor.process_getUserWallet
6257
    self._processMap["getUserWalletHistory"] = Processor.process_getUserWalletHistory
6335
    self._processMap["getUserWalletHistory"] = Processor.process_getUserWalletHistory
6258
    self._processMap["getRechargeOrdersForTransaction"] = Processor.process_getRechargeOrdersForTransaction
6336
    self._processMap["getRechargeOrdersForTransaction"] = Processor.process_getRechargeOrdersForTransaction
6259
    self._processMap["getServiceProviders"] = Processor.process_getServiceProviders
6337
    self._processMap["getServiceProviders"] = Processor.process_getServiceProviders
6260
    self._processMap["getServiceProviderForDevice"] = Processor.process_getServiceProviderForDevice
6338
    self._processMap["getServiceProviderForDevice"] = Processor.process_getServiceProviderForDevice
-
 
6339
    self._processMap["getRechargeOrdersForDevice"] = Processor.process_getRechargeOrdersForDevice
-
 
6340
    self._processMap["addAmountToWallet"] = Processor.process_addAmountToWallet
6261
 
6341
 
6262
  def process(self, iprot, oprot):
6342
  def process(self, iprot, oprot):
6263
    (name, type, seqid) = iprot.readMessageBegin()
6343
    (name, type, seqid) = iprot.readMessageBegin()
6264
    if name not in self._processMap:
6344
    if name not in self._processMap:
6265
      iprot.skip(TType.STRUCT)
6345
      iprot.skip(TType.STRUCT)
Line 8067... Line 8147...
8067
    oprot.writeMessageBegin("getServiceProviderForDevice", TMessageType.REPLY, seqid)
8147
    oprot.writeMessageBegin("getServiceProviderForDevice", TMessageType.REPLY, seqid)
8068
    result.write(oprot)
8148
    result.write(oprot)
8069
    oprot.writeMessageEnd()
8149
    oprot.writeMessageEnd()
8070
    oprot.trans.flush()
8150
    oprot.trans.flush()
8071
 
8151
 
-
 
8152
  def process_getRechargeOrdersForDevice(self, seqid, iprot, oprot):
-
 
8153
    args = getRechargeOrdersForDevice_args()
-
 
8154
    args.read(iprot)
-
 
8155
    iprot.readMessageEnd()
-
 
8156
    result = getRechargeOrdersForDevice_result()
-
 
8157
    result.success = self._handler.getRechargeOrdersForDevice(args.deviceNumber)
-
 
8158
    oprot.writeMessageBegin("getRechargeOrdersForDevice", TMessageType.REPLY, seqid)
-
 
8159
    result.write(oprot)
-
 
8160
    oprot.writeMessageEnd()
-
 
8161
    oprot.trans.flush()
-
 
8162
 
-
 
8163
  def process_addAmountToWallet(self, seqid, iprot, oprot):
-
 
8164
    args = addAmountToWallet_args()
-
 
8165
    args.read(iprot)
-
 
8166
    iprot.readMessageEnd()
-
 
8167
    result = addAmountToWallet_result()
-
 
8168
    self._handler.addAmountToWallet(args.userId, args.orderId, args.amount)
-
 
8169
    oprot.writeMessageBegin("addAmountToWallet", TMessageType.REPLY, seqid)
-
 
8170
    result.write(oprot)
-
 
8171
    oprot.writeMessageEnd()
-
 
8172
    oprot.trans.flush()
-
 
8173
 
8072
 
8174
 
8073
# HELPER FUNCTIONS AND STRUCTURES
8175
# HELPER FUNCTIONS AND STRUCTURES
8074
 
8176
 
8075
class createTransaction_args:
8177
class createTransaction_args:
8076
  """
8178
  """
Line 27423... Line 27525...
27423
    oprot.writeFieldStop()
27525
    oprot.writeFieldStop()
27424
    oprot.writeStructEnd()
27526
    oprot.writeStructEnd()
27425
 
27527
 
27426
  def validate(self):
27528
  def validate(self):
27427
    return
27529
    return
-
 
27530
 
-
 
27531
 
-
 
27532
  def __repr__(self):
-
 
27533
    L = ['%s=%r' % (key, value)
-
 
27534
      for key, value in self.__dict__.iteritems()]
-
 
27535
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
27536
 
-
 
27537
  def __eq__(self, other):
-
 
27538
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
27539
 
-
 
27540
  def __ne__(self, other):
-
 
27541
    return not (self == other)
-
 
27542
 
-
 
27543
class getRechargeOrdersForDevice_args:
-
 
27544
  """
-
 
27545
  Attributes:
-
 
27546
   - deviceNumber
-
 
27547
  """
-
 
27548
 
-
 
27549
  thrift_spec = (
-
 
27550
    None, # 0
-
 
27551
    (1, TType.STRING, 'deviceNumber', None, None, ), # 1
-
 
27552
  )
-
 
27553
 
-
 
27554
  def __init__(self, deviceNumber=None,):
-
 
27555
    self.deviceNumber = deviceNumber
-
 
27556
 
-
 
27557
  def read(self, iprot):
-
 
27558
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27559
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27560
      return
-
 
27561
    iprot.readStructBegin()
-
 
27562
    while True:
-
 
27563
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27564
      if ftype == TType.STOP:
-
 
27565
        break
-
 
27566
      if fid == 1:
-
 
27567
        if ftype == TType.STRING:
-
 
27568
          self.deviceNumber = iprot.readString();
-
 
27569
        else:
-
 
27570
          iprot.skip(ftype)
-
 
27571
      else:
-
 
27572
        iprot.skip(ftype)
-
 
27573
      iprot.readFieldEnd()
-
 
27574
    iprot.readStructEnd()
-
 
27575
 
-
 
27576
  def write(self, oprot):
-
 
27577
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27578
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27579
      return
-
 
27580
    oprot.writeStructBegin('getRechargeOrdersForDevice_args')
-
 
27581
    if self.deviceNumber is not None:
-
 
27582
      oprot.writeFieldBegin('deviceNumber', TType.STRING, 1)
-
 
27583
      oprot.writeString(self.deviceNumber)
-
 
27584
      oprot.writeFieldEnd()
-
 
27585
    oprot.writeFieldStop()
-
 
27586
    oprot.writeStructEnd()
-
 
27587
 
-
 
27588
  def validate(self):
-
 
27589
    return
-
 
27590
 
-
 
27591
 
-
 
27592
  def __repr__(self):
-
 
27593
    L = ['%s=%r' % (key, value)
-
 
27594
      for key, value in self.__dict__.iteritems()]
-
 
27595
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
27596
 
-
 
27597
  def __eq__(self, other):
-
 
27598
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
27599
 
-
 
27600
  def __ne__(self, other):
-
 
27601
    return not (self == other)
-
 
27602
 
-
 
27603
class getRechargeOrdersForDevice_result:
-
 
27604
  """
-
 
27605
  Attributes:
-
 
27606
   - success
-
 
27607
  """
-
 
27608
 
-
 
27609
  thrift_spec = (
-
 
27610
    (0, TType.LIST, 'success', (TType.STRUCT,(RechargeOrder, RechargeOrder.thrift_spec)), None, ), # 0
-
 
27611
  )
-
 
27612
 
-
 
27613
  def __init__(self, success=None,):
-
 
27614
    self.success = success
-
 
27615
 
-
 
27616
  def read(self, iprot):
-
 
27617
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27618
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27619
      return
-
 
27620
    iprot.readStructBegin()
-
 
27621
    while True:
-
 
27622
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27623
      if ftype == TType.STOP:
-
 
27624
        break
-
 
27625
      if fid == 0:
-
 
27626
        if ftype == TType.LIST:
-
 
27627
          self.success = []
-
 
27628
          (_etype639, _size636) = iprot.readListBegin()
-
 
27629
          for _i640 in xrange(_size636):
-
 
27630
            _elem641 = RechargeOrder()
-
 
27631
            _elem641.read(iprot)
-
 
27632
            self.success.append(_elem641)
-
 
27633
          iprot.readListEnd()
-
 
27634
        else:
-
 
27635
          iprot.skip(ftype)
-
 
27636
      else:
-
 
27637
        iprot.skip(ftype)
-
 
27638
      iprot.readFieldEnd()
-
 
27639
    iprot.readStructEnd()
-
 
27640
 
-
 
27641
  def write(self, oprot):
-
 
27642
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27643
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27644
      return
-
 
27645
    oprot.writeStructBegin('getRechargeOrdersForDevice_result')
-
 
27646
    if self.success is not None:
-
 
27647
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
27648
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
27649
      for iter642 in self.success:
-
 
27650
        iter642.write(oprot)
-
 
27651
      oprot.writeListEnd()
-
 
27652
      oprot.writeFieldEnd()
-
 
27653
    oprot.writeFieldStop()
-
 
27654
    oprot.writeStructEnd()
-
 
27655
 
-
 
27656
  def validate(self):
-
 
27657
    return
-
 
27658
 
-
 
27659
 
-
 
27660
  def __repr__(self):
-
 
27661
    L = ['%s=%r' % (key, value)
-
 
27662
      for key, value in self.__dict__.iteritems()]
-
 
27663
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
27664
 
-
 
27665
  def __eq__(self, other):
-
 
27666
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
27667
 
-
 
27668
  def __ne__(self, other):
-
 
27669
    return not (self == other)
-
 
27670
 
-
 
27671
class addAmountToWallet_args:
-
 
27672
  """
-
 
27673
  Attributes:
-
 
27674
   - userId
-
 
27675
   - orderId
-
 
27676
   - amount
-
 
27677
  """
-
 
27678
 
-
 
27679
  thrift_spec = (
-
 
27680
    None, # 0
-
 
27681
    (1, TType.I64, 'userId', None, None, ), # 1
-
 
27682
    (2, TType.I64, 'orderId', None, None, ), # 2
-
 
27683
    (3, TType.I64, 'amount', None, None, ), # 3
-
 
27684
  )
-
 
27685
 
-
 
27686
  def __init__(self, userId=None, orderId=None, amount=None,):
-
 
27687
    self.userId = userId
-
 
27688
    self.orderId = orderId
-
 
27689
    self.amount = amount
-
 
27690
 
-
 
27691
  def read(self, iprot):
-
 
27692
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27693
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27694
      return
-
 
27695
    iprot.readStructBegin()
-
 
27696
    while True:
-
 
27697
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27698
      if ftype == TType.STOP:
-
 
27699
        break
-
 
27700
      if fid == 1:
-
 
27701
        if ftype == TType.I64:
-
 
27702
          self.userId = iprot.readI64();
-
 
27703
        else:
-
 
27704
          iprot.skip(ftype)
-
 
27705
      elif fid == 2:
-
 
27706
        if ftype == TType.I64:
-
 
27707
          self.orderId = iprot.readI64();
-
 
27708
        else:
-
 
27709
          iprot.skip(ftype)
-
 
27710
      elif fid == 3:
-
 
27711
        if ftype == TType.I64:
-
 
27712
          self.amount = iprot.readI64();
-
 
27713
        else:
-
 
27714
          iprot.skip(ftype)
-
 
27715
      else:
-
 
27716
        iprot.skip(ftype)
-
 
27717
      iprot.readFieldEnd()
-
 
27718
    iprot.readStructEnd()
-
 
27719
 
-
 
27720
  def write(self, oprot):
-
 
27721
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27722
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27723
      return
-
 
27724
    oprot.writeStructBegin('addAmountToWallet_args')
-
 
27725
    if self.userId is not None:
-
 
27726
      oprot.writeFieldBegin('userId', TType.I64, 1)
-
 
27727
      oprot.writeI64(self.userId)
-
 
27728
      oprot.writeFieldEnd()
-
 
27729
    if self.orderId is not None:
-
 
27730
      oprot.writeFieldBegin('orderId', TType.I64, 2)
-
 
27731
      oprot.writeI64(self.orderId)
-
 
27732
      oprot.writeFieldEnd()
-
 
27733
    if self.amount is not None:
-
 
27734
      oprot.writeFieldBegin('amount', TType.I64, 3)
-
 
27735
      oprot.writeI64(self.amount)
-
 
27736
      oprot.writeFieldEnd()
-
 
27737
    oprot.writeFieldStop()
-
 
27738
    oprot.writeStructEnd()
-
 
27739
 
-
 
27740
  def validate(self):
-
 
27741
    return
-
 
27742
 
-
 
27743
 
-
 
27744
  def __repr__(self):
-
 
27745
    L = ['%s=%r' % (key, value)
-
 
27746
      for key, value in self.__dict__.iteritems()]
-
 
27747
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
27748
 
-
 
27749
  def __eq__(self, other):
-
 
27750
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
27751
 
-
 
27752
  def __ne__(self, other):
-
 
27753
    return not (self == other)
-
 
27754
 
-
 
27755
class addAmountToWallet_result:
-
 
27756
 
-
 
27757
  thrift_spec = (
-
 
27758
  )
-
 
27759
 
-
 
27760
  def read(self, iprot):
-
 
27761
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27762
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27763
      return
-
 
27764
    iprot.readStructBegin()
-
 
27765
    while True:
-
 
27766
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27767
      if ftype == TType.STOP:
-
 
27768
        break
-
 
27769
      else:
-
 
27770
        iprot.skip(ftype)
-
 
27771
      iprot.readFieldEnd()
-
 
27772
    iprot.readStructEnd()
-
 
27773
 
-
 
27774
  def write(self, oprot):
-
 
27775
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27776
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27777
      return
-
 
27778
    oprot.writeStructBegin('addAmountToWallet_result')
-
 
27779
    oprot.writeFieldStop()
-
 
27780
    oprot.writeStructEnd()
-
 
27781
 
-
 
27782
  def validate(self):
-
 
27783
    return
27428
 
27784
 
27429
 
27785
 
27430
  def __repr__(self):
27786
  def __repr__(self):
27431
    L = ['%s=%r' % (key, value)
27787
    L = ['%s=%r' % (key, value)
27432
      for key, value in self.__dict__.iteritems()]
27788
      for key, value in self.__dict__.iteritems()]