Subversion Repositories SmartDukaan

Rev

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

Rev 6736 Rev 6821
Line 587... Line 587...
587
     - startDate
587
     - startDate
588
     - endDate
588
     - endDate
589
    """
589
    """
590
    pass
590
    pass
591
 
591
 
-
 
592
  def isProductAddedToCart(self, itemId, startDate, endDate):
-
 
593
    """
-
 
594
    Returns whether product is added to cart from startDate to endDate
-
 
595
 
-
 
596
    Parameters:
-
 
597
     - itemId
-
 
598
     - startDate
-
 
599
     - endDate
-
 
600
    """
-
 
601
    pass
-
 
602
 
592
 
603
 
593
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
604
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
594
  """
605
  """
595
  service
606
  service
596
  """
607
  """
Line 2840... Line 2851...
2840
    self._iprot.readMessageEnd()
2851
    self._iprot.readMessageEnd()
2841
    if result.success is not None:
2852
    if result.success is not None:
2842
      return result.success
2853
      return result.success
2843
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserEmails failed: unknown result");
2854
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserEmails failed: unknown result");
2844
 
2855
 
-
 
2856
  def isProductAddedToCart(self, itemId, startDate, endDate):
-
 
2857
    """
-
 
2858
    Returns whether product is added to cart from startDate to endDate
-
 
2859
 
-
 
2860
    Parameters:
-
 
2861
     - itemId
-
 
2862
     - startDate
-
 
2863
     - endDate
-
 
2864
    """
-
 
2865
    self.send_isProductAddedToCart(itemId, startDate, endDate)
-
 
2866
    return self.recv_isProductAddedToCart()
-
 
2867
 
-
 
2868
  def send_isProductAddedToCart(self, itemId, startDate, endDate):
-
 
2869
    self._oprot.writeMessageBegin('isProductAddedToCart', TMessageType.CALL, self._seqid)
-
 
2870
    args = isProductAddedToCart_args()
-
 
2871
    args.itemId = itemId
-
 
2872
    args.startDate = startDate
-
 
2873
    args.endDate = endDate
-
 
2874
    args.write(self._oprot)
-
 
2875
    self._oprot.writeMessageEnd()
-
 
2876
    self._oprot.trans.flush()
-
 
2877
 
-
 
2878
  def recv_isProductAddedToCart(self, ):
-
 
2879
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2880
    if mtype == TMessageType.EXCEPTION:
-
 
2881
      x = TApplicationException()
-
 
2882
      x.read(self._iprot)
-
 
2883
      self._iprot.readMessageEnd()
-
 
2884
      raise x
-
 
2885
    result = isProductAddedToCart_result()
-
 
2886
    result.read(self._iprot)
-
 
2887
    self._iprot.readMessageEnd()
-
 
2888
    if result.success is not None:
-
 
2889
      return result.success
-
 
2890
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isProductAddedToCart failed: unknown result");
-
 
2891
 
2845
 
2892
 
2846
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2893
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2847
  def __init__(self, handler):
2894
  def __init__(self, handler):
2848
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2895
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2849
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
2896
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
Line 2911... Line 2958...
2911
    self._processMap["getCartsWithCouponCount"] = Processor.process_getCartsWithCouponCount
2958
    self._processMap["getCartsWithCouponCount"] = Processor.process_getCartsWithCouponCount
2912
    self._processMap["increaseTrustLevel"] = Processor.process_increaseTrustLevel
2959
    self._processMap["increaseTrustLevel"] = Processor.process_increaseTrustLevel
2913
    self._processMap["getTrustLevel"] = Processor.process_getTrustLevel
2960
    self._processMap["getTrustLevel"] = Processor.process_getTrustLevel
2914
    self._processMap["showCODOption"] = Processor.process_showCODOption
2961
    self._processMap["showCODOption"] = Processor.process_showCODOption
2915
    self._processMap["getUserEmails"] = Processor.process_getUserEmails
2962
    self._processMap["getUserEmails"] = Processor.process_getUserEmails
-
 
