Subversion Repositories SmartDukaan

Rev

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

Rev 5407 Rev 5553
Line 362... Line 362...
362
     - cartId
362
     - cartId
363
     - addressId
363
     - addressId
364
    """
364
    """
365
    pass
365
    pass
366
 
366
 
-
 
367
  def addStoreToCart(self, cartId, storeId):
-
 
368
    """
-
 
369
    Parameters:
-
 
370
     - cartId
-
 
371
     - storeId
-
 
372
    """
-
 
373
    pass
-
 
374
 
367
  def applyCouponToCart(self, cartId, couponCode, totalPrice, discountedPrice):
375
  def applyCouponToCart(self, cartId, couponCode, totalPrice, discountedPrice):
368
    """
376
    """
369
    Parameters:
377
    Parameters:
370
     - cartId
378
     - cartId
371
     - couponCode
379
     - couponCode
Line 2092... Line 2100...
2092
    self._iprot.readMessageEnd()
2100
    self._iprot.readMessageEnd()
2093
    if result.scx is not None:
2101
    if result.scx is not None:
2094
      raise result.scx
2102
      raise result.scx
2095
    return
2103
    return
2096
 
2104
 
-
 
2105
  def addStoreToCart(self, cartId, storeId):
-
 
2106
    """
-
 
2107
    Parameters:
-
 
2108
     - cartId
-
 
2109
     - storeId
-
 
2110
    """
-
 
2111
    self.send_addStoreToCart(cartId, storeId)
-
 
2112
    self.recv_addStoreToCart()
-
 
2113
 
-
 
2114
  def send_addStoreToCart(self, cartId, storeId):
-
 
2115
    self._oprot.writeMessageBegin('addStoreToCart', TMessageType.CALL, self._seqid)
-
 
2116
    args = addStoreToCart_args()
-
 
2117
    args.cartId = cartId
-
 
2118
    args.storeId = storeId
-
 
2119
    args.write(self._oprot)
-
 
2120
    self._oprot.writeMessageEnd()
-
 
2121
    self._oprot.trans.flush()
-
 
2122
 
-
 
2123
  def recv_addStoreToCart(self, ):
-
 
2124
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2125
    if mtype == TMessageType.EXCEPTION:
-
 
2126
      x = TApplicationException()
-
 
2127
      x.read(self._iprot)
-
 
2128
      self._iprot.readMessageEnd()
-
 
2129
      raise x
-
 
2130
    result = addStoreToCart_result()
-
 
2131
    result.read(self._iprot)
-
 
2132
    self._iprot.readMessageEnd()
-
 
2133
    if result.scx is not None:
-
 
2134
      raise result.scx
-
 
2135
    return
-
 
2136
 
2097
  def applyCouponToCart(self, cartId, couponCode, totalPrice, discountedPrice):
2137
  def applyCouponToCart(self, cartId, couponCode, totalPrice, discountedPrice):
2098
    """
2138
    """
2099
    Parameters:
2139
    Parameters:
2100
     - cartId
2140
     - cartId
2101
     - couponCode
2141
     - couponCode
Line 2886... Line 2926...
2886
    self._processMap["getCart"] = Processor.process_getCart
2926
    self._processMap["getCart"] = Processor.process_getCart
2887
    self._processMap["getCartsByTime"] = Processor.process_getCartsByTime
2927
    self._processMap["getCartsByTime"] = Processor.process_getCartsByTime
2888
    self._processMap["addItemToCart"] = Processor.process_addItemToCart
2928
    self._processMap["addItemToCart"] = Processor.process_addItemToCart
2889
    self._processMap["deleteItemFromCart"] = Processor.process_deleteItemFromCart
2929
    self._processMap["deleteItemFromCart"] = Processor.process_deleteItemFromCart
2890
    self._processMap["addAddressToCart"] = Processor.process_addAddressToCart
2930
    self._processMap["addAddressToCart"] = Processor.process_addAddressToCart
-
 
2931
    self._processMap["addStoreToCart"] = Processor.process_addStoreToCart
2891
    self._processMap["applyCouponToCart"] = Processor.process_applyCouponToCart
