Subversion Repositories SmartDukaan

Rev

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

Rev 1590 Rev 1596
Line 393... Line 393...
393
     - fromUserId
393
     - fromUserId
394
     - toUserId
394
     - toUserId
395
    """
395
    """
396
    pass
396
    pass
397
 
397
 
-
 
398
  def getUserCount(self, userType):
-
 
399
    """
-
 
400
    Returns number of registered users.
-
 
401
    If userType = null, then it returns count of all users, including anonymous
-
 
402
    If userType = UserType.ANONYMOUS, then it returns count of anonymous users only
-
 
403
    If userType = UserType.USER, then it returns count of non-anonymous users only
-
 
404
    
-
 
405
    Parameters:
-
 
406
     - userType
-
 
407
    """
-
 
408
    pass
-
 
409
 
398
 
410
 
399
class Client(Iface):
411
class Client(Iface):
400
  """
412
  """
401
  service
413
  service
402
  """
414
  """
Line 1958... Line 1970...
1958
    result = mergeBrowseHistory_result()
1970
    result = mergeBrowseHistory_result()
1959
    result.read(self._iprot)
1971
    result.read(self._iprot)
1960
    self._iprot.readMessageEnd()
1972
    self._iprot.readMessageEnd()
1961
    return
1973
    return
1962
 
1974
 
-
 
1975
  def getUserCount(self, userType):
-
 
1976
    """
-
 
1977
    Returns number of registered users.
-
 
1978
    If userType = null, then it returns count of all users, including anonymous
-
 
1979
    If userType = UserType.ANONYMOUS, then it returns count of anonymous users only
-
 
1980
    If userType = UserType.USER, then it returns count of non-anonymous users only
-
 
1981
    
-
 
1982
    Parameters:
-
 
1983
     - userType
-
 
1984
    """
-
 
1985
    self.send_getUserCount(userType)
-
 
1986
    return self.recv_getUserCount()
-
 
1987
 
-
 
1988
  def send_getUserCount(self, userType):
-
 
1989
    self._oprot.writeMessageBegin('getUserCount', TMessageType.CALL, self._seqid)
-
 
1990
    args = getUserCount_args()
-
 
1991
    args.userType = userType
-
 
1992
    args.write(self._oprot)
-
 
1993
    self._oprot.writeMessageEnd()
-
 
1994
    self._oprot.trans.flush()
-
 
1995
 
-
 
1996
  def recv_getUserCount(self, ):
-
 
1997
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1998
    if mtype == TMessageType.EXCEPTION:
-
 
1999
      x = TApplicationException()
-
 
2000
      x.read(self._iprot)
-
 
2001
      self._iprot.readMessageEnd()
-
 
2002
      raise x
-
 
2003
    result = getUserCount_result()
-
 
2004
    result.read(self._iprot)
-
 
2005
    self._iprot.readMessageEnd()
-
 
2006
    if result.success != None:
-
 
2007
      return result.success
-
 
2008
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserCount failed: unknown result");
-
 
2009
 
1963
 
2010
 
1964
class Processor(Iface, TProcessor):
2011
class Processor(Iface, TProcessor):
1965
  def __init__(self, handler):
2012
  def __init__(self, handler):
1966
    self._handler = handler
2013
    self._handler = handler
1967
    self._processMap = {}
2014
    self._processMap = {}
Line 2010... Line 2057...
2010
    self._processMap["updateMyResearch"] = Processor.process_updateMyResearch
2057
    self._processMap["updateMyResearch"] = Processor.process_updateMyResearch
2011
    self._processMap["deleteItemFromMyResearch"] = Processor.process_deleteItemFromMyResearch
2058
    self._processMap["deleteItemFromMyResearch"] = Processor.process_deleteItemFromMyResearch
2012
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2059
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2013
    self._processMap["getBrowseHistory"] = Processor.process_getBrowseHistory
2060
    self._processMap["getBrowseHistory"] = Processor.process_getBrowseHistory
2014
    self._processMap["mergeBrowseHistory"] = Processor.process_mergeBrowseHistory
2061
    self._processMap["mergeBrowseHistory"] = Processor.process_mergeBrowseHistory
-
 
2062
    self._processMap["getUserCount"] = Processor.process_getUserCount
2015
 
2063
 
2016
  def process(self, iprot, oprot):
2064
  def process(self, iprot, oprot):
2017
    (name, type, seqid) = iprot.readMessageBegin()
2065
    (name, type, seqid) = iprot.readMessageBegin()
2018
    if name not in self._processMap:
2066
    if name not in self._processMap:
2019
      iprot.skip(TType.STRUCT)
2067
      iprot.skip(TType.STRUCT)
Line 2672... Line 2720...
2672
    oprot.writeMessageBegin("mergeBrowseHistory", TMessageType.REPLY, seqid)
2720
    oprot.writeMessageBegin("mergeBrowseHistory", TMessageType.REPLY, seqid)
2673
    result.write(oprot)
2721
    result.write(oprot)
2674
    oprot.writeMessageEnd()
2722
    oprot.writeMessageEnd()
2675
    oprot.trans.flush()
2723
    oprot.trans.flush()
2676
 
2724
 
-
 
2725
  def process_getUserCount(self, seqid, iprot, oprot):
-
 
2726
    args = getUserCount_args()
-
 
2727
    args.read(iprot)
-
 
2728
    iprot.readMessageEnd()
-
 
2729
    result = getUserCount_result()
