Subversion Repositories SmartDukaan

Rev

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

Rev 5334 Rev 5342
Line 306... Line 306...
306
     - event
306
     - event
307
     - url
307
     - url
308
    """
308
    """
309
    pass
309
    pass
310
 
310
 
311
  def createCart(self, userId):
-
 
312
    """
-
 
313
    Parameters:
-
 
314
     - userId
-
 
315
    """
-
 
316
    pass
-
 
317
 
-
 
318
  def getCurrentCart(self, userId):
311
  def getCurrentCart(self, userId):
319
    """
312
    """
320
    Parameters:
313
    Parameters:
321
     - userId
314
     - userId
322
    """
315
    """
Line 1851... Line 1844...
1851
      return result.success
1844
      return result.success
1852
    if result.utx is not None:
1845
    if result.utx is not None:
1853
      raise result.utx
1846
      raise result.utx
1854
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getTrackLogs failed: unknown result");
1847
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getTrackLogs failed: unknown result");
1855
 
1848
 
1856
  def createCart(self, userId):
-
 
1857
    """
-
 
1858
    Parameters:
-
 
1859
     - userId
-
 
1860
    """
-
 
1861
    self.send_createCart(userId)
-
 
1862
    return self.recv_createCart()
-
 
1863
 
-
 
1864
  def send_createCart(self, userId):
-
 
1865
    self._oprot.writeMessageBegin('createCart', TMessageType.CALL, self._seqid)
-
 
1866
    args = createCart_args()
-
 
1867
    args.userId = userId
-
 
1868
    args.write(self._oprot)
-
 
1869
    self._oprot.writeMessageEnd()
-
 
1870
    self._oprot.trans.flush()
-
 
1871
 
-
 
1872
  def recv_createCart(self, ):
-
 
1873
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1874
    if mtype == TMessageType.EXCEPTION:
-
 
1875
      x = TApplicationException()
-
 
1876
      x.read(self._iprot)
-
 
1877
      self._iprot.readMessageEnd()
-
 
1878
      raise x
-
 
1879
    result = createCart_result()
-
 
1880
    result.read(self._iprot)
-
 
1881
    self._iprot.readMessageEnd()
-
 
1882
    if result.success is not None:
-
 
1883
      return result.success
-
 
1884
    if result.scx is not None:
-
 
1885
      raise result.scx
-
 
1886
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createCart failed: unknown result");
-
 
1887
 
-
 
1888
  def getCurrentCart(self, userId):
1849
  def getCurrentCart(self, userId):
1889
    """
1850
    """
1890
    Parameters:
1851
    Parameters:
1891
     - userId
1852
     - userId
1892
    """
1853
    """
Line 2840... Line 2801...
2840
    self._processMap["addTrackLog"] = Processor.process_addTrackLog
2801
    self._processMap["addTrackLog"] = Processor.process_addTrackLog
2841
    self._processMap["getTrackLogById"] = Processor.process_getTrackLogById
2802
    self._processMap["getTrackLogById"] = Processor.process_getTrackLogById
2842
    self._processMap["getTrackLogsByAffiliate"] = Processor.process_getTrackLogsByAffiliate
2803
    self._processMap["getTrackLogsByAffiliate"] = Processor.process_getTrackLogsByAffiliate
2843
    self._processMap["getTrackLogsByUser"] = Processor.process_getTrackLogsByUser
2804
    self._processMap["getTrackLogsByUser"] = Processor.process_getTrackLogsByUser
2844
    self._processMap["getTrackLogs"] = Processor.process_getTrackLogs
2805
    self._processMap["getTrackLogs"] = Processor.process_getTrackLogs
2845
    self._processMap["createCart"] = Processor.process_createCart
-
 
2846
    self._processMap["getCurrentCart"] = Processor.process_getCurrentCart
2806
    self._processMap["getCurrentCart"] = Processor.process_getCurrentCart
2847
    self._processMap["getCart"] = Processor.process_getCart
