Subversion Repositories SmartDukaan

Rev

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

Rev 3557 Rev 3563
Line 384... Line 384...
384
     - cartId
384
     - cartId
385
     - itemId
385
     - itemId
386
    """
386
    """
387
    pass
387
    pass
388
 
388
 
389
  def changeQuantity(self, cartId, itemId, quantity):
-
 
390
    """
-
 
391
    Parameters:
-
 
392
     - cartId
-
 
393
     - itemId
-
 
394
     - quantity
-
 
395
    """
-
 
396
    pass
-
 
397
 
-
 
398
  def changeItemStatus(self, cartId, itemId, status):
389
  def changeItemStatus(self, cartId, itemId, status):
399
    """
390
    """
400
    Parameters:
391
    Parameters:
401
     - cartId
392
     - cartId
402
     - itemId
393
     - itemId
Line 2217... Line 2208...
2217
    self._iprot.readMessageEnd()
2208
    self._iprot.readMessageEnd()
2218
    if result.scx is not None:
2209
    if result.scx is not None:
2219
      raise result.scx
2210
      raise result.scx
2220
    return
2211
    return
2221
 
2212
 
2222
  def changeQuantity(self, cartId, itemId, quantity):
-
 
2223
    """
-
 
2224
    Parameters:
-
 
2225
     - cartId
-
 
2226
     - itemId
-
 
2227
     - quantity
-
 
2228
    """
-
 
2229
    self.send_changeQuantity(cartId, itemId, quantity)
-
 
2230
    self.recv_changeQuantity()
-
 
2231
 
-
 
2232
  def send_changeQuantity(self, cartId, itemId, quantity):
-
 
2233
    self._oprot.writeMessageBegin('changeQuantity', TMessageType.CALL, self._seqid)
-
 
2234
    args = changeQuantity_args()
-
 
2235
    args.cartId = cartId
-
 
2236
    args.itemId = itemId
-
 
2237
    args.quantity = quantity
-
 
2238
    args.write(self._oprot)
-
 
2239
    self._oprot.writeMessageEnd()
-
 
2240
    self._oprot.trans.flush()
-
 
2241
 
-
 
2242
  def recv_changeQuantity(self, ):
-
 
2243
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2244
    if mtype == TMessageType.EXCEPTION:
-
 
2245
      x = TApplicationException()
-
 
2246
      x.read(self._iprot)
-
 
2247
      self._iprot.readMessageEnd()
-
 
2248
      raise x
-
 
2249
    result = changeQuantity_result()
-
 
2250
    result.read(self._iprot)
-
 
2251
    self._iprot.readMessageEnd()
-
 
2252
    if result.scx is not None:
-
 
2253
      raise result.scx
-
 
2254
    return
-
 
2255
 
-
 
2256
  def changeItemStatus(self, cartId, itemId, status):
2213
  def changeItemStatus(self, cartId, itemId, status):
2257
    """
2214
    """
2258
    Parameters:
2215
    Parameters:
2259
     - cartId
2216
     - cartId
2260
     - itemId
2217
     - itemId
Line 3040... Line 2997...
3040
    self._processMap["getCartsByStatus"] = Processor.process_getCartsByStatus
2997
    self._processMap["getCartsByStatus"] = Processor.process_getCartsByStatus
3041
    self._processMap["getCartsByTime"] = Processor.process_getCartsByTime
2998
    self._processMap["getCartsByTime"] = Processor.process_getCartsByTime
3042
    self._processMap["changeCartStatus"] = Processor.process_changeCartStatus
2999
    self._processMap["changeCartStatus"] = Processor.process_changeCartStatus
3043
    self._processMap["addItemToCart"] = Processor.process_addItemToCart
3000
    self._processMap["addItemToCart"] = Processor.process_addItemToCart
3044
    self._processMap["deleteItemFromCart"] = Processor.process_deleteItemFromCart
3001
    self._processMap["deleteItemFromCart"] = Processor.process_deleteItemFromCart
3045
    self._processMap["changeQuantity"] = Processor.process_changeQuantity
-
 
3046
    self._processMap["changeItemStatus"] = Processor.process_changeItemStatus
3002
    self._processMap["changeItemStatus"] = Processor.process_changeItemStatus
3047
    self._processMap["addAddressToCart"] = Processor.process_addAddressToCart
3003
    self._processMap["addAddressToCart"] = Processor.process_addAddressToCart