2932
    self._processMap["applyCouponToCart"] = Processor.process_applyCouponToCart
2892
    self._processMap["removeCoupon"] = Processor.process_removeCoupon
2933
    self._processMap["removeCoupon"] = Processor.process_removeCoupon
2893
    self._processMap["deleteDiscountsFromCart"] = Processor.process_deleteDiscountsFromCart
2934
    self._processMap["deleteDiscountsFromCart"] = Processor.process_deleteDiscountsFromCart
2894
    self._processMap["saveDiscounts"] = Processor.process_saveDiscounts
2935
    self._processMap["saveDiscounts"] = Processor.process_saveDiscounts
2895
    self._processMap["createOrders"] = Processor.process_createOrders
2936
    self._processMap["createOrders"] = Processor.process_createOrders
Line 3554... Line 3595...
3554
    oprot.writeMessageBegin("addAddressToCart", TMessageType.REPLY, seqid)
3595
    oprot.writeMessageBegin("addAddressToCart", TMessageType.REPLY, seqid)
3555
    result.write(oprot)
3596
    result.write(oprot)
3556
    oprot.writeMessageEnd()
3597
    oprot.writeMessageEnd()
3557
    oprot.trans.flush()
3598
    oprot.trans.flush()
3558
 
3599
 
-
 
3600
  def process_addStoreToCart(self, seqid, iprot, oprot):
-
 
3601
    args = addStoreToCart_args()
-
 
3602
    args.read(iprot)
-
 
3603
    iprot.readMessageEnd()
-
 
3604
    result = addStoreToCart_result()
-
 
3605
    try:
-
 
3606
      self._handler.addStoreToCart(args.cartId, args.storeId)
-
 
3607
    except ShoppingCartException, scx:
-
 
3608
      result.scx = scx
-
 
3609
    oprot.writeMessageBegin("addStoreToCart", TMessageType.REPLY, seqid)
-
 
3610
    result.write(oprot)
-
 
3611
    oprot.writeMessageEnd()
-
 
3612
    oprot.trans.flush()
-
 
3613
 
3559
  def process_applyCouponToCart(self, seqid, iprot, oprot):
3614
  def process_applyCouponToCart(self, seqid, iprot, oprot):
3560
    args = applyCouponToCart_args()
3615
    args = applyCouponToCart_args()
3561
    args.read(iprot)
3616
    args.read(iprot)
3562
    iprot.readMessageEnd()
3617
    iprot.readMessageEnd()
3563
    result = applyCouponToCart_result()
3618
    result = applyCouponToCart_result()
Line 10233... Line 10288...
10233
    if self.scx is not None:
10288
    if self.scx is not None:
10234
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
10289
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
10235
      self.scx.write(oprot)
10290
      self.scx.write(oprot)
10236
      oprot.writeFieldEnd()
10291
      oprot.writeFieldEnd()
10237
    oprot.writeFieldStop()
10292
    oprot.writeFieldStop()
-
 
10293
    oprot.writeStructEnd()
-
 
10294
 
-
 
10295
  def validate(self):
-
 
10296
    return
-
 
10297
 
-
 
10298
 
-
 
10299
  def __repr__(self):
-
 
10300
    L = ['%s=%r' % (key, value)
-
 
10301
      for key, value in self.__dict__.iteritems()]
-
 
10302
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
10303
 
-
 
10304
  def __eq__(self, other):
-
 
10305
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
10306
 
-
 
10307
  def __ne__(self, other):
-
 
10308
    return not (self == other)
-
 
10309
 
-
 
10310
class addStoreToCart_args:
-
 
10311
  """
-
 
10312
  Attributes:
-
 
10313
   - cartId
-
 
10314
   - storeId
-
 
10315
  """
-
 
10316
 
-
 
10317
  thrift_spec = (
-
 
10318
    None, # 0
-
 
10319
    (1, TType.I64, 'cartId', None, None, ), # 1
-
 
10320
    (2, TType.I64, 'storeId', None, None, ), # 2
-
 
10321
  )
-
 
10322
 
-
 
10323
  def __init__(self, cartId=None, storeId=None,):
-
 
10324
    self.cartId = cartId