2807
    self._processMap["getCart"] = Processor.process_getCart
2848
    self._processMap["getCartsByTime"] = Processor.process_getCartsByTime
2808
    self._processMap["getCartsByTime"] = Processor.process_getCartsByTime
2849
    self._processMap["addItemToCart"] = Processor.process_addItemToCart
2809
    self._processMap["addItemToCart"] = Processor.process_addItemToCart
2850
    self._processMap["deleteItemFromCart"] = Processor.process_deleteItemFromCart
2810
    self._processMap["deleteItemFromCart"] = Processor.process_deleteItemFromCart
Line 3416... Line 3376...
3416
    oprot.writeMessageBegin("getTrackLogs", TMessageType.REPLY, seqid)
3376
    oprot.writeMessageBegin("getTrackLogs", TMessageType.REPLY, seqid)
3417
    result.write(oprot)
3377
    result.write(oprot)
3418
    oprot.writeMessageEnd()
3378
    oprot.writeMessageEnd()
3419
    oprot.trans.flush()
3379
    oprot.trans.flush()
3420
 
3380
 
3421
  def process_createCart(self, seqid, iprot, oprot):
-
 
3422
    args = createCart_args()
-
 
3423
    args.read(iprot)
-
 
3424
    iprot.readMessageEnd()
-
 
3425
    result = createCart_result()
-
 
3426
    try:
-
 
3427
      result.success = self._handler.createCart(args.userId)
-
 
3428
    except ShoppingCartException, scx:
-
 
3429
      result.scx = scx
-
 
3430
    oprot.writeMessageBegin("createCart", TMessageType.REPLY, seqid)
-
 
3431
    result.write(oprot)
-
 
3432
    oprot.writeMessageEnd()
-
 
3433
    oprot.trans.flush()
-
 
3434
 
-
 
3435
  def process_getCurrentCart(self, seqid, iprot, oprot):
3381
  def process_getCurrentCart(self, seqid, iprot, oprot):
3436
    args = getCurrentCart_args()
3382
    args = getCurrentCart_args()
3437
    args.read(iprot)
3383
    args.read(iprot)
3438
    iprot.readMessageEnd()
3384
    iprot.readMessageEnd()
3439
    result = getCurrentCart_result()
3385
    result = getCurrentCart_result()
Line 9199... Line 9145...
9199
      oprot.writeFieldEnd()
9145
      oprot.writeFieldEnd()
9200
    oprot.writeFieldStop()
9146
    oprot.writeFieldStop()
9201
    oprot.writeStructEnd()
9147
    oprot.writeStructEnd()
9202
 
9148
 
9203
  def validate(self):
9149
  def validate(self):
9204
    return
-
 
9205
 
-
 
9206
 
-
 
9207
  def __repr__(self):
-
 
9208
    L = ['%s=%r' % (key, value)
-
 
9209
      for key, value in self.__dict__.iteritems()]
-
 
9210
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
9211
 
-
 
9212
  def __eq__(self, other):
-
 
9213
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
9214
 
-
 
9215
  def __ne__(self, other):
-
 
9216
    return not (self == other)
-
 
9217
 
-
 
9218
class createCart_args:
-
 
9219
  """
-
 
9220
  Attributes:
-
 
9221
   - userId
-
 
9222
  """
-
 
9223
 
-
 
9224
  thrift_spec = (
-
 
9225
    None, # 0
-
 
9226
    (1, TType.I64, 'userId', None, None, ), # 1
-
 
9227
  )
-
 
9228
 
-
 
9229
  def __init__(self, userId=None,):
-
 
9230
    self.userId = userId
-
 
9231
 
-
 
9232
  def read(self, iprot):
-
 
9233
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
9234
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
9235
      return
-
 
9236
    iprot.readStructBegin()
-
 
9237
    while True:
-
 
9238
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
9239
      if ftype == TType.STOP:
-
 
9240
        break
-
 
