Subversion Repositories SmartDukaan

Rev

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

Rev 21101 Rev 21535
Line 2779... Line 2779...
2779
    Parameters:
2779
    Parameters:
2780
     - associateEmail
2780
     - associateEmail
2781
    """
2781
    """
2782
    pass
2782
    pass
2783
 
2783
 
2784
  def creditUserWallet(self, userId, amount):
2784
  def creditUserWallet(self, userId, amount, cash_back):
2785
    """
2785
    """
2786
    Parameters:
2786
    Parameters:
2787
     - userId
2787
     - userId
2788
     - amount
2788
     - amount
-
 
2789
     - cash_back
-
 
2790
    """
-
 
2791
    pass
-
 
2792
 
-
 
2793
  def getPaginatedRechargeOrders(self, userId, offset, limit):
-
 
2794
    """
-
 
2795
    Parameters:
-
 
2796
     - userId
-
 
2797
     - offset
-
 
2798
     - limit
2789
    """
2799
    """
2790
    pass
2800
    pass
2791
 
2801
 
2792
 
2802
 
2793
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
2803
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
Line 13356... Line 13366...
13356
    self._iprot.readMessageEnd()
13366
    self._iprot.readMessageEnd()
13357
    if result.success is not None:
13367
    if result.success is not None:
13358
      return result.success
13368
      return result.success
13359
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getmypmsaprofile failed: unknown result");
13369
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getmypmsaprofile failed: unknown result");
13360
 
13370
 
13361
  def creditUserWallet(self, userId, amount):
13371
  def creditUserWallet(self, userId, amount, cash_back):
13362
    """
13372
    """
13363
    Parameters:
13373
    Parameters:
13364
     - userId
13374
     - userId
13365
     - amount
13375
     - amount
-
 
13376
     - cash_back
13366
    """
13377
    """
13367
    self.send_creditUserWallet(userId, amount)
13378
    self.send_creditUserWallet(userId, amount, cash_back)
13368
    return self.recv_creditUserWallet()
13379
    return self.recv_creditUserWallet()
13369
 
13380
 
13370
  def send_creditUserWallet(self, userId, amount):
13381
  def send_creditUserWallet(self, userId, amount, cash_back):
13371
    self._oprot.writeMessageBegin('creditUserWallet', TMessageType.CALL, self._seqid)
13382
    self._oprot.writeMessageBegin('creditUserWallet', TMessageType.CALL, self._seqid)
13372
    args = creditUserWallet_args()
13383
    args = creditUserWallet_args()
13373
    args.userId = userId
13384
    args.userId = userId
13374
    args.amount = amount
13385
    args.amount = amount
-
 
13386
    args.cash_back = cash_back
13375
    args.write(self._oprot)
13387
    args.write(self._oprot)
13376
    self._oprot.writeMessageEnd()
13388
    self._oprot.writeMessageEnd()
13377
    self._oprot.trans.flush()
13389
    self._oprot.trans.flush()
13378
 
13390
 
13379
  def recv_creditUserWallet(self, ):
13391
  def recv_creditUserWallet(self, ):
Line 13388... Line 13400...
13388
    self._iprot.readMessageEnd()
13400
    self._iprot.readMessageEnd()
13389
    if result.success is not None:
13401
    if result.success is not None:
13390
      return result.success
13402
      return result.success
13391
    raise TApplicationException(TApplicationException.MISSING_RESULT, "creditUserWallet failed: unknown result");
13403
    raise TApplicationException(TApplicationException.MISSING_RESULT, "creditUserWallet failed: unknown result");
13392
 
13404
 
-
 
13405
  def getPaginatedRechargeOrders(self, userId, offset, limit):
-
 
13406
    """
-
 
13407
    Parameters:
-
 
13408
     - userId
-
 
13409
     - offset
-
 
13410
     - limit
-
 
13411
    """
-
 
13412
    self.send_getPaginatedRechargeOrders(userId, offset, limit)