2963
    self._processMap["isProductAddedToCart"] = Processor.process_isProductAddedToCart
2916
 
2964
 
2917
  def process(self, iprot, oprot):
2965
  def process(self, iprot, oprot):
2918
    (name, type, seqid) = iprot.readMessageBegin()
2966
    (name, type, seqid) = iprot.readMessageBegin()
2919
    if name not in self._processMap:
2967
    if name not in self._processMap:
2920
      iprot.skip(TType.STRUCT)
2968
      iprot.skip(TType.STRUCT)
Line 3834... Line 3882...
3834
    oprot.writeMessageBegin("getUserEmails", TMessageType.REPLY, seqid)
3882
    oprot.writeMessageBegin("getUserEmails", TMessageType.REPLY, seqid)
3835
    result.write(oprot)
3883
    result.write(oprot)
3836
    oprot.writeMessageEnd()
3884
    oprot.writeMessageEnd()
3837
    oprot.trans.flush()
3885
    oprot.trans.flush()
3838
 
3886
 
-
 
3887
  def process_isProductAddedToCart(self, seqid, iprot, oprot):
-
 
3888
    args = isProductAddedToCart_args()
-
 
3889
    args.read(iprot)
-
 
3890
    iprot.readMessageEnd()
-
 
3891
    result = isProductAddedToCart_result()
-
 
3892
    result.success = self._handler.isProductAddedToCart(args.itemId, args.startDate, args.endDate)
-
 
3893
    oprot.writeMessageBegin("isProductAddedToCart", TMessageType.REPLY, seqid)
-
 
3894
    result.write(oprot)
-
 
3895
    oprot.writeMessageEnd()
-
 
3896
    oprot.trans.flush()
-
 
3897
 
3839
 
3898
 
3840
# HELPER FUNCTIONS AND STRUCTURES
3899
# HELPER FUNCTIONS AND STRUCTURES
3841
 
3900
 
3842
class createAnonymousUser_args:
3901
class createAnonymousUser_args:
3843
  """
3902
  """
Line 13194... Line 13253...
13194
      oprot.writeFieldEnd()
13253
      oprot.writeFieldEnd()
13195
    oprot.writeFieldStop()
13254
    oprot.writeFieldStop()
13196
    oprot.writeStructEnd()
13255
    oprot.writeStructEnd()
13197
 
13256
 
13198
  def validate(self):
13257
  def validate(self):
-
 
13258
    return
-
 
13259
 
-
 
13260
 
-
 
13261
  def __repr__(self):
-
 
13262
    L = ['%s=%r' % (key, value)
-
 
13263
      for key, value in self.__dict__.iteritems()]
-
 
13264
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13265
 
-
 
13266
  def __eq__(self, other):
-
 
13267
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13268
 
-
 
13269
  def __ne__(self, other):
-
 
13270
    return not (self == other)
-
 
13271
 
-
 
13272
class isProductAddedToCart_args:
-
 
13273
  """
-
 
13274
  Attributes:
-
 
13275
   - itemId
-
 
13276
   - startDate
-
 
13277
   - endDate
-
 
13278
  """
-
 
13279
 
-
 
13280
  thrift_spec = (
-
 
13281
    None, # 0
-
 
13282
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
13283
    (2, TType.I64, 'startDate', None, None, ), # 2
-
 
13284
    (3, TType.I64, 'endDate', None, None, ), # 3
-
 
13285
  )
-
 
13286
 
-
 
13287
  def __init__(self, itemId=None, startDate=None, endDate=None,):
-
 
13288
    self.itemId = itemId
-
 
13289
    self.startDate = startDate
-
 
13290
    self.endDate = endDate
-
 
13291
 
-
 
13292
  def read(self, iprot):
-
 
13293
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13294
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13295
      return
-
 
13296
    iprot.readStructBegin()
-
 
13297
    while True:
-
 
13298
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13299
      if ftype == TType.STOP:
-
 
13300
        break
-
 
13301
      if fid == 1:
-
 
13302
        if ftype == TType.I64:
-
 
13303
          self.itemId = iprot.readI64();
-
 
13304
        else:
-
 
13305
          iprot.skip(ftype)
-
 
13306
      elif fid == 2:
-
 
13307
        if ftype == TType.I64:
-
 
13308
          self.startDate = iprot.readI64();
-
 
13309
        else:
-
 
13310
          iprot.skip(ftype)
-
 
13311
      elif fid == 3:
-
 
13312
        if ftype == TType.I64:
-
 
13313
          self.endDate = iprot.readI64();
-
 
13314
        else:
-
 
13315
          iprot.skip(ftype)
-
 
13316
      else:
-
 
13317
        iprot.skip(ftype)
-
 
13318
      iprot.readFieldEnd()
-
 
13319
    iprot.readStructEnd()
-
 
13320
 
-
 
13321
  def write(self, oprot):
-
 
13322
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13323
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13324
      return
-
 
13325
    oprot.writeStructBegin('isProductAddedToCart_args')
-
 
13326
    if self.itemId is not None:
-
 
13327
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
13328
      oprot.writeI64(self.itemId)
-
 
13329
      oprot.writeFieldEnd()
-
 
13330
    if self.startDate is not None:
-
 
13331
      oprot.writeFieldBegin('startDate', TType.I64, 2)
-
 
13332
      oprot.writeI64(self.startDate)
-
 
13333
      oprot.writeFieldEnd()
-
 
13334
    if self.endDate is not None:
-
 
13335
      oprot.writeFieldBegin('endDate', TType.I64, 3)
-
 
13336
      oprot.writeI64(self.endDate)
-
 
13337
      oprot.writeFieldEnd()
-
 
13338
    oprot.writeFieldStop()
-
 
13339
    oprot.writeStructEnd()
-
 
13340
 
-
 
13341
  def validate(self):
-
 
13342
    return
-
 
13343
 
-
 
13344
 
-
 
13345
  def __repr__(self):
-
 
13346
    L = ['%s=%r' % (key, value)
-
 
13347
      for key, value in self.__dict__.iteritems()]
-
 
13348
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13349
 
-
 
13350
  def __eq__(self, other):
-
 
13351
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13352
 
-
 
13353
  def __ne__(self, other):
-
 
13354
    return not (self == other)
-
 
13355
 
-
 
13356
class isProductAddedToCart_result:
-
 
13357
  """
-
 
13358
  Attributes:
-
 
13359
   - success
-
 
13360
  """
-
 
13361
 
-
 
13362
  thrift_spec = (
-
 
13363
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
13364
  )
-
 
13365
 
-
 
13366
  def __init__(self, success=None,):
-
 
13367
    self.success = success
-
 
13368
 
-
 
13369
  def read(self, iprot):
-
 
13370
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13371
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13372
      return
-
 
13373
    iprot.readStructBegin()
-
 
13374
    while True:
-
 
13375
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13376
      if ftype == TType.STOP:
-
 
13377
        break
-
 
13378
      if fid == 0:
-
 
13379
        if ftype == TType.BOOL:
-
 
13380
          self.success = iprot.readBool();
-
 
13381
        else:
-
 
13382
          iprot.skip(ftype)
-
 
13383
      else:
-
 
13384
        iprot.skip(ftype)
-
 
13385
      iprot.readFieldEnd()
-
 
13386
    iprot.readStructEnd()
-
 
13387
 
-
 
13388
  def write(self, oprot):
-
 
13389
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13390
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13391
      return
-
 
13392
    oprot.writeStructBegin('isProductAddedToCart_result')
-
 
13393
    if self.success is not None:
-
 
13394
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
13395
      oprot.writeBool(self.success)
-
 
13396
      oprot.writeFieldEnd()
-
 
13397
    oprot.writeFieldStop()
-
 
13398
    oprot.writeStructEnd()
-
 
13399
 
-
 
13400
  def validate(self):
13199
    return
13401
    return
13200
 
13402
 
13201
 
13403
 
13202
  def __repr__(self):
13404
  def __repr__(self):
13203
    L = ['%s=%r' % (key, value)
13405
    L = ['%s=%r' % (key, value)