Subversion Repositories SmartDukaan

Rev

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

Rev 3431 Rev 3499
Line 581... Line 581...
581
    Parameters:
581
    Parameters:
582
     - couponCode
582
     - couponCode
583
    """
583
    """
584
    pass
584
    pass
585
 
585
 
-
 
586
  def increaseTrustLevel(self, userId, trustLevelDelta):
-
 
587
    """
-
 
588
    Updates COD trust level of a user
-
 
589
 
-
 
590
    Parameters:
-
 
591
     - userId
-
 
592
     - trustLevelDelta
-
 
593
    """
-
 
594
    pass
-
 
595
 
586
 
596
 
587
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
597
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
588
  """
598
  """
589
  service
599
  service
590
  """
600
  """
Line 2872... Line 2882...
2872
    self._iprot.readMessageEnd()
2882
    self._iprot.readMessageEnd()
2873
    if result.success is not None:
2883
    if result.success is not None:
2874
      return result.success
2884
      return result.success
2875
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCartsWithCouponCount failed: unknown result");
2885
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getCartsWithCouponCount failed: unknown result");
2876
 
2886
 
-
 
2887
  def increaseTrustLevel(self, userId, trustLevelDelta):
-
 
2888
    """
-
 
2889
    Updates COD trust level of a user
-
 
2890
 
-
 
2891
    Parameters:
-
 
2892
     - userId
-
 
2893
     - trustLevelDelta
-
 
2894
    """
-
 
2895
    self.send_increaseTrustLevel(userId, trustLevelDelta)
-
 
2896
    self.recv_increaseTrustLevel()
-
 
2897
 
-
 
2898
  def send_increaseTrustLevel(self, userId, trustLevelDelta):
-
 
2899
    self._oprot.writeMessageBegin('increaseTrustLevel', TMessageType.CALL, self._seqid)
-
 
2900
    args = increaseTrustLevel_args()
-
 
2901
    args.userId = userId
-
 
2902
    args.trustLevelDelta = trustLevelDelta
-
 
2903
    args.write(self._oprot)
-
 
2904
    self._oprot.writeMessageEnd()
-
 
2905
    self._oprot.trans.flush()
-
 
2906
 
-
 
2907
  def recv_increaseTrustLevel(self, ):
-
 
2908
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2909
    if mtype == TMessageType.EXCEPTION:
-
 
2910
      x = TApplicationException()
-
 
2911
      x.read(self._iprot)
-
 
2912
      self._iprot.readMessageEnd()
-
 
2913
      raise x
-
 
2914
    result = increaseTrustLevel_result()
-
 
2915
    result.read(self._iprot)
-
 
2916
    self._iprot.readMessageEnd()
-
 
2917
    return
-
 
2918
 
2877
 
2919
 
2878
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2920
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2879
  def __init__(self, handler):
2921
  def __init__(self, handler):
2880
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2922
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2881
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
2923
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
Line 2944... Line 2986...
2944
    self._processMap["updateMyResearch"] = Processor.process_updateMyResearch
2986
    self._processMap["updateMyResearch"] = Processor.process_updateMyResearch
2945
    self._processMap["deleteItemFromMyResearch"] = Processor.process_deleteItemFromMyResearch
2987
    self._processMap["deleteItemFromMyResearch"] = Processor.process_deleteItemFromMyResearch
2946
    self._processMap["getBrowseHistoryItems"] = Processor.process_getBrowseHistoryItems
2988
    self._processMap["getBrowseHistoryItems"] = Processor.process_getBrowseHistoryItems
2947
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2989
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2948
    self._processMap["getCartsWithCouponCount"] = Processor.process_getCartsWithCouponCount
2990
    self._processMap["getCartsWithCouponCount"] = Processor.process_getCartsWithCouponCount
-
 
2991
    self._processMap["increaseTrustLevel"] = Processor.process_increaseTrustLevel
2949
 
2992
 
2950
  def process(self, iprot, oprot):
2993
  def process(self, iprot, oprot):
2951
    (name, type, seqid) = iprot.readMessageBegin()
2994
    (name, type, seqid) = iprot.readMessageBegin()
2952
    if name not in self._processMap:
2995
    if name not in self._processMap:
2953
      iprot.skip(TType.STRUCT)
2996
      iprot.skip(TType.STRUCT)
Line 3891... Line 3934...
3891
    oprot.writeMessageBegin("getCartsWithCouponCount", TMessageType.REPLY, seqid)
3934
    oprot.writeMessageBegin("getCartsWithCouponCount", TMessageType.REPLY, seqid)
3892
    result.write(oprot)
3935
    result.write(oprot)
3893
    oprot.writeMessageEnd()
3936
    oprot.writeMessageEnd()
3894
    oprot.trans.flush()
3937
    oprot.trans.flush()
3895
 
3938
 
-
 
3939
  def process_increaseTrustLevel(self, seqid, iprot, oprot):
-
 
3940
    args = increaseTrustLevel_args()
-
 
3941
    args.read(iprot)
-
 
3942
    iprot.readMessageEnd()
-
 
3943
    result = increaseTrustLevel_result()
-
 
3944
    self._handler.increaseTrustLevel(args.userId, args.trustLevelDelta)
-
 
3945
    oprot.writeMessageBegin("increaseTrustLevel", TMessageType.REPLY, seqid)
-
 
3946
    result.write(oprot)
-
 
3947
    oprot.writeMessageEnd()
-
 
3948
    oprot.trans.flush()