9241
      if fid == 1:
-
 
9242
        if ftype == TType.I64:
-
 
9243
          self.userId = iprot.readI64();
-
 
9244
        else:
-
 
9245
          iprot.skip(ftype)
-
 
9246
      else:
-
 
9247
        iprot.skip(ftype)
-
 
9248
      iprot.readFieldEnd()
-
 
9249
    iprot.readStructEnd()
-
 
9250
 
-
 
9251
  def write(self, oprot):
-
 
9252
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
9253
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
9254
      return
-
 
9255
    oprot.writeStructBegin('createCart_args')
-
 
9256
    if self.userId is not None:
-
 
9257
      oprot.writeFieldBegin('userId', TType.I64, 1)
-
 
9258
      oprot.writeI64(self.userId)
-
 
9259
      oprot.writeFieldEnd()
-
 
9260
    oprot.writeFieldStop()
-
 
9261
    oprot.writeStructEnd()
-
 
9262
 
-
 
9263
  def validate(self):
-
 
9264
    return
-
 
9265
 
-
 
9266
 
-
 
9267
  def __repr__(self):
-
 
9268
    L = ['%s=%r' % (key, value)
-
 
9269
      for key, value in self.__dict__.iteritems()]
-
 
9270
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
9271
 
-
 
9272
  def __eq__(self, other):
-
 
9273
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
9274
 
-
 
9275
  def __ne__(self, other):
-
 
9276
    return not (self == other)
-
 
9277
 
-
 
9278
class createCart_result:
-
 
9279
  """
-
 
9280
  Attributes:
-
 
9281
   - success
-
 
9282
   - scx
-
 
9283
  """
-
 
9284
 
-
 
9285
  thrift_spec = (
-
 
9286
    (0, TType.I64, 'success', None, None, ), # 0
-
 
9287
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
-
 
9288
  )
-
 
9289
 
-
 
9290
  def __init__(self, success=None, scx=None,):
-
 
9291
    self.success = success
-
 
9292
    self.scx = scx
-
 
9293
 
-
 
9294
  def read(self, iprot):
-
 
9295
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
9296
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
9297
      return
-
 
9298
    iprot.readStructBegin()
-
 
9299
    while True:
-
 
9300
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
9301
      if ftype == TType.STOP:
-
 
9302
        break
-
 
9303
      if fid == 0:
-
 
9304
        if ftype == TType.I64:
-
 
9305
          self.success = iprot.readI64();
-
 
9306
        else:
-
 
9307
          iprot.skip(ftype)
-
 
9308
      elif fid == 1:
-
 
9309
        if ftype == TType.STRUCT:
-
 
9310
          self.scx = ShoppingCartException()
-
 
9311
          self.scx.read(iprot)
-
 
9312
        else:
-
 
9313
          iprot.skip(ftype)
-
 
9314
      else:
-
 
9315
        iprot.skip(ftype)
-
 
9316
      iprot.readFieldEnd()
-
 
9317
    iprot.readStructEnd()
-
 
9318
 
-
 
9319
  def write(self, oprot):
-
 
9320
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
9321
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
9322
      return
-
 
9323
    oprot.writeStructBegin('createCart_result')
-
 
9324
    if self.success is not None:
-
 
9325
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
9326
      oprot.writeI64(self.success)
-
 
9327
      oprot.writeFieldEnd()
-
 
9328
    if self.scx is not None:
-
 
9329
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
-
 
9330
      self.scx.write(oprot)
-
 
9331
      oprot.writeFieldEnd()
-
 
9332
    oprot.writeFieldStop()
-
 
9333
    oprot.writeStructEnd()
-
 
9334
 
-
 
9335
  def validate(self):
-
 
9336
    return
9150
    return
9337
 
9151
 
9338
 
9152
 
9339
  def __repr__(self):
9153
  def __repr__(self):
9340
    L = ['%s=%r' % (key, value)
9154
    L = ['%s=%r' % (key, value)