Subversion Repositories SmartDukaan

Rev

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

Rev 9299 Rev 9791
Line 626... Line 626...
626
    Parameters:
626
    Parameters:
627
     - addressId
627
     - addressId
628
    """
628
    """
629
    pass
629
    pass
630
 
630
 
631
  def isProductAddedToCart(self, itemId, startDate, endDate):
631
  def getProductsAddedToCart(self, startDate, endDate):
632
    """
632
    """
633
    Returns whether product is added to cart from startDate to endDate
633
    Returns list of item ids which added to cart from startDate to endDate
634
 
634
 
635
    Parameters:
635
    Parameters:
636
     - itemId
-
 
637
     - startDate
636
     - startDate
638
     - endDate
637
     - endDate
639
    """
638
    """
640
    pass
639
    pass
641
 
640
 
Line 3024... Line 3023...
3024
    self._iprot.readMessageEnd()
3023
    self._iprot.readMessageEnd()
3025
    if result.success is not None:
3024
    if result.success is not None:
3026
      return result.success
3025
      return result.success
3027
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isInsuranceDetailPresent failed: unknown result");
3026
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isInsuranceDetailPresent failed: unknown result");
3028
 
3027
 
3029
  def isProductAddedToCart(self, itemId, startDate, endDate):
3028
  def getProductsAddedToCart(self, startDate, endDate):
3030
    """
3029
    """
3031
    Returns whether product is added to cart from startDate to endDate
3030
    Returns list of item ids which added to cart from startDate to endDate
3032
 
3031
 
3033
    Parameters:
3032
    Parameters:
3034
     - itemId
-
 
3035
     - startDate
3033
     - startDate
3036
     - endDate
3034
     - endDate
3037
    """
3035
    """
3038
    self.send_isProductAddedToCart(itemId, startDate, endDate)
3036
    self.send_getProductsAddedToCart(startDate, endDate)
3039
    return self.recv_isProductAddedToCart()
3037
    return self.recv_getProductsAddedToCart()
3040
 
3038
 
3041
  def send_isProductAddedToCart(self, itemId, startDate, endDate):
3039
  def send_getProductsAddedToCart(self, startDate, endDate):
3042
    self._oprot.writeMessageBegin('isProductAddedToCart', TMessageType.CALL, self._seqid)
3040
    self._oprot.writeMessageBegin('getProductsAddedToCart', TMessageType.CALL, self._seqid)
3043
    args = isProductAddedToCart_args()
3041
    args = getProductsAddedToCart_args()
3044
    args.itemId = itemId
-
 
3045
    args.startDate = startDate
3042
    args.startDate = startDate
3046
    args.endDate = endDate
3043
    args.endDate = endDate
3047
    args.write(self._oprot)
3044
    args.write(self._oprot)
3048
    self._oprot.writeMessageEnd()
3045
    self._oprot.writeMessageEnd()
3049
    self._oprot.trans.flush()
3046
    self._oprot.trans.flush()
3050
 
3047
 
3051
  def recv_isProductAddedToCart(self, ):
3048
  def recv_getProductsAddedToCart(self, ):
3052
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
3049
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
3053
    if mtype == TMessageType.EXCEPTION:
3050
    if mtype == TMessageType.EXCEPTION:
3054
      x = TApplicationException()
3051
      x = TApplicationException()
3055
      x.read(self._iprot)
3052
      x.read(self._iprot)
3056
      self._iprot.readMessageEnd()
3053
      self._iprot.readMessageEnd()
3057
      raise x
3054
      raise x
3058
    result = isProductAddedToCart_result()
3055
    result = getProductsAddedToCart_result()
3059
    result.read(self._iprot)
3056
    result.read(self._iprot)
3060
    self._iprot.readMessageEnd()
3057
    self._iprot.readMessageEnd()
3061
    if result.success is not None:
3058
    if result.success is not None:
3062
      return result.success
3059
      return result.success
3063
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isProductAddedToCart failed: unknown result");
3060
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getProductsAddedToCart failed: unknown result");
3064
 
3061
 
3065
 
3062
 
3066
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3063
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3067
  def __init__(self, handler):
3064
  def __init__(self, handler):
3068
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3065
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
Line 3135... Line 3132...
3135
    self._processMap["getUserEmails"] = Processor.process_getUserEmails
3132
    self._processMap["getUserEmails"] = Processor.process_getUserEmails
3136
    self._processMap["insureItem"] = Processor.process_insureItem
3133
    self._processMap["insureItem"] = Processor.process_insureItem
3137
    self._processMap["cancelInsurance"] = Processor.process_cancelInsurance
3134
    self._processMap["cancelInsurance"] = Processor.process_cancelInsurance
3138
    self._processMap["storeInsuranceSpecificDetails"] = Processor.process_storeInsuranceSpecificDetails
3135
    self._processMap["storeInsuranceSpecificDetails"] = Processor.process_storeInsuranceSpecificDetails
3139
    self._processMap["isInsuranceDetailPresent"] = Processor.process_isInsuranceDetailPresent