3048
    self._processMap["applyCouponToCart"] = Processor.process_applyCouponToCart
3004
    self._processMap["applyCouponToCart"] = Processor.process_applyCouponToCart
3049
    self._processMap["removeCoupon"] = Processor.process_removeCoupon
3005
    self._processMap["removeCoupon"] = Processor.process_removeCoupon
3050
    self._processMap["deleteDiscountsFromCart"] = Processor.process_deleteDiscountsFromCart
3006
    self._processMap["deleteDiscountsFromCart"] = Processor.process_deleteDiscountsFromCart
Line 3751... Line 3707...
3751
    oprot.writeMessageBegin("deleteItemFromCart", TMessageType.REPLY, seqid)
3707
    oprot.writeMessageBegin("deleteItemFromCart", TMessageType.REPLY, seqid)
3752
    result.write(oprot)
3708
    result.write(oprot)
3753
    oprot.writeMessageEnd()
3709
    oprot.writeMessageEnd()
3754
    oprot.trans.flush()
3710
    oprot.trans.flush()
3755
 
3711
 
3756
  def process_changeQuantity(self, seqid, iprot, oprot):
-
 
3757
    args = changeQuantity_args()
-
 
3758
    args.read(iprot)
-
 
3759
    iprot.readMessageEnd()
-
 
3760
    result = changeQuantity_result()
-
 
3761
    try:
-
 
3762
      self._handler.changeQuantity(args.cartId, args.itemId, args.quantity)
-
 
3763
    except ShoppingCartException, scx:
-
 
3764
      result.scx = scx
-
 
3765
    oprot.writeMessageBegin("changeQuantity", TMessageType.REPLY, seqid)
-
 
3766
    result.write(oprot)
-
 
3767
    oprot.writeMessageEnd()
-
 
3768
    oprot.trans.flush()
-
 
3769
 
-
 
3770
  def process_changeItemStatus(self, seqid, iprot, oprot):
3712
  def process_changeItemStatus(self, seqid, iprot, oprot):
3771
    args = changeItemStatus_args()
3713
    args = changeItemStatus_args()
3772
    args.read(iprot)
3714
    args.read(iprot)
3773
    iprot.readMessageEnd()
3715
    iprot.readMessageEnd()
3774
    result = changeItemStatus_result()
3716
    result = changeItemStatus_result()
Line 10887... Line 10829...
10887
    if self.scx is not None:
10829
    if self.scx is not None:
10888
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
10830
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
10889
      self.scx.write(oprot)
10831
      self.scx.write(oprot)
10890
      oprot.writeFieldEnd()
10832
      oprot.writeFieldEnd()
10891
    oprot.writeFieldStop()
10833
    oprot.writeFieldStop()
10892
    oprot.writeStructEnd()
-
 
10893
 
-
 
10894
  def validate(self):
-
 
10895
    return
-
 
10896
 
-
 
10897
 
-
 
10898
  def __repr__(self):
-
 
10899
    L = ['%s=%r' % (key, value)
-
 
10900
      for key, value in self.__dict__.iteritems()]
-
 
10901
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
10902
 
-
 
10903
  def __eq__(self, other):
-
 
10904
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
10905
 
-
 
10906
  def __ne__(self, other):
-
 
10907
    return not (self == other)
-
 
10908
 
-
 
10909
class changeQuantity_args:
-
 
10910
  """
-
 
10911
  Attributes:
-
 
10912
   - cartId
-
 
10913
   - itemId
-
 
10914
   - quantity
-
 
10915
  """
-
 
10916
 
-
 
10917
  thrift_spec = (
-
 
10918
    None, # 0
-
 
10919
    (1, TType.I64, 'cartId', None, None, ), # 1
-
 
10920
    (2, TType.I64, 'itemId', None, None, ), # 2
-
 
10921
    (3, TType.I64, 'quantity', None, None, ), # 3
-
 
10922
  )
-
 
10923
 
-
 
10924
  def __init__(self, cartId=None, itemId=None, quantity=None,):
-
 
10925
    self.cartId = cartId
-
 
10926
    self.itemId = itemId
-
 
10927
    self.quantity = quantity
-
 
10928
 
-
 
10929
  def read(self, iprot):
-
 
10930
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
10931
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
10932
      return
-
 
10933
    iprot.readStructBegin()
-
 
10934
    while True:
-
 
10935
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
10936
      if ftype == TType.STOP:
-
 
10937
        break
-
 
10938
      if fid == 1:
-
 
10939
        if ftype == TType.I64:
-
 
10940
          self.cartId = iprot.readI64();
-
 
10941
        else:
-
 
10942
          iprot.skip(ftype)
-
 
10943
      elif fid == 2:
-
 
10944
        if ftype == TType.I64:
-
 
10945
          self.itemId = iprot.readI64();
-
 
10946
        else:
-
 
10947
          iprot.skip(ftype)
-
 
10948
      elif fid == 3:
-
 
10949
        if ftype == TType.I64:
-
 
10950
          self.quantity = iprot.readI64();
-
 
10951
        else:
-
 
10952
          iprot.skip(ftype)
-
 
10953
      else:
-
 
10954
        iprot.skip(ftype)
-
 
10955
      iprot.readFieldEnd()
-
 
10956
    iprot.readStructEnd()
-
 
10957
 
-
 
10958
  def write(self, oprot):
-
 
10959
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
10960
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
10961
      return
-
 
10962
    oprot.writeStructBegin('changeQuantity_args')
-
 
10963
    if self.cartId is not None:
-
 
10964
      oprot.writeFieldBegin('cartId', TType.I64, 1)
-
 
10965
      oprot.writeI64(self.cartId)
-
 
10966
      oprot.writeFieldEnd()
-
 
10967
    if self.itemId is not None:
-
 
10968
      oprot.writeFieldBegin('itemId', TType.I64, 2)
-
 
10969
      oprot.writeI64(self.itemId)
-
 
10970
      oprot.writeFieldEnd()
-
 
10971
    if self.quantity is not None:
-
 
10972
      oprot.writeFieldBegin('quantity', TType.I64, 3)
-
 
10973
      oprot.writeI64(self.quantity)
-
 
10974
      oprot.writeFieldEnd()
-
 
10975
    oprot.writeFieldStop()
-
 
10976
    oprot.writeStructEnd()
-
 
10977
 
-
 
10978
  def validate(self):
-
 
10979
    return
-
 
10980
 
-
 
10981
 
-
 
10982
  def __repr__(self):
-
 
10983
    L = ['%s=%r' % (key, value)
-
 
10984
      for key, value in self.__dict__.iteritems()]
-
 
10985
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
10986
 
-
 
10987
  def __eq__(self, other):
-
 
10988
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
10989
 
-
 
10990
  def __ne__(self, other):
-
 
10991
    return not (self == other)
-
 
10992
 
-
 
10993
class changeQuantity_result:
-
 
10994
  """
-
 
10995
  Attributes:
-
 
10996
   - scx
-
 
10997
  """
-
 
10998
 
-
 
10999
  thrift_spec = (
-
 
11000
    None, # 0
-
 
11001
    (1, TType.STRUCT, 'scx', (ShoppingCartException, ShoppingCartException.thrift_spec), None, ), # 1
-
 
11002
  )
-
 
11003
 
-
 
11004
  def __init__(self, scx=None,):
-
 
11005
    self.scx = scx
-
 
11006
 
-
 
11007
  def read(self, iprot):
-
 
11008
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11009
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11010
      return
-
 
11011
    iprot.readStructBegin()
-
 
11012
    while True:
-
 
11013
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11014
      if ftype == TType.STOP:
-
 
11015
        break
-
 
11016
      if fid == 1:
-
 
11017
        if ftype == TType.STRUCT:
-
 
11018
          self.scx = ShoppingCartException()
-
 
11019
          self.scx.read(iprot)
-
 
11020
        else:
-
 
11021
          iprot.skip(ftype)
-
 
11022
      else:
-
 
11023
        iprot.skip(ftype)
-
 
11024
      iprot.readFieldEnd()
-
 
11025
    iprot.readStructEnd()
-
 
11026
 
-
 
11027
  def write(self, oprot):
-
 
11028
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11029
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11030
      return
-
 
11031
    oprot.writeStructBegin('changeQuantity_result')
-
 
11032
    if self.scx is not None:
-
 
11033
      oprot.writeFieldBegin('scx', TType.STRUCT, 1)
-
 
11034
      self.scx.write(oprot)
-
 
11035
      oprot.writeFieldEnd()
-
 
11036
    oprot.writeFieldStop()
-
 
11037
    oprot.writeStructEnd()
10834
    oprot.writeStructEnd()
11038
 
10835
 
11039
  def validate(self):
10836
  def validate(self):
11040
    return
10837
    return
11041
 
10838