-
 
13413
    return self.recv_getPaginatedRechargeOrders()
-
 
13414
 
-
 
13415
  def send_getPaginatedRechargeOrders(self, userId, offset, limit):
-
 
13416
    self._oprot.writeMessageBegin('getPaginatedRechargeOrders', TMessageType.CALL, self._seqid)
-
 
13417
    args = getPaginatedRechargeOrders_args()
-
 
13418
    args.userId = userId
-
 
13419
    args.offset = offset
-
 
13420
    args.limit = limit
-
 
13421
    args.write(self._oprot)
-
 
13422
    self._oprot.writeMessageEnd()
-
 
13423
    self._oprot.trans.flush()
-
 
13424
 
-
 
13425
  def recv_getPaginatedRechargeOrders(self, ):
-
 
13426
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
13427
    if mtype == TMessageType.EXCEPTION:
-
 
13428
      x = TApplicationException()
-
 
13429
      x.read(self._iprot)
-
 
13430
      self._iprot.readMessageEnd()
-
 
13431
      raise x
-
 
13432
    result = getPaginatedRechargeOrders_result()
-
 
13433
    result.read(self._iprot)
-
 
13434
    self._iprot.readMessageEnd()
-
 
13435
    if result.success is not None:
-
 
13436
      return result.success
-
 
13437
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaginatedRechargeOrders failed: unknown result");
-
 
13438
 
13393
 
13439
 
13394
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
13440
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
13395
  def __init__(self, handler):
13441
  def __init__(self, handler):
13396
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
13442
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
13397
    self._processMap["createTransaction"] = Processor.process_createTransaction
13443
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 13712... Line 13758...
13712
    self._processMap["getPmsaUsers"] = Processor.process_getPmsaUsers
13758
    self._processMap["getPmsaUsers"] = Processor.process_getPmsaUsers
13713
    self._processMap["getPendingAssociates"] = Processor.process_getPendingAssociates
13759
    self._processMap["getPendingAssociates"] = Processor.process_getPendingAssociates
13714
    self._processMap["getStatsForAssociates"] = Processor.process_getStatsForAssociates
13760
    self._processMap["getStatsForAssociates"] = Processor.process_getStatsForAssociates
13715
    self._processMap["getmypmsaprofile"] = Processor.process_getmypmsaprofile
13761
    self._processMap["getmypmsaprofile"] = Processor.process_getmypmsaprofile
13716
    self._processMap["creditUserWallet"] = Processor.process_creditUserWallet
13762
    self._processMap["creditUserWallet"] = Processor.process_creditUserWallet
-
 
13763
    self._processMap["getPaginatedRechargeOrders"] = Processor.process_getPaginatedRechargeOrders
13717
 
13764
 
13718
  def process(self, iprot, oprot):
13765
  def process(self, iprot, oprot):
13719
    (name, type, seqid) = iprot.readMessageBegin()
13766
    (name, type, seqid) = iprot.readMessageBegin()
13720
    if name not in self._processMap:
13767
    if name not in self._processMap:
13721
      iprot.skip(TType.STRUCT)
13768
      iprot.skip(TType.STRUCT)
Line 17659... Line 17706...
17659
  def process_creditUserWallet(self, seqid, iprot, oprot):
17706
  def process_creditUserWallet(self, seqid, iprot, oprot):
17660
    args = creditUserWallet_args()
17707
    args = creditUserWallet_args()
17661
    args.read(iprot)
17708
    args.read(iprot)
17662
    iprot.readMessageEnd()
17709
    iprot.readMessageEnd()
17663
    result = creditUserWallet_result()
17710
    result = creditUserWallet_result()
17664
    result.success = self._handler.creditUserWallet(args.userId, args.amount)
17711
    result.success = self._handler.creditUserWallet(args.userId, args.amount, args.cash_back)
17665
    oprot.writeMessageBegin("creditUserWallet", TMessageType.REPLY, seqid)
