Subversion Repositories SmartDukaan

Rev

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

Rev 6031 Rev 6048
Line 1335... Line 1335...
1335
    Parameters:
1335
    Parameters:
1336
     - userId
1336
     - userId
1337
    """
1337
    """
1338
    pass
1338
    pass
1339
 
1339
 
-
 
1340
  def getServiceProviders(self, rechargeType):
-
 
1341
    """
-
 
1342
    Parameters:
-
 
1343
     - rechargeType
-
 
1344
    """
-
 
1345
    pass
-
 
1346
 
-
 
1347
  def getServiceProviderForDevice(self, deviceNumber):
-
 
1348
    """
-
 
1349
    Parameters:
-
 
1350
     - deviceNumber
-
 
1351
    """
-
 
1352
    pass
-
 
1353
 
1340
 
1354
 
1341
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1355
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
1342
  def __init__(self, iprot, oprot=None):
1356
  def __init__(self, iprot, oprot=None):
1343
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1357
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
1344
 
1358
 
Line 5995... Line 6009...
5995
    self._iprot.readMessageEnd()
6009
    self._iprot.readMessageEnd()
5996
    if result.success is not None:
6010
    if result.success is not None:
5997
      return result.success
6011
      return result.success
5998
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserWalletHistory failed: unknown result");
6012
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserWalletHistory failed: unknown result");
5999
 
6013
 
-
 
6014
  def getServiceProviders(self, rechargeType):
-
 
6015
    """
-
 
6016
    Parameters:
-
 
6017
     - rechargeType
-
 
6018
    """
-
 
6019
    self.send_getServiceProviders(rechargeType)
-
 
6020
    return self.recv_getServiceProviders()
-
 
6021
 
-
 
6022
  def send_getServiceProviders(self, rechargeType):
-
 
6023
    self._oprot.writeMessageBegin('getServiceProviders', TMessageType.CALL, self._seqid)
-
 
6024
    args = getServiceProviders_args()
-
 
6025
    args.rechargeType = rechargeType
-
 
6026
    args.write(self._oprot)
-
 
6027
    self._oprot.writeMessageEnd()
-
 
6028
    self._oprot.trans.flush()
-
 
6029
 
-
 
6030
  def recv_getServiceProviders(self, ):
-
 
6031
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
6032
    if mtype == TMessageType.EXCEPTION:
-
 
6033
      x = TApplicationException()
-
 
6034
      x.read(self._iprot)
-
 
6035
      self._iprot.readMessageEnd()
-
 
6036
      raise x
-
 
6037
    result = getServiceProviders_result()
-
 
6038
    result.read(self._iprot)
-
 
6039
    self._iprot.readMessageEnd()
-
 
6040
    if result.success is not None:
-
 
6041
      return result.success
-
 
6042
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getServiceProviders failed: unknown result");
-
 
6043
 
-
 
6044
  def getServiceProviderForDevice(self, deviceNumber):
-
 
6045
    """
-
 
6046
    Parameters:
-
 
6047
     - deviceNumber
-
 
6048
    """
-
 
6049
    self.send_getServiceProviderForDevice(deviceNumber)
-
 
6050
    return self.recv_getServiceProviderForDevice()
-
 
6051
 
-
 
6052
  def send_getServiceProviderForDevice(self, deviceNumber):
-
 
6053
    self._oprot.writeMessageBegin('getServiceProviderForDevice', TMessageType.CALL, self._seqid)
-
 
6054
    args = getServiceProviderForDevice_args()
-
 
6055
    args.deviceNumber = deviceNumber
-
 
6056
    args.write(self._oprot)
-
 
6057
    self._oprot.writeMessageEnd()
-
 
6058
    self._oprot.trans.flush()
-
 
6059
 
-
 
6060
  def recv_getServiceProviderForDevice(self, ):
-
 
6061
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
6062
    if mtype == TMessageType.EXCEPTION:
-
 
6063
      x = TApplicationException()
-
 
6064
      x.read(self._iprot)
-
 
6065
      self._iprot.readMessageEnd()
-
 
6066
      raise x
-
 
6067
    result = getServiceProviderForDevice_result()
-
 
6068
    result.read(self._iprot)
-
 
6069
    self._iprot.readMessageEnd()
-
 
6070
    if result.success is not None:
-
 
6071
      return result.success
-
 
6072
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getServiceProviderForDevice failed: unknown result");
-
 
6073
 
6000
 
6074
 
6001
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
6075
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
6002
  def __init__(self, handler):
6076
  def __init__(self, handler):
6003
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
6077
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
6004
    self._processMap["createTransaction"] = Processor.process_createTransaction