-
 
3949
 
3896
 
3950
 
3897
# HELPER FUNCTIONS AND STRUCTURES
3951
# HELPER FUNCTIONS AND STRUCTURES
3898
 
3952
 
3899
class createAnonymousUser_args:
3953
class createAnonymousUser_args:
3900
  """
3954
  """
Line 13453... Line 13507...
13453
    oprot.writeFieldStop()
13507
    oprot.writeFieldStop()
13454
    oprot.writeStructEnd()
13508
    oprot.writeStructEnd()
13455
 
13509
 
13456
  def validate(self):
13510
  def validate(self):
13457
    return
13511
    return
-
 
13512
 
-
 
13513
 
-
 
13514
  def __repr__(self):
-
 
13515
    L = ['%s=%r' % (key, value)
-
 
13516
      for key, value in self.__dict__.iteritems()]
-
 
13517
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13518
 
-
 
13519
  def __eq__(self, other):
-
 
13520
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13521
 
-
 
13522
  def __ne__(self, other):
-
 
13523
    return not (self == other)
-
 
13524
 
-
 
13525
class increaseTrustLevel_args:
-
 
13526
  """
-
 
13527
  Attributes:
-
 
13528
   - userId
-
 
13529
   - trustLevelDelta
-
 
13530
  """
-
 
13531
 
-
 
13532
  thrift_spec = (
-
 
13533
    None, # 0
-
 
13534
    (1, TType.I64, 'userId', None, None, ), # 1
-
 
13535
    (2, TType.DOUBLE, 'trustLevelDelta', None, None, ), # 2
-
 
13536
  )
-
 
13537
 
-
 
13538
  def __init__(self, userId=None, trustLevelDelta=None,):
-
 
13539
    self.userId = userId
-
 
13540
    self.trustLevelDelta = trustLevelDelta
-
 
13541
 
-
 
13542
  def read(self, iprot):
-
 
13543
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13544
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13545
      return
-
 
13546
    iprot.readStructBegin()
-
 
13547
    while True:
-
 
13548
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13549
      if ftype == TType.STOP:
-
 
13550
        break
-
 
13551
      if fid == 1:
-
 
13552
        if ftype == TType.I64:
-
 
13553
          self.userId = iprot.readI64();
-
 
13554
        else:
-
 
13555
          iprot.skip(ftype)
-
 
13556
      elif fid == 2:
-
 
13557
        if ftype == TType.DOUBLE:
-
 
13558
          self.trustLevelDelta = iprot.readDouble();
-
 
13559
        else:
-
 
13560
          iprot.skip(ftype)
-
 
13561
      else:
-
 
13562
        iprot.skip(ftype)
-
 
13563
      iprot.readFieldEnd()
-
 
13564
    iprot.readStructEnd()
-
 
13565
 
-
 
13566
  def write(self, oprot):
-
 
13567
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13568
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13569
      return
-
 
13570
    oprot.writeStructBegin('increaseTrustLevel_args')
-
 
13571
    if self.userId is not None:
-
 
13572
      oprot.writeFieldBegin('userId', TType.I64, 1)
-
 
13573
      oprot.writeI64(self.userId)
-
 
13574
      oprot.writeFieldEnd()
-
 
13575
    if self.trustLevelDelta is not None:
-
 
13576
      oprot.writeFieldBegin('trustLevelDelta', TType.DOUBLE, 2)
-
 
13577
      oprot.writeDouble(self.trustLevelDelta)
-
 
13578
      oprot.writeFieldEnd()
-
 
13579
    oprot.writeFieldStop()
-
 
13580
    oprot.writeStructEnd()
-
 
13581
 
-
 
13582
  def validate(self):
-
 
13583
    return
-
 
13584
 
-
 
13585
 
-
 
13586
  def __repr__(self):
-
 
13587
    L = ['%s=%r' % (key, value)
-
 
13588
      for key, value in self.__dict__.iteritems()]
-
 
13589
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13590
 
-
 
13591
  def __eq__(self, other):
-
 
13592
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13593
 
-
 
13594
  def __ne__(self, other):
-
 
13595
    return not (self == other)
-
 
13596
 
-
 
13597
class increaseTrustLevel_result:
-
 
13598
 
-
 
13599
  thrift_spec = (
-
 
13600
  )
-
 
13601
 
-
 
13602
  def read(self, iprot):
-
 
13603
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13604
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13605
      return
-
 
13606
    iprot.readStructBegin()
-
 
13607
    while True:
-
 
13608
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13609
      if ftype == TType.STOP:
-
 
13610
        break
-
 
13611
      else:
-
 
13612
        iprot.skip(ftype)
-
 
13613
      iprot.readFieldEnd()
-
 
13614
    iprot.readStructEnd()
-
 
13615
 
-
 
13616
  def write(self, oprot):
-
 
13617
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13618
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13619
      return
-
 
13620
    oprot.writeStructBegin('increaseTrustLevel_result')
-
 
13621
    oprot.writeFieldStop()
-
 
13622
    oprot.writeStructEnd()
-
 
13623
 
-
 
13624
  def validate(self):
-
 
13625
    return
13458
 
13626
 
13459
 
13627
 
13460
  def __repr__(self):
13628
  def __repr__(self):
13461
    L = ['%s=%r' % (key, value)
13629
    L = ['%s=%r' % (key, value)
13462
      for key, value in self.__dict__.iteritems()]
13630
      for key, value in self.__dict__.iteritems()]