17712
    oprot.writeMessageBegin("creditUserWallet", TMessageType.REPLY, seqid)
17666
    result.write(oprot)
17713
    result.write(oprot)
17667
    oprot.writeMessageEnd()
17714
    oprot.writeMessageEnd()
17668
    oprot.trans.flush()
17715
    oprot.trans.flush()
17669
 
17716
 
-
 
17717
  def process_getPaginatedRechargeOrders(self, seqid, iprot, oprot):
-
 
17718
    args = getPaginatedRechargeOrders_args()
-
 
17719
    args.read(iprot)
-
 
17720
    iprot.readMessageEnd()
-
 
17721
    result = getPaginatedRechargeOrders_result()
-
 
17722
    result.success = self._handler.getPaginatedRechargeOrders(args.userId, args.offset, args.limit)
-
 
17723
    oprot.writeMessageBegin("getPaginatedRechargeOrders", TMessageType.REPLY, seqid)
-
 
17724
    result.write(oprot)
-
 
17725
    oprot.writeMessageEnd()
-
 
17726
    oprot.trans.flush()
-
 
17727
 
17670
 
17728
 
17671
# HELPER FUNCTIONS AND STRUCTURES
17729
# HELPER FUNCTIONS AND STRUCTURES
17672
 
17730
 
17673
class createTransaction_args:
17731
class createTransaction_args:
17674
  """
17732
  """
Line 61894... Line 61952...
61894
class creditUserWallet_args:
61952
class creditUserWallet_args:
61895
  """
61953
  """
61896
  Attributes:
61954
  Attributes:
61897
   - userId
61955
   - userId
61898
   - amount
61956
   - amount
-
 
61957
   - cash_back
61899
  """
61958
  """
61900
 
61959
 
61901
  thrift_spec = (
61960
  thrift_spec = (
61902
    None, # 0
61961
    None, # 0
61903
    (1, TType.I64, 'userId', None, None, ), # 1
61962
    (1, TType.I64, 'userId', None, None, ), # 1
61904
    (2, TType.I64, 'amount', None, None, ), # 2
61963
    (2, TType.I64, 'amount', None, None, ), # 2
-
 
61964
    (3, TType.DOUBLE, 'cash_back', None, None, ), # 3
61905
  )
61965
  )
61906
 
61966
 
61907
  def __init__(self, userId=None, amount=None,):
61967
  def __init__(self, userId=None, amount=None, cash_back=None,):
61908
    self.userId = userId
61968
    self.userId = userId
61909
    self.amount = amount
61969
    self.amount = amount
-
 
61970
    self.cash_back = cash_back
61910
 
61971
 
61911
  def read(self, iprot):
61972
  def read(self, iprot):
61912
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
61973
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
61913
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
61974
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
61914
      return
61975
      return
Line 61925... Line 61986...
61925
      elif fid == 2:
61986
      elif fid == 2:
61926
        if ftype == TType.I64:
61987
        if ftype == TType.I64:
61927
          self.amount = iprot.readI64();
61988
          self.amount = iprot.readI64();
61928
        else:
61989
        else:
61929
          iprot.skip(ftype)
61990
          iprot.skip(ftype)
-
 
61991
      elif fid == 3:
-
 
61992
        if ftype == TType.DOUBLE:
-
 
61993
          self.cash_back = iprot.readDouble();
-
 
61994
        else:
-
 
61995
          iprot.skip(ftype)
61930
      else:
61996
      else:
61931
        iprot.skip(ftype)
61997
        iprot.skip(ftype)
61932
      iprot.readFieldEnd()
61998
      iprot.readFieldEnd()
61933
    iprot.readStructEnd()
61999
    iprot.readStructEnd()
61934
 
62000
 
Line 61943... Line 62009...
61943
      oprot.writeFieldEnd()
62009
      oprot.writeFieldEnd()
61944
    if self.amount is not None:
62010
    if self.amount is not None:
61945
      oprot.writeFieldBegin('amount', TType.I64, 2)
62011
      oprot.writeFieldBegin('amount', TType.I64, 2)
61946
      oprot.writeI64(self.amount)
62012
      oprot.writeI64(self.amount)
61947
      oprot.writeFieldEnd()
62013
      oprot.writeFieldEnd()
-
 
62014
    if self.cash_back is not None:
-
 
62015
      oprot.writeFieldBegin('cash_back', TType.DOUBLE, 3)
-
 
62016
      oprot.writeDouble(self.cash_back)
-
 
62017
      oprot.writeFieldEnd()
61948
    oprot.writeFieldStop()
62018
    oprot.writeFieldStop()
61949
    oprot.writeStructEnd()
62019
    oprot.writeStructEnd()
61950
 
62020
 
61951
  def validate(self):
62021
  def validate(self):
61952
    return
62022
    return
Line 62006... Line 62076...
62006
      oprot.writeFieldEnd()
62076
      oprot.writeFieldEnd()
62007
    oprot.writeFieldStop()
62077
    oprot.writeFieldStop()
62008
    oprot.writeStructEnd()
62078
    oprot.writeStructEnd()
62009
 
62079
 
62010
  def validate(self):
62080
  def validate(self):
-
 
62081
    return
-
 
62082
 
-
 
62083
 
-
 
62084
  def __repr__(self):
-
 
62085
    L = ['%s=%r' % (key, value)
-
 
62086
      for key, value in self.__dict__.iteritems()]
-
 
62087
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
62088
 
-
 
62089
  def __eq__(self, other):
-
 
62090
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
62091
 
-
 
62092
  def __ne__(self, other):
-
 
62093
    return not (self == other)
-
 
62094
 
-
 
62095
class getPaginatedRechargeOrders_args:
-
 
62096
  """
-
 
62097
  Attributes:
-
 
62098
   - userId
-
 
62099
   - offset
-
 
62100
   - limit
-
 
62101
  """
-
 
62102
 
-
 
62103
  thrift_spec = (
-
 
62104
    None, # 0
-
 
62105
    (1, TType.I64, 'userId', None, None, ), # 1
-
 
62106
    (2, TType.I32, 'offset', None, None, ), # 2
-
 
62107
    (3, TType.I32, 'limit', None, None, ), # 3
-
 
62108
  )
-
 
62109
 
-
 
62110
  def __init__(self, userId=None, offset=None, limit=None,):
-
 
62111
    self.userId = userId
-
 
62112
    self.offset = offset
-
 
62113
    self.limit = limit
-
 
62114
 
-
 
62115
  def read(self, iprot):
-
 
62116
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
62117
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
62118
      return
-
 
62119
    iprot.readStructBegin()
-
 
62120
    while True:
-
 
62121
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
62122
      if ftype == TType.STOP:
-
 
62123
        break
-
 
62124
      if fid == 1:
-
 
62125
        if ftype == TType.I64:
-
 
62126
          self.userId = iprot.readI64();
-
 
62127
        else:
-
 
62128
          iprot.skip(ftype)
-
 
62129
      elif fid == 2:
-
 
62130
        if ftype == TType.I32:
-
 
62131
          self.offset = iprot.readI32();
-
 
62132
        else:
-
 
62133
          iprot.skip(ftype)
-
 
62134
      elif fid == 3:
-
 
62135
        if ftype == TType.I32:
-
 
62136
          self.limit = iprot.readI32();
-
 
62137
        else:
-
 
62138
          iprot.skip(ftype)
-
 
62139
      else:
-
 
62140
        iprot.skip(ftype)
-
 
62141
      iprot.readFieldEnd()
-
 
62142
    iprot.readStructEnd()
-
 
62143
 
-
 
62144
  def write(self, oprot):
-
 
62145
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
62146
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
62147
      return
-
 