6078
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 6133... Line 6207...
6133
    self._processMap["getRechargeOrders"] = Processor.process_getRechargeOrders
6207
    self._processMap["getRechargeOrders"] = Processor.process_getRechargeOrders
6134
    self._processMap["updateRechargeOrderStatus"] = Processor.process_updateRechargeOrderStatus
6208
    self._processMap["updateRechargeOrderStatus"] = Processor.process_updateRechargeOrderStatus
6135
    self._processMap["activateRechargeTxn"] = Processor.process_activateRechargeTxn
6209
    self._processMap["activateRechargeTxn"] = Processor.process_activateRechargeTxn
6136
    self._processMap["getUserWallet"] = Processor.process_getUserWallet
6210
    self._processMap["getUserWallet"] = Processor.process_getUserWallet
6137
    self._processMap["getUserWalletHistory"] = Processor.process_getUserWalletHistory
6211
    self._processMap["getUserWalletHistory"] = Processor.process_getUserWalletHistory
-
 
6212
    self._processMap["getServiceProviders"] = Processor.process_getServiceProviders
-
 
6213
    self._processMap["getServiceProviderForDevice"] = Processor.process_getServiceProviderForDevice
6138
 
6214
 
6139
  def process(self, iprot, oprot):
6215
  def process(self, iprot, oprot):
6140
    (name, type, seqid) = iprot.readMessageBegin()
6216
    (name, type, seqid) = iprot.readMessageBegin()
6141
    if name not in self._processMap:
6217
    if name not in self._processMap:
6142
      iprot.skip(TType.STRUCT)
6218
      iprot.skip(TType.STRUCT)
Line 7908... Line 7984...
7908
    oprot.writeMessageBegin("getUserWalletHistory", TMessageType.REPLY, seqid)
7984
    oprot.writeMessageBegin("getUserWalletHistory", TMessageType.REPLY, seqid)
7909
    result.write(oprot)
7985
    result.write(oprot)
7910
    oprot.writeMessageEnd()
7986
    oprot.writeMessageEnd()
7911
    oprot.trans.flush()
7987
    oprot.trans.flush()
7912
 
7988
 
-
 
7989
  def process_getServiceProviders(self, seqid, iprot, oprot):
-
 
7990
    args = getServiceProviders_args()
-
 
7991
    args.read(iprot)
-
 
7992
    iprot.readMessageEnd()
-
 
7993
    result = getServiceProviders_result()
-
 
7994
    result.success = self._handler.getServiceProviders(args.rechargeType)
-
 
7995
    oprot.writeMessageBegin("getServiceProviders", TMessageType.REPLY, seqid)
-
 
7996
    result.write(oprot)
-
 
7997
    oprot.writeMessageEnd()
-
 
7998
    oprot.trans.flush()
-
 
7999
 
-
 
8000
  def process_getServiceProviderForDevice(self, seqid, iprot, oprot):
-
 
8001
    args = getServiceProviderForDevice_args()
-
 
8002
    args.read(iprot)
-
 
8003
    iprot.readMessageEnd()
-
 
8004
    result = getServiceProviderForDevice_result()
-
 
8005
    result.success = self._handler.getServiceProviderForDevice(args.deviceNumber)
-
 
8006
    oprot.writeMessageBegin("getServiceProviderForDevice", TMessageType.REPLY, seqid)
-
 
8007
    result.write(oprot)
-
 
8008
    oprot.writeMessageEnd()
-
 
8009
    oprot.trans.flush()
-
 
8010
 
7913
 
8011
 
7914
# HELPER FUNCTIONS AND STRUCTURES
8012
# HELPER FUNCTIONS AND STRUCTURES
7915
 
8013
 
7916
class createTransaction_args:
8014
class createTransaction_args:
7917
  """
8015
  """
Line 26870... Line 26968...
26870
      oprot.writeFieldEnd()
26968
      oprot.writeFieldEnd()
26871
    oprot.writeFieldStop()
26969
    oprot.writeFieldStop()
26872
    oprot.writeStructEnd()
26970
    oprot.writeStructEnd()
26873
 
26971
 
26874
  def validate(self):
26972
  def validate(self):
-
 
26973
    return
-
 
26974
 
-
 
26975
 
-
 
26976
  def __repr__(self):
-
 
26977
    L = ['%s=%r' % (key, value)
-
 
26978
      for key, value in self.__dict__.iteritems()]
-
 
26979
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
26980
 
-
 
26981
  def __eq__(self, other):
-
 
26982
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
26983
 
-
 
26984
  def __ne__(self, other):
-
 
26985
    return not (self == other)
-
 
26986
 
-
 
26987
class getServiceProviders_args:
-
 