3136
    self._processMap["isInsuranceDetailPresent"] = Processor.process_isInsuranceDetailPresent
3140
    self._processMap["isProductAddedToCart"] = Processor.process_isProductAddedToCart
3137
    self._processMap["getProductsAddedToCart"] = Processor.process_getProductsAddedToCart
3141
 
3138
 
3142
  def process(self, iprot, oprot):
3139
  def process(self, iprot, oprot):
3143
    (name, type, seqid) = iprot.readMessageBegin()
3140
    (name, type, seqid) = iprot.readMessageBegin()
3144
    if name not in self._processMap:
3141
    if name not in self._processMap:
3145
      iprot.skip(TType.STRUCT)
3142
      iprot.skip(TType.STRUCT)
Line 4103... Line 4100...
4103
    oprot.writeMessageBegin("isInsuranceDetailPresent", TMessageType.REPLY, seqid)
4100
    oprot.writeMessageBegin("isInsuranceDetailPresent", TMessageType.REPLY, seqid)
4104
    result.write(oprot)
4101
    result.write(oprot)
4105
    oprot.writeMessageEnd()
4102
    oprot.writeMessageEnd()
4106
    oprot.trans.flush()
4103
    oprot.trans.flush()
4107
 
4104
 
4108
  def process_isProductAddedToCart(self, seqid, iprot, oprot):
4105
  def process_getProductsAddedToCart(self, seqid, iprot, oprot):
4109
    args = isProductAddedToCart_args()
4106
    args = getProductsAddedToCart_args()
4110
    args.read(iprot)
4107
    args.read(iprot)
4111
    iprot.readMessageEnd()
4108
    iprot.readMessageEnd()
4112
    result = isProductAddedToCart_result()
4109
    result = getProductsAddedToCart_result()
4113
    result.success = self._handler.isProductAddedToCart(args.itemId, args.startDate, args.endDate)
4110
    result.success = self._handler.getProductsAddedToCart(args.startDate, args.endDate)
4114
    oprot.writeMessageBegin("isProductAddedToCart", TMessageType.REPLY, seqid)
4111
    oprot.writeMessageBegin("getProductsAddedToCart", TMessageType.REPLY, seqid)
4115
    result.write(oprot)
4112
    result.write(oprot)
4116
    oprot.writeMessageEnd()
4113
    oprot.writeMessageEnd()
4117
    oprot.trans.flush()
4114
    oprot.trans.flush()
4118
 
4115
 
4119
 
4116
 
Line 14001... Line 13998...
14001
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
13998
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
14002
 
13999
 
14003
  def __ne__(self, other):
14000
  def __ne__(self, other):
14004
    return not (self == other)
14001
    return not (self == other)
14005
 
14002
 
14006
class isProductAddedToCart_args:
14003
class getProductsAddedToCart_args:
14007
  """
14004
  """
14008
  Attributes:
14005
  Attributes:
14009
   - itemId
-
 
14010
   - startDate
14006
   - startDate
14011
   - endDate
14007
   - endDate
14012
  """
14008
  """
14013
 
14009
 
14014
  thrift_spec = (
14010
  thrift_spec = (
14015
    None, # 0
14011
    None, # 0
14016
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
14017
    (2, TType.I64, 'startDate', None, None, ), # 2
14012
    (1, TType.I64, 'startDate', None, None, ), # 1
14018
    (3, TType.I64, 'endDate', None, None, ), # 3
14013
    (2, TType.I64, 'endDate', None, None, ), # 2
14019
  )
14014
  )
14020
 
14015
 
14021
  def __init__(self, itemId=None, startDate=None, endDate=None,):
14016
  def __init__(self, startDate=None, endDate=None,):
14022
    self.itemId = itemId
-
 
14023
    self.startDate = startDate
14017
    self.startDate = startDate
14024
    self.endDate = endDate
14018
    self.endDate = endDate
14025
 
14019
 
14026
  def read(self, iprot):
14020
  def read(self, iprot):
14027
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
14021
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
Line 14032... Line 14026...
14032
      (fname, ftype, fid) = iprot.readFieldBegin()
14026
      (fname, ftype, fid) = iprot.readFieldBegin()
14033
      if ftype == TType.STOP:
14027
      if ftype == TType.STOP:
14034
        break
14028
        break
14035
      if fid == 1:
14029
      if fid == 1:
14036
        if ftype == TType.I64:
14030
        if ftype == TType.I64:
14037
          self.itemId = iprot.readI64();
-
 
14038
        else:
-
 
14039
          iprot.skip(ftype)
-
 
14040
      elif fid == 2:
-
 
14041
        if ftype == TType.I64:
-
 
14042
          self.startDate = iprot.readI64();
14031
          self.startDate = iprot.readI64();
14043
        else:
14032
        else:
14044
          iprot.skip(ftype)
14033
          iprot.skip(ftype)
14045
      elif fid == 3:
14034
      elif fid == 2:
14046
        if ftype == TType.I64:
14035
        if ftype == TType.I64:
14047
          self.endDate = iprot.readI64();
14036
          self.endDate = iprot.readI64();
14048
        else:
14037
        else:
14049
          iprot.skip(ftype)
14038
          iprot.skip(ftype)
14050
      else:
14039
      else:
Line 14054... Line 14043...
14054
 
14043
 
14055
  def write(self, oprot):
14044
  def write(self, oprot):
14056
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
14045
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
14057
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
14046
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
14058
      return
14047
      return
14059
    oprot.writeStructBegin('isProductAddedToCart_args')
14048
    oprot.writeStructBegin('getProductsAddedToCart_args')
14060
    if self.itemId is not None:
-
 
14061
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
14062
      oprot.writeI64(self.itemId)
-
 
14063
      oprot.writeFieldEnd()
-
 
14064
    if self.startDate is not None:
14049
    if self.startDate is not None:
14065
      oprot.writeFieldBegin('startDate', TType.I64, 2)
14050
      oprot.writeFieldBegin('startDate', TType.I64, 1)
14066
      oprot.writeI64(self.startDate)
14051
      oprot.writeI64(self.startDate)
14067
      oprot.writeFieldEnd()
14052
      oprot.writeFieldEnd()
14068
    if self.endDate is not None:
14053
    if self.endDate is not None:
14069
      oprot.writeFieldBegin('endDate', TType.I64, 3)
14054
      oprot.writeFieldBegin('endDate', TType.I64, 2)
14070
      oprot.writeI64(self.endDate)
14055
      oprot.writeI64(self.endDate)
14071
      oprot.writeFieldEnd()
14056
      oprot.writeFieldEnd()
14072
    oprot.writeFieldStop()
14057
    oprot.writeFieldStop()
14073
    oprot.writeStructEnd()
14058
    oprot.writeStructEnd()
14074
 
14059
 
Line 14085... Line 14070...
14085
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
14070
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
14086
 
14071
 
14087
  def __ne__(self, other):
14072
  def __ne__(self, other):
14088
    return not (self == other)
14073
    return not (self == other)
14089
 
14074
 
14090
class isProductAddedToCart_result:
14075
class getProductsAddedToCart_result:
14091
  """
14076
  """
14092
  Attributes:
14077
  Attributes:
14093
   - success
14078
   - success
14094
  """
14079
  """
14095
 
14080
 
14096
  thrift_spec = (
14081
  thrift_spec = (
14097
    (0, TType.BOOL, 'success', None, None, ), # 0
14082
    (0, TType.LIST, 'success', (TType.I64,None), None, ), # 0
14098
  )
14083
  )
14099
 
14084
 
14100
  def __init__(self, success=None,):
14085
  def __init__(self, success=None,):
14101
    self.success = success
14086
    self.success = success
14102
 
14087
 
Line 14108... Line 14093...
14108
    while True:
14093
    while True:
14109
      (fname, ftype, fid) = iprot.readFieldBegin()
14094
      (fname, ftype, fid) = iprot.readFieldBegin()
14110
      if ftype == TType.STOP:
14095
      if ftype == TType.STOP:
14111
        break
14096
        break
14112
      if fid == 0:
14097
      if fid == 0:
14113
        if ftype == TType.BOOL:
14098
        if ftype == TType.LIST:
-
 
14099
          self.success = []
-
 
14100
          (_etype207, _size204) = iprot.readListBegin()
-
 
14101
          for _i208 in xrange(_size204):
14114
          self.success = iprot.readBool();
14102
            _elem209 = iprot.readI64();
-
 
14103
            self.success.append(_elem209)
-
 
14104
          iprot.readListEnd()
14115
        else:
14105
        else:
14116
          iprot.skip(ftype)
14106
          iprot.skip(ftype)
14117
      else:
14107
      else:
14118
        iprot.skip(ftype)
14108
        iprot.skip(ftype)
14119
      iprot.readFieldEnd()
14109
      iprot.readFieldEnd()
Line 14121... Line 14111...
14121
 
14111
 
14122
  def write(self, oprot):
14112
  def write(self, oprot):
14123
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
14113
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
14124
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
14114
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
14125
      return
14115
      return
14126
    oprot.writeStructBegin('isProductAddedToCart_result')
14116
    oprot.writeStructBegin('getProductsAddedToCart_result')
14127
    if self.success is not None:
14117
    if self.success is not None:
14128
      oprot.writeFieldBegin('success', TType.BOOL, 0)
14118
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
14119
      oprot.writeListBegin(TType.I64, len(self.success))
14129
      oprot.writeBool(self.success)
14120
      for iter210 in self.success:
-
 
14121
        oprot.writeI64(iter210)
-
 
14122
      oprot.writeListEnd()
14130
      oprot.writeFieldEnd()
14123
      oprot.writeFieldEnd()
14131
    oprot.writeFieldStop()
14124
    oprot.writeFieldStop()
14132
    oprot.writeStructEnd()
14125
    oprot.writeStructEnd()
14133
 
14126
 
14134
  def validate(self):
14127
  def validate(self):