62148
    oprot.writeStructBegin('getPaginatedRechargeOrders_args')
-
 
62149
    if self.userId is not None:
-
 
62150
      oprot.writeFieldBegin('userId', TType.I64, 1)
-
 
62151
      oprot.writeI64(self.userId)
-
 
62152
      oprot.writeFieldEnd()
-
 
62153
    if self.offset is not None:
-
 
62154
      oprot.writeFieldBegin('offset', TType.I32, 2)
-
 
62155
      oprot.writeI32(self.offset)
-
 
62156
      oprot.writeFieldEnd()
-
 
62157
    if self.limit is not None:
-
 
62158
      oprot.writeFieldBegin('limit', TType.I32, 3)
-
 
62159
      oprot.writeI32(self.limit)
-
 
62160
      oprot.writeFieldEnd()
-
 
62161
    oprot.writeFieldStop()
-
 
62162
    oprot.writeStructEnd()
-
 
62163
 
-
 
62164
  def validate(self):
-
 
62165
    return
-
 
62166
 
-
 
62167
 
-
 
62168
  def __repr__(self):
-
 
62169
    L = ['%s=%r' % (key, value)
-
 
62170
      for key, value in self.__dict__.iteritems()]
-
 
62171
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
62172
 
-
 
62173
  def __eq__(self, other):
-
 
62174
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
62175
 
-
 
62176
  def __ne__(self, other):
-
 
62177
    return not (self == other)
-
 
62178
 
-
 
62179
class getPaginatedRechargeOrders_result:
-
 
62180
  """
-
 
62181
  Attributes:
-
 
62182
   - success
-
 
62183
  """
-
 
62184
 
-
 
62185
  thrift_spec = (
-
 
62186
    (0, TType.LIST, 'success', (TType.STRUCT,(RechargeOrder, RechargeOrder.thrift_spec)), None, ), # 0
-
 
62187
  )
-
 
62188
 
-
 
62189
  def __init__(self, success=None,):
-
 
62190
    self.success = success
-
 
62191
 
-
 
62192
  def read(self, iprot):
-
 
62193
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
62194
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
62195
      return
-
 
62196
    iprot.readStructBegin()
-
 
62197
    while True:
-
 
62198
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
62199
      if ftype == TType.STOP:
-
 
62200
        break
-
 
62201
      if fid == 0:
-
 
62202
        if ftype == TType.LIST:
-
 
62203
          self.success = []
-
 
62204
          (_etype1542, _size1539) = iprot.readListBegin()
-
 
62205
          for _i1543 in xrange(_size1539):
-
 
62206
            _elem1544 = RechargeOrder()
-
 
62207
            _elem1544.read(iprot)
-
 
62208
            self.success.append(_elem1544)
-
 
62209
          iprot.readListEnd()
-
 
62210
        else:
-
 
62211
          iprot.skip(ftype)
-
 
62212
      else:
-
 
62213
        iprot.skip(ftype)
-
 
62214
      iprot.readFieldEnd()
-
 
62215
    iprot.readStructEnd()
-
 
62216
 
-
 
62217
  def write(self, oprot):
-
 
62218
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
62219
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
62220
      return
-
 
62221
    oprot.writeStructBegin('getPaginatedRechargeOrders_result')
-
 
62222
    if self.success is not None:
-
 
62223
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
62224
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
62225
      for iter1545 in self.success:
-
 
62226
        iter1545.write(oprot)
-
 
62227
      oprot.writeListEnd()
-
 
62228
      oprot.writeFieldEnd()
-
 
62229
    oprot.writeFieldStop()
-
 
62230
    oprot.writeStructEnd()
-
 
62231
 
-
 
62232
  def validate(self):
62011
    return
62233
    return
62012
 
62234
 
62013
 
62235
 
62014
  def __repr__(self):
62236
  def __repr__(self):
62015
    L = ['%s=%r' % (key, value)
62237
    L = ['%s=%r' % (key, value)