26988
  """
-
 
26989
  Attributes:
-
 
26990
   - rechargeType
-
 
26991
  """
-
 
26992
 
-
 
26993
  thrift_spec = (
-
 
26994
    None, # 0
-
 
26995
    (1, TType.I32, 'rechargeType', None, None, ), # 1
-
 
26996
  )
-
 
26997
 
-
 
26998
  def __init__(self, rechargeType=None,):
-
 
26999
    self.rechargeType = rechargeType
-
 
27000
 
-
 
27001
  def read(self, iprot):
-
 
27002
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27003
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27004
      return
-
 
27005
    iprot.readStructBegin()
-
 
27006
    while True:
-
 
27007
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27008
      if ftype == TType.STOP:
-
 
27009
        break
-
 
27010
      if fid == 1:
-
 
27011
        if ftype == TType.I32:
-
 
27012
          self.rechargeType = iprot.readI32();
-
 
27013
        else:
-
 
27014
          iprot.skip(ftype)
-
 
27015
      else:
-
 
27016
        iprot.skip(ftype)
-
 
27017
      iprot.readFieldEnd()
-
 
27018
    iprot.readStructEnd()
-
 
27019
 
-
 
27020
  def write(self, oprot):
-
 
27021
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27022
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27023
      return
-
 
27024
    oprot.writeStructBegin('getServiceProviders_args')
-
 
27025
    if self.rechargeType is not None:
-
 
27026
      oprot.writeFieldBegin('rechargeType', TType.I32, 1)
-
 
27027
      oprot.writeI32(self.rechargeType)
-
 
27028
      oprot.writeFieldEnd()
-
 
27029
    oprot.writeFieldStop()
-
 
27030
    oprot.writeStructEnd()
-
 
27031
 
-
 
27032
  def validate(self):
-
 
27033
    return
-
 
27034
 
-
 
27035
 
-
 
27036
  def __repr__(self):
-
 
27037
    L = ['%s=%r' % (key, value)
-
 
27038
      for key, value in self.__dict__.iteritems()]
-
 
27039
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
27040
 
-
 
27041
  def __eq__(self, other):
-
 
27042
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
27043
 
-
 
27044
  def __ne__(self, other):
-
 
27045
    return not (self == other)
-
 
27046
 
-
 
27047
class getServiceProviders_result:
-
 
27048
  """
-
 
27049
  Attributes:
-
 
27050
   - success
-
 
27051
  """
-
 
27052
 
-
 
27053
  thrift_spec = (
-
 
27054
    (0, TType.MAP, 'success', (TType.I64,None,TType.STRING,None), None, ), # 0
-
 
27055
  )
-
 
27056
 
-
 
27057
  def __init__(self, success=None,):
-
 
27058
    self.success = success
-
 
27059
 
-
 
27060
  def read(self, iprot):
-
 
27061
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27062
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27063
      return
-
 
27064
    iprot.readStructBegin()
-
 
27065
    while True:
-
 
27066
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27067
      if ftype == TType.STOP:
-
 
27068
        break
-
 
27069
      if fid == 0:
-
 
27070
        if ftype == TType.MAP:
-
 
27071
          self.success = {}
-
 
27072
          (_ktype628, _vtype629, _size627 ) = iprot.readMapBegin() 
-
 
27073
          for _i631 in xrange(_size627):
-
 
27074
            _key632 = iprot.readI64();
-
 
27075
            _val633 = iprot.readString();
-
 
27076
            self.success[_key632] = _val633
-
 
27077
          iprot.readMapEnd()
-
 
27078
        else:
-
 
27079
          iprot.skip(ftype)
-
 
27080
      else:
-
 
27081
        iprot.skip(ftype)
-
 
27082
      iprot.readFieldEnd()
-
 
27083
    iprot.readStructEnd()
-
 
27084
 
-
 
27085
  def write(self, oprot):
-
 
27086
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27087
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27088
      return
-
 
27089
    oprot.writeStructBegin('getServiceProviders_result')
-
 
27090
    if self.success is not None:
-
 
27091
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
27092
      oprot.writeMapBegin(TType.I64, TType.STRING, len(self.success))
-
 
27093
      for kiter634,viter635 in self.success.items():
-
 
27094
        oprot.writeI64(kiter634)
-
 
27095
        oprot.writeString(viter635)
-
 
27096
      oprot.writeMapEnd()
-
 
27097
      oprot.writeFieldEnd()
-
 
27098
    oprot.writeFieldStop()
-
 
27099
    oprot.writeStructEnd()
-
 
27100
 
-
 
27101
  def validate(self):
-
 
27102
    return
-
 
27103
 
-
 
27104
 
-
 
27105
  def __repr__(self):