-
 
2730
    result.success = self._handler.getUserCount(args.userType)
-
 
2731
    oprot.writeMessageBegin("getUserCount", TMessageType.REPLY, seqid)
-
 
2732
    result.write(oprot)
-
 
2733
    oprot.writeMessageEnd()
-
 
2734
    oprot.trans.flush()
-
 
2735
 
2677
 
2736
 
2678
# HELPER FUNCTIONS AND STRUCTURES
2737
# HELPER FUNCTIONS AND STRUCTURES
2679
 
2738
 
2680
class closeSession_args:
2739
class closeSession_args:
2681
 
2740
 
Line 8760... Line 8819...
8760
    oprot.writeFieldStop()
8819
    oprot.writeFieldStop()
8761
    oprot.writeStructEnd()
8820
    oprot.writeStructEnd()
8762
 
8821
 
8763
  def __repr__(self):
8822
  def __repr__(self):
8764
    L = ['%s=%r' % (key, value)
8823
    L = ['%s=%r' % (key, value)
-
 
8824
      for key, value in self.__dict__.iteritems()]
-
 
8825
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
8826
 
-
 
8827
  def __eq__(self, other):
-
 
8828
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
8829
 
-
 
8830
  def __ne__(self, other):
-
 
8831
    return not (self == other)
-
 
8832
 
-
 
8833
class getUserCount_args:
-
 
8834
  """
-
 
8835
  Attributes:
-
 
8836
   - userType
-
 
8837
  """
-
 
8838
 
-
 
8839
  thrift_spec = (
-
 
8840
    None, # 0
-
 
8841
    (1, TType.I32, 'userType', None, None, ), # 1
-
 
8842
  )
-
 
8843
 
-
 
8844
  def __init__(self, userType=None,):
-
 
8845
    self.userType = userType
-
 
8846
 
-
 
8847
  def read(self, iprot):
-
 
8848
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
8849
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
8850
      return
-
 
8851
    iprot.readStructBegin()
-
 
8852
    while True:
-
 
8853
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
8854
      if ftype == TType.STOP:
-
 
8855
        break
-
 
8856
      if fid == 1:
-
 
8857
        if ftype == TType.I32:
-
 
8858
          self.userType = iprot.readI32();
-
 
8859
        else:
-
 
8860
          iprot.skip(ftype)
-
 
8861
      else:
-
 
8862
        iprot.skip(ftype)
-
 
8863
      iprot.readFieldEnd()
-
 
8864
    iprot.readStructEnd()
-
 
8865
 
-
 
8866
  def write(self, oprot):
-
 
8867
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
8868
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
8869
      return
-
 
8870
    oprot.writeStructBegin('getUserCount_args')
-
 
8871
    if self.userType != None:
-
 
8872
      oprot.writeFieldBegin('userType', TType.I32, 1)
-
 
8873
      oprot.writeI32(self.userType)
-
 
8874
      oprot.writeFieldEnd()
-
 
8875
    oprot.writeFieldStop()
-
 
8876
    oprot.writeStructEnd()
-
 
8877
 
-
 
8878
  def __repr__(self):
-
 
8879
    L = ['%s=%r' % (key, value)
-
 
8880
      for key, value in self.__dict__.iteritems()]
-
 
8881
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
8882
 
-
 
8883
  def __eq__(self, other):
-
 
8884
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
8885
 
-
 
8886
  def __ne__(self, other):
-
 
8887
    return not (self == other)
-
 
8888
 
-
 
8889
class getUserCount_result:
-
 
8890
  """
-
 
8891
  Attributes:
-
 
8892
   - success
-
 
8893
  """
-
 
8894
 
-
 
8895
  thrift_spec = (
-
 
8896
    (0, TType.I64, 'success', None, None, ), # 0
-
 
8897
  )
-
 
8898
 
-
 
8899
  def __init__(self, success=None,):
-
 
8900
    self.success = success
-
 
8901
 
-
 
8902
  def read(self, iprot):
-
 
8903
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
8904
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
8905
      return
-
 
8906
    iprot.readStructBegin()
-
 
8907
    while True:
-
 
8908
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
8909
      if ftype == TType.STOP:
-
 
8910
        break
-
 
8911
      if fid == 0:
-
 
8912
        if ftype == TType.I64:
-
 
8913
          self.success = iprot.readI64();
-
 
8914
        else:
-
 
8915
          iprot.skip(ftype)
-
 
8916
      else:
-
 
8917
        iprot.skip(ftype)
-
 
8918
      iprot.readFieldEnd()
-
 
8919
    iprot.readStructEnd()
-
 
8920
 
-
 
8921
  def write(self, oprot):
-
 
8922
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
8923
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
8924
      return
-
 
8925
    oprot.writeStructBegin('getUserCount_result')
-
 
8926
    if self.success != None:
-
 
8927
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
8928
      oprot.writeI64(self.success)
-
 
8929
      oprot.writeFieldEnd()
-
 
8930
    oprot.writeFieldStop()
-
 
8931
    oprot.writeStructEnd()
-
 
8932
 
-
 
8933
  def __repr__(self):
-
 
8934
    L = ['%s=%r' % (key, value)
8765
      for key, value in self.__dict__.iteritems()]
8935
      for key, value in self.__dict__.iteritems()]
8766
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
8936
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
8767
 
8937
 
8768
  def __eq__(self, other):
8938
  def __eq__(self, other):
8769
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
8939
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__