-
 
10325
    self.storeId = storeId
-
 
10326
 
-
 
10327
  def read(self, iprot):
-
 
10328
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
10329
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
10330
      return
-
 
10331
    iprot.readStructBegin()
-
 
10332
    while True:
-
 
10333
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
10334
      if ftype == TType.STOP:
-
 
10335
        break
-
 
10336
      if fid == 1:
-
 
10337
        if ftype == TType.I64:
-
 
10338
          self.cartId = iprot.readI64();
-
 
10339
        else:
-
 
10340
          iprot.skip(ftype)
-
 
10341
      elif fid == 2:
-
 
10342
        if ftype == TType.I64:
-
 
10343
          self.storeId = iprot.readI64();
-
 
10344
        else:
-
 
10345
          iprot.skip(ftype)
-
 
10346
      else:
-
 
10347
        iprot.skip(ftype)
-
 
10348
      iprot.readFieldEnd()
-
 
10349
    iprot.readStructEnd()
-
 
10350
 
-
 
10351
  def write(self, oprot):
-
 
10352
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
10353
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
10354
      return
-
 
10355
    oprot.writeStructBegin('addStoreToCart_args')
-
 
10356
    if self.cartId is not None:
-
 
10357
      oprot.writeFieldBegin('cartId', TType.I64, 1)
-
 
10358
      oprot.writeI64(self.cartId)
-
 
10359
      oprot.writeFieldEnd()
-
 
10360
    if self.storeId is not None:
-
 
10361
      oprot.writeFieldBegin('storeId', TType.I64, 2)
-
 
10362
      oprot.writeI64(self.storeId)
-
 
10363
      oprot.writeFieldEnd()
-
 
10364
    oprot.writeFieldStop()
-
 
10365
    oprot.writeStructEnd()
-
 
10366
 
-
 
10367
  def validate(self):
-
 
10368
    return
-
 
10369
 
-
 
10370
 
-
 
10371
  def __repr__(self):
-
 
10372
    L = ['%s=%r' % (key, value)
-
 
10373
      for key, value in self.__dict__.iteritems()]
-
 
10374
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
10375
 
-
 
10376
  def __eq__(self, other):
-
 
10377
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
10378
 
-
 
10379
  def __ne__(self, other):
-
 
10380
    return not (self == other)
-
 
10381
 
-
 
10382
class addStoreToCart_result:
-
 
10383
  """
-
 
10384
  Attributes:
-
 
10385
   - scx
-
 
10386
  """
-
 
10387
 
-
 
10388
  thrift_spec = (
-
 
10389
    None, # 0
-
 
10390
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
-
 
10391
  )
-
 
10392
 
-
 
10393
  def __init__(self, scx=None,):
-
 
10394
    self.scx = scx
-
 
10395
 
-
 
10396
  def read(self, iprot):
-
 
10397
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
10398
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
10399
      return
-
 
10400
    iprot.readStructBegin()
-
 
10401
    while True:
-
 
10402
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
10403
      if ftype == TType.STOP:
-
 
10404
        break
-
 
10405
      if fid == 1:
-
 
10406
        if ftype == TType.STRUCT:
-
 
10407
          self.scx = ShoppingCartException()
-
 
10408
          self.scx.read(iprot)
-
 
10409
        else:
-
 
10410
          iprot.skip(ftype)
-
 
10411
      else:
-
 
10412
        iprot.skip(ftype)
-
 
10413
      iprot.readFieldEnd()
-
 
10414
    iprot.readStructEnd()
-
 
10415
 
-
 
10416
  def write(self, oprot):
-
 
10417
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
10418
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
10419
      return
-
 
10420
    oprot.writeStructBegin('addStoreToCart_result')
-
 
10421
    if self.scx is not None:
-
 
10422
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
-
 
10423
      self.scx.write(oprot)
-
 
10424
      oprot.writeFieldEnd()
-
 
10425
    oprot.writeFieldStop()
10238
    oprot.writeStructEnd()
10426
    oprot.writeStructEnd()
10239
 
10427
 
10240
  def validate(self):
10428
  def validate(self):
10241
    return
10429
    return
10242
 
10430