-
 
27106
    L = ['%s=%r' % (key, value)
-
 
27107
      for key, value in self.__dict__.iteritems()]
-
 
27108
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
27109
 
-
 
27110
  def __eq__(self, other):
-
 
27111
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
27112
 
-
 
27113
  def __ne__(self, other):
-
 
27114
    return not (self == other)
-
 
27115
 
-
 
27116
class getServiceProviderForDevice_args:
-
 
27117
  """
-
 
27118
  Attributes:
-
 
27119
   - deviceNumber
-
 
27120
  """
-
 
27121
 
-
 
27122
  thrift_spec = (
-
 
27123
    None, # 0
-
 
27124
    (1, TType.STRING, 'deviceNumber', None, None, ), # 1
-
 
27125
  )
-
 
27126
 
-
 
27127
  def __init__(self, deviceNumber=None,):
-
 
27128
    self.deviceNumber = deviceNumber
-
 
27129
 
-
 
27130
  def read(self, iprot):
-
 
27131
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27132
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27133
      return
-
 
27134
    iprot.readStructBegin()
-
 
27135
    while True:
-
 
27136
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27137
      if ftype == TType.STOP:
-
 
27138
        break
-
 
27139
      if fid == 1:
-
 
27140
        if ftype == TType.STRING:
-
 
27141
          self.deviceNumber = iprot.readString();
-
 
27142
        else:
-
 
27143
          iprot.skip(ftype)
-
 
27144
      else:
-
 
27145
        iprot.skip(ftype)
-
 
27146
      iprot.readFieldEnd()
-
 
27147
    iprot.readStructEnd()
-
 
27148
 
-
 
27149
  def write(self, oprot):
-
 
27150
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27151
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27152
      return
-
 
27153
    oprot.writeStructBegin('getServiceProviderForDevice_args')
-
 
27154
    if self.deviceNumber is not None:
-
 
27155
      oprot.writeFieldBegin('deviceNumber', TType.STRING, 1)
-
 
27156
      oprot.writeString(self.deviceNumber)
-
 
27157
      oprot.writeFieldEnd()
-
 
27158
    oprot.writeFieldStop()
-
 
27159
    oprot.writeStructEnd()
-
 
27160
 
-
 
27161
  def validate(self):
-
 
27162
    return
-
 
27163
 
-
 
27164
 
-
 
27165
  def __repr__(self):
-
 
27166
    L = ['%s=%r' % (key, value)
-
 
27167
      for key, value in self.__dict__.iteritems()]
-
 
27168
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
27169
 
-
 
27170
  def __eq__(self, other):
-
 
27171
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
27172
 
-
 
27173
  def __ne__(self, other):
-
 
27174
    return not (self == other)
-
 
27175
 
-
 
27176
class getServiceProviderForDevice_result:
-
 
27177
  """
-
 
27178
  Attributes:
-
 
27179
   - success
-
 
27180
  """
-
 
27181
 
-
 
27182
  thrift_spec = (
-
 
27183
    (0, TType.I64, 'success', None, None, ), # 0
-
 
27184
  )
-
 
27185
 
-
 
27186
  def __init__(self, success=None,):
-
 
27187
    self.success = success
-
 
27188
 
-
 
27189
  def read(self, iprot):
-
 
27190
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
27191
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
27192
      return
-
 
27193
    iprot.readStructBegin()
-
 
27194
    while True:
-
 
27195
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
27196
      if ftype == TType.STOP:
-
 
27197
        break
-
 
27198
      if fid == 0:
-
 
27199
        if ftype == TType.I64:
-
 
27200
          self.success = iprot.readI64();
-
 
27201
        else:
-
 
27202
          iprot.skip(ftype)
-
 
27203
      else:
-
 
27204
        iprot.skip(ftype)
-
 
27205
      iprot.readFieldEnd()
-
 
27206
    iprot.readStructEnd()
-
 
27207
 
-
 
27208
  def write(self, oprot):
-
 
27209
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
27210
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
27211
      return
-
 
27212
    oprot.writeStructBegin('getServiceProviderForDevice_result')
-
 
27213
    if self.success is not None:
-
 
27214
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
27215
      oprot.writeI64(self.success)
-
 
27216
      oprot.writeFieldEnd()
-
 
27217
    oprot.writeFieldStop()
-
 
27218
    oprot.writeStructEnd()
-
 
27219
 
-
 
27220
  def validate(self):
26875
    return
27221
    return
26876
 
27222
 
26877
 
27223
 
26878
  def __repr__(self):
27224
  def __repr__(self):
26879
    L = ['%s=%r' % (key, value)
27225
    L = ['%s=%r' % (key, value)