Subversion Repositories SmartDukaan

Rev

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

Rev 6903 Rev 6922
Line 370... Line 370...
370
     - cartId
370
     - cartId
371
     - storeId
371
     - storeId
372
    """
372
    """
373
    pass
373
    pass
374
 
374
 
375
  def applyCouponToCart(self, cartId, couponCode, totalPrice, discountedPrice):
375
  def applyCouponToCart(self, cart, couponCode):
376
    """
376
    """
377
    Parameters:
377
    Parameters:
378
     - cartId
378
     - cart
379
     - couponCode
379
     - couponCode
380
     - totalPrice
-
 
381
     - discountedPrice
-
 
382
    """
380
    """
383
    pass
381
    pass
384
 
382
 
385
  def removeCoupon(self, cartId):
383
  def removeCoupon(self, cartId):
386
    """
384
    """
Line 2176... Line 2174...
2176
    self._iprot.readMessageEnd()
2174
    self._iprot.readMessageEnd()
2177
    if result.scx is not None:
2175
    if result.scx is not None:
2178
      raise result.scx
2176
      raise result.scx
2179
    return
2177
    return
2180
 
2178
 
2181
  def applyCouponToCart(self, cartId, couponCode, totalPrice, discountedPrice):
2179
  def applyCouponToCart(self, cart, couponCode):
2182
    """
2180
    """
2183
    Parameters:
2181
    Parameters:
2184
     - cartId
2182
     - cart
2185
     - couponCode
2183
     - couponCode
2186
     - totalPrice
-
 
2187
     - discountedPrice
-
 
2188
    """
2184
    """
2189
    self.send_applyCouponToCart(cartId, couponCode, totalPrice, discountedPrice)
2185
    self.send_applyCouponToCart(cart, couponCode)
2190
    self.recv_applyCouponToCart()
2186
    self.recv_applyCouponToCart()
2191
 
2187
 
2192
  def send_applyCouponToCart(self, cartId, couponCode, totalPrice, discountedPrice):
2188
  def send_applyCouponToCart(self, cart, couponCode):
2193
    self._oprot.writeMessageBegin('applyCouponToCart', TMessageType.CALL, self._seqid)
2189
    self._oprot.writeMessageBegin('applyCouponToCart', TMessageType.CALL, self._seqid)
2194
    args = applyCouponToCart_args()
2190
    args = applyCouponToCart_args()
2195
    args.cartId = cartId
2191
    args.cart = cart
2196
    args.couponCode = couponCode
2192
    args.couponCode = couponCode
2197
    args.totalPrice = totalPrice
-
 
2198
    args.discountedPrice = discountedPrice
-
 
2199
    args.write(self._oprot)
2193
    args.write(self._oprot)
2200
    self._oprot.writeMessageEnd()
2194
    self._oprot.writeMessageEnd()
2201
    self._oprot.trans.flush()
2195
    self._oprot.trans.flush()
2202
 
2196
 
2203
  def recv_applyCouponToCart(self, ):
2197
  def recv_applyCouponToCart(self, ):
Line 3805... Line 3799...
3805
    args = applyCouponToCart_args()
3799
    args = applyCouponToCart_args()
3806
    args.read(iprot)
3800
    args.read(iprot)
3807
    iprot.readMessageEnd()
3801
    iprot.readMessageEnd()
3808
    result = applyCouponToCart_result()
3802
    result = applyCouponToCart_result()
3809
    try:
3803
    try:
3810
      self._handler.applyCouponToCart(args.cartId, args.couponCode, args.totalPrice, args.discountedPrice)
3804
      self._handler.applyCouponToCart(args.cart, args.couponCode)
3811
    except ShoppingCartException, scx:
3805
    except ShoppingCartException, scx:
3812
      result.scx = scx
3806
      result.scx = scx
3813
    oprot.writeMessageBegin("applyCouponToCart", TMessageType.REPLY, seqid)
3807
    oprot.writeMessageBegin("applyCouponToCart", TMessageType.REPLY, seqid)
3814
    result.write(oprot)
3808
    result.write(oprot)
3815
    oprot.writeMessageEnd()
3809
    oprot.writeMessageEnd()
Line 10675... Line 10669...
10675
    return not (self == other)
10669
    return not (self == other)
10676
 
10670
 
10677
class applyCouponToCart_args:
10671
class applyCouponToCart_args:
10678
  """
10672
  """
10679
  Attributes:
10673
  Attributes:
10680
   - cartId
10674
   - cart
10681
   - couponCode
10675
   - couponCode
10682
   - totalPrice
-
 
10683
   - discountedPrice
-
 
10684
  """
10676
  """
10685
 
10677
 
10686
  thrift_spec = (
10678
  thrift_spec = (
10687
    None, # 0
10679
    None, # 0
10688
    (1, TType.I64, 'cartId', None, None, ), # 1
10680
    (1, TType.STRUCT, 'cart', (Cart, Cart.thrift_spec), None, ), # 1
10689
    (2, TType.STRING, 'couponCode', None, None, ), # 2
10681
    (2, TType.STRING, 'couponCode', None, None, ), # 2
10690
    (3, TType.DOUBLE, 'totalPrice', None, None, ), # 3
-
 
10691
    (4, TType.DOUBLE, 'discountedPrice', None, None, ), # 4
-
 
10692
  )
10682
  )
10693
 
10683
 
10694
  def __init__(self, cartId=None, couponCode=None, totalPrice=None, discountedPrice=None,):
10684
  def __init__(self, cart=None, couponCode=None,):
10695
    self.cartId = cartId
10685
    self.cart = cart
10696
    self.couponCode = couponCode
10686
    self.couponCode = couponCode
10697
    self.totalPrice = totalPrice
-
 
10698
    self.discountedPrice = discountedPrice
-
 
10699
 
10687
 
10700
  def read(self, iprot):
10688
  def read(self, iprot):
10701
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
10689
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
10702
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
10690
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
10703
      return
10691
      return
Line 10705... Line 10693...
10705
    while True:
10693
    while True:
10706
      (fname, ftype, fid) = iprot.readFieldBegin()
10694
      (fname, ftype, fid) = iprot.readFieldBegin()
10707
      if ftype == TType.STOP:
10695
      if ftype == TType.STOP:
10708
        break
10696
        break
10709
      if fid == 1:
10697
      if fid == 1:
10710
        if ftype == TType.I64:
10698
        if ftype == TType.STRUCT:
10711
          self.cartId = iprot.readI64();
10699
          self.cart = Cart()
-
 
10700
          self.cart.read(iprot)
10712
        else:
10701
        else:
10713
          iprot.skip(ftype)
10702
          iprot.skip(ftype)
10714
      elif fid == 2:
10703
      elif fid == 2:
10715
        if ftype == TType.STRING:
10704
        if ftype == TType.STRING:
10716
          self.couponCode = iprot.readString();
10705
          self.couponCode = iprot.readString();
10717
        else:
10706
        else:
10718
          iprot.skip(ftype)
10707
          iprot.skip(ftype)
10719
      elif fid == 3:
-
 
10720
        if ftype == TType.DOUBLE:
-
 
10721
          self.totalPrice = iprot.readDouble();
-
 
10722
        else:
-
 
10723
          iprot.skip(ftype)
-
 
10724
      elif fid == 4:
-
 
10725
        if ftype == TType.DOUBLE:
-
 
10726
          self.discountedPrice = iprot.readDouble();
-
 
10727
        else:
-
 
10728
          iprot.skip(ftype)
-
 
10729
      else:
10708
      else:
10730
        iprot.skip(ftype)
10709
        iprot.skip(ftype)
10731
      iprot.readFieldEnd()
10710
      iprot.readFieldEnd()
10732
    iprot.readStructEnd()
10711
    iprot.readStructEnd()
10733
 
10712
 
10734
  def write(self, oprot):
10713
  def write(self, oprot):
10735
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
10714
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
10736
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
10715
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
10737
      return
10716
      return
10738
    oprot.writeStructBegin('applyCouponToCart_args')
10717
    oprot.writeStructBegin('applyCouponToCart_args')
10739
    if self.cartId is not None:
10718
    if self.cart is not None:
10740
      oprot.writeFieldBegin('cartId', TType.I64, 1)
10719
      oprot.writeFieldBegin('cart', TType.STRUCT, 1)
10741
      oprot.writeI64(self.cartId)
10720
      self.cart.write(oprot)
10742
      oprot.writeFieldEnd()
10721
      oprot.writeFieldEnd()
10743
    if self.couponCode is not None:
10722
    if self.couponCode is not None:
10744
      oprot.writeFieldBegin('couponCode', TType.STRING, 2)
10723
      oprot.writeFieldBegin('couponCode', TType.STRING, 2)
10745
      oprot.writeString(self.couponCode)
10724
      oprot.writeString(self.couponCode)
10746
      oprot.writeFieldEnd()
10725
      oprot.writeFieldEnd()
10747
    if self.totalPrice is not None:
-
 
10748
      oprot.writeFieldBegin('totalPrice', TType.DOUBLE, 3)
-
 
10749
      oprot.writeDouble(self.totalPrice)
-
 
10750
      oprot.writeFieldEnd()
-
 
10751
    if self.discountedPrice is not None:
-
 
10752
      oprot.writeFieldBegin('discountedPrice', TType.DOUBLE, 4)
-
 
10753
      oprot.writeDouble(self.discountedPrice)
-
 
10754
      oprot.writeFieldEnd()
-
 
10755
    oprot.writeFieldStop()
10726
    oprot.writeFieldStop()
10756
    oprot.writeStructEnd()
10727
    oprot.writeStructEnd()
10757
 
10728
 
10758
  def validate(self):
10729
  def validate(self):
10759
    return
10730
    return