Subversion Repositories SmartDukaan

Rev

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

Rev 2035 Rev 2642
Line 548... Line 548...
548
     - startDate
548
     - startDate
549
     - endDate
549
     - endDate
550
    """
550
    """
551
    pass
551
    pass
552
 
552
 
-
 
553
  def putUserNote(self, user_id, entity_id, slide_id, note):
-
 
554
    """
-
 
555
    Masking right now. May be used later.
-
 
556
    void addWidget(1:Widget widget) throws (1:WidgetException scx),
-
 
557
    void addItemToWidget(1:i64 widget_id, 2:list<i64> items) throws (1:WidgetException scx),
-
 
558
    void deleteItemFromWidget(1:i64 widget_id, 2:i64 item_id) throws (1:WidgetException scx),
-
 
559
    void updateWidget(1:i64 widgetId, 2:bool enable) throws (1:WidgetException scx),
-
 
560
    void updateWidgetItem(1:i64 widgetId, 2:bool enable) throws (1:WidgetException scx),
-
 
561
    Widget getWidget(1:WidgetType type, 2:i64 userId, 3:bool onlyEnabled) throws (1:WidgetException scx),
-
 
562
    
-
 
563
    Parameters:
-
 
564
     - user_id
-
 
565
     - entity_id
-
 
566
     - slide_id
-
 
567
     - note
-
 
568
    """
-
 
569
    pass
-
 
570
 
-
 
571
  def getUserNotes(self, user_id, entity_id):
-
 
572
    """
-
 
573
    Parameters:
-
 
574
     - user_id
-
 
575
     - entity_id
-
 
576
    """
-
 
577
    pass
-
 
578
 
553
 
579
 
554
class Client(Iface):
580
class Client(Iface):
555
  """
581
  """
556
  service
582
  service
557
  """
583
  """
Line 2752... Line 2778...
2752
    self._iprot.readMessageEnd()
2778
    self._iprot.readMessageEnd()
2753
    if result.success != None:
2779
    if result.success != None:
2754
      return result.success
2780
      return result.success
2755
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUsers failed: unknown result");
2781
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUsers failed: unknown result");
2756
 
2782
 
-
 
2783
  def putUserNote(self, user_id, entity_id, slide_id, note):
-
 
2784
    """
-
 
2785
    Masking right now. May be used later.
-
 
2786
    void addWidget(1:Widget widget) throws (1:WidgetException scx),
-
 
2787
    void addItemToWidget(1:i64 widget_id, 2:list<i64> items) throws (1:WidgetException scx),
-
 
2788
    void deleteItemFromWidget(1:i64 widget_id, 2:i64 item_id) throws (1:WidgetException scx),
-
 
2789
    void updateWidget(1:i64 widgetId, 2:bool enable) throws (1:WidgetException scx),
-
 
2790
    void updateWidgetItem(1:i64 widgetId, 2:bool enable) throws (1:WidgetException scx),
-
 
2791
    Widget getWidget(1:WidgetType type, 2:i64 userId, 3:bool onlyEnabled) throws (1:WidgetException scx),
-
 
2792
    
-
 
2793
    Parameters:
-
 
2794
     - user_id
-
 
2795
     - entity_id
-
 
2796
     - slide_id
-
 
2797
     - note
-
 
2798
    """
-
 
2799
    self.send_putUserNote(user_id, entity_id, slide_id, note)
-
 
2800
    self.recv_putUserNote()
-
 
2801
 
-
 
2802
  def send_putUserNote(self, user_id, entity_id, slide_id, note):
-
 
2803
    self._oprot.writeMessageBegin('putUserNote', TMessageType.CALL, self._seqid)
-
 
2804
    args = putUserNote_args()
-
 
2805
    args.user_id = user_id
-
 
2806
    args.entity_id = entity_id
-
 
2807
    args.slide_id = slide_id
-
 
2808
    args.note = note
-
 
2809
    args.write(self._oprot)
-
 
2810
    self._oprot.writeMessageEnd()
-
 
2811
    self._oprot.trans.flush()
-
 
2812
 
-
 
2813
  def recv_putUserNote(self, ):
-
 
2814
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2815
    if mtype == TMessageType.EXCEPTION:
-
 
2816
      x = TApplicationException()
-
 
2817
      x.read(self._iprot)
-
 
2818
      self._iprot.readMessageEnd()
-
 
2819
      raise x
-
 
2820
    result = putUserNote_result()
-
 
2821
    result.read(self._iprot)
-
 
2822
    self._iprot.readMessageEnd()
-
 
2823
    return
-
 
2824
 
-
 
2825
  def getUserNotes(self, user_id, entity_id):
-
 
2826
    """
-
 
2827
    Parameters:
-
 
2828
     - user_id
-
 
2829
     - entity_id
-
 
2830
    """
-
 
2831
    self.send_getUserNotes(user_id, entity_id)
-
 
2832
    return self.recv_getUserNotes()
-
 
2833
 
-
 
2834
  def send_getUserNotes(self, user_id, entity_id):
-
 
2835
    self._oprot.writeMessageBegin('getUserNotes', TMessageType.CALL, self._seqid)
-
 
2836
    args = getUserNotes_args()
-
 
2837
    args.user_id = user_id
-
 
2838
    args.entity_id = entity_id
-
 
2839
    args.write(self._oprot)
-
 
2840
    self._oprot.writeMessageEnd()
-
 
2841
    self._oprot.trans.flush()
-
 
2842
 
-
 
2843
  def recv_getUserNotes(self, ):
-
 
2844
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2845
    if mtype == TMessageType.EXCEPTION:
-
 
2846
      x = TApplicationException()
-
 
2847
      x.read(self._iprot)
-
 
2848
      self._iprot.readMessageEnd()
-
 
2849
      raise x
-
 
2850
    result = getUserNotes_result()
-
 
2851
    result.read(self._iprot)
-
 
2852
    self._iprot.readMessageEnd()
-
 
2853
    if result.success != None:
-
 
2854
      return result.success
-
 
2855
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserNotes failed: unknown result");
-
 
2856
 
2757
 
2857
 
2758
class Processor(Iface, TProcessor):
2858
class Processor(Iface, TProcessor):
2759
  def __init__(self, handler):
2859
  def __init__(self, handler):
2760
    self._handler = handler
2860
    self._handler = handler
2761
    self._processMap = {}
2861
    self._processMap = {}
Line 2823... Line 2923...
2823
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2923
    self._processMap["updateBrowseHistory"] = Processor.process_updateBrowseHistory
2824
    self._processMap["getBrowseHistory"] = Processor.process_getBrowseHistory
2924
    self._processMap["getBrowseHistory"] = Processor.process_getBrowseHistory
2825
    self._processMap["mergeBrowseHistory"] = Processor.process_mergeBrowseHistory
2925
    self._processMap["mergeBrowseHistory"] = Processor.process_mergeBrowseHistory
2826
    self._processMap["getUserCount"] = Processor.process_getUserCount
2926
    self._processMap["getUserCount"] = Processor.process_getUserCount
2827
    self._processMap["getAllUsers"] = Processor.process_getAllUsers
2927
    self._processMap["getAllUsers"] = Processor.process_getAllUsers
-
 
2928
    self._processMap["putUserNote"] = Processor.process_putUserNote
-
 
2929
    self._processMap["getUserNotes"] = Processor.process_getUserNotes
2828
 
2930
 
2829
  def process(self, iprot, oprot):
2931
  def process(self, iprot, oprot):
2830
    (name, type, seqid) = iprot.readMessageBegin()
2932
    (name, type, seqid) = iprot.readMessageBegin()
2831
    if name not in self._processMap:
2933
    if name not in self._processMap:
2832
      iprot.skip(TType.STRUCT)
2934
      iprot.skip(TType.STRUCT)
Line 3745... Line 3847...
3745
    oprot.writeMessageBegin("getAllUsers", TMessageType.REPLY, seqid)
3847
    oprot.writeMessageBegin("getAllUsers", TMessageType.REPLY, seqid)
3746
    result.write(oprot)
3848
    result.write(oprot)
3747
    oprot.writeMessageEnd()
3849
    oprot.writeMessageEnd()
3748
    oprot.trans.flush()
3850
    oprot.trans.flush()
3749
 
3851
 
-
 
3852
  def process_putUserNote(self, seqid, iprot, oprot):
-
 
3853
    args = putUserNote_args()
-
 
3854
    args.read(iprot)
-
 
3855
    iprot.readMessageEnd()
-
 
3856
    result = putUserNote_result()
-
 
3857
    self._handler.putUserNote(args.user_id, args.entity_id, args.slide_id, args.note)
-
 
3858
    oprot.writeMessageBegin("putUserNote", TMessageType.REPLY, seqid)
-
 
3859
    result.write(oprot)
-
 
3860
    oprot.writeMessageEnd()
-
 
3861
    oprot.trans.flush()
-
 
3862
 
-
 
3863
  def process_getUserNotes(self, seqid, iprot, oprot):
-
 
3864
    args = getUserNotes_args()
-
 
3865
    args.read(iprot)
-
 
3866
    iprot.readMessageEnd()
-
 
3867
    result = getUserNotes_result()
-
 
3868
    result.success = self._handler.getUserNotes(args.user_id, args.entity_id)
-
 
3869
    oprot.writeMessageBegin("getUserNotes", TMessageType.REPLY, seqid)
-
 
3870
    result.write(oprot)
-
 
3871
    oprot.writeMessageEnd()
-
 
3872
    oprot.trans.flush()
-
 
3873
 
3750
 
3874
 
3751
# HELPER FUNCTIONS AND STRUCTURES
3875
# HELPER FUNCTIONS AND STRUCTURES
3752
 
3876
 
3753
class closeSession_args:
3877
class closeSession_args:
3754
 
3878
 
Line 12387... Line 12511...
12387
      oprot.writeListEnd()
12511
      oprot.writeListEnd()
12388
      oprot.writeFieldEnd()
12512
      oprot.writeFieldEnd()
12389
    oprot.writeFieldStop()
12513
    oprot.writeFieldStop()
12390
    oprot.writeStructEnd()
12514
    oprot.writeStructEnd()
12391
 
12515
 
-
 
12516
  def __repr__(self):
-
 
12517
    L = ['%s=%r' % (key, value)
-
 
12518
      for key, value in self.__dict__.iteritems()]
-
 
12519
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12520
 
-
 
12521
  def __eq__(self, other):
-
 
12522
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12523
 
-
 
12524
  def __ne__(self, other):
-
 
12525
    return not (self == other)
-
 
12526
 
-
 
12527
class putUserNote_args:
-
 
12528
  """
-
 
12529
  Attributes:
-
 
12530
   - user_id
-
 
12531
   - entity_id
-
 
12532
   - slide_id
-
 
12533
   - note
-
 
12534
  """
-
 
12535
 
-
 
12536
  thrift_spec = (
-
 
12537
    None, # 0
-
 
12538
    (1, TType.I64, 'user_id', None, None, ), # 1
-
 
12539
    (2, TType.I64, 'entity_id', None, None, ), # 2
-
 
12540
    (3, TType.I64, 'slide_id', None, None, ), # 3
-
 
12541
    (4, TType.STRING, 'note', None, None, ), # 4
-
 
12542
  )
-
 
12543
 
-
 
12544
  def __init__(self, user_id=None, entity_id=None, slide_id=None, note=None,):
-
 
12545
    self.user_id = user_id
-
 
12546
    self.entity_id = entity_id
-
 
12547
    self.slide_id = slide_id
-
 
12548
    self.note = note
-
 
12549
 
-
 
12550
  def read(self, iprot):
-
 
12551
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12552
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12553
      return
-
 
12554
    iprot.readStructBegin()
-
 
12555
    while True:
-
 
12556
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12557
      if ftype == TType.STOP:
-
 
12558
        break
-
 
12559
      if fid == 1:
-
 
12560
        if ftype == TType.I64:
-
 
12561
          self.user_id = iprot.readI64();
-
 
12562
        else:
-
 
12563
          iprot.skip(ftype)
-
 
12564
      elif fid == 2:
-
 
12565
        if ftype == TType.I64:
-
 
12566
          self.entity_id = iprot.readI64();
-
 
12567
        else:
-
 
12568
          iprot.skip(ftype)
-
 
12569
      elif fid == 3:
-
 
12570
        if ftype == TType.I64:
-
 
12571
          self.slide_id = iprot.readI64();
-
 
12572
        else:
-
 
12573
          iprot.skip(ftype)
-
 
12574
      elif fid == 4:
-
 
12575
        if ftype == TType.STRING:
-
 
12576
          self.note = iprot.readString();
-
 
12577
        else:
-
 
12578
          iprot.skip(ftype)
-
 
12579
      else:
-
 
12580
        iprot.skip(ftype)
-
 
12581
      iprot.readFieldEnd()
-
 
12582
    iprot.readStructEnd()
-
 
12583
 
-
 
12584
  def write(self, oprot):
-
 
12585
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12586
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12587
      return
-
 
12588
    oprot.writeStructBegin('putUserNote_args')
-
 
12589
    if self.user_id != None:
-
 
12590
      oprot.writeFieldBegin('user_id', TType.I64, 1)
-
 
12591
      oprot.writeI64(self.user_id)
-
 
12592
      oprot.writeFieldEnd()
-
 
12593
    if self.entity_id != None:
-
 
12594
      oprot.writeFieldBegin('entity_id', TType.I64, 2)
-
 
12595
      oprot.writeI64(self.entity_id)
-
 
12596
      oprot.writeFieldEnd()
-
 
12597
    if self.slide_id != None:
-
 
12598
      oprot.writeFieldBegin('slide_id', TType.I64, 3)
-
 
12599
      oprot.writeI64(self.slide_id)
-
 
12600
      oprot.writeFieldEnd()
-
 
12601
    if self.note != None:
-
 
12602
      oprot.writeFieldBegin('note', TType.STRING, 4)
-
 
12603
      oprot.writeString(self.note)
-
 
12604
      oprot.writeFieldEnd()
-
 
12605
    oprot.writeFieldStop()
-
 
12606
    oprot.writeStructEnd()
-
 
12607
 
-
 
12608
  def __repr__(self):
-
 
12609
    L = ['%s=%r' % (key, value)
-
 
12610
      for key, value in self.__dict__.iteritems()]
-
 
12611
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12612
 
-
 
12613
  def __eq__(self, other):
-
 
12614
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12615
 
-
 
12616
  def __ne__(self, other):
-
 
12617
    return not (self == other)
-
 
12618
 
-
 
12619
class putUserNote_result:
-
 
12620
 
-
 
12621
  thrift_spec = (
-
 
12622
  )
-
 
12623
 
-
 
12624
  def read(self, iprot):
-
 
12625
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12626
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12627
      return
-
 
12628
    iprot.readStructBegin()
-
 
12629
    while True:
-
 
12630
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12631
      if ftype == TType.STOP:
-
 
12632
        break
-
 
12633
      else:
-
 
12634
        iprot.skip(ftype)
-
 
12635
      iprot.readFieldEnd()
-
 
12636
    iprot.readStructEnd()
-
 
12637
 
-
 
12638
  def write(self, oprot):
-
 
12639
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12640
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12641
      return
-
 
12642
    oprot.writeStructBegin('putUserNote_result')
-
 
12643
    oprot.writeFieldStop()
-
 
12644
    oprot.writeStructEnd()
-
 
12645
 
-
 
12646
  def __repr__(self):
-
 
12647
    L = ['%s=%r' % (key, value)
-
 
12648
      for key, value in self.__dict__.iteritems()]
-
 
12649
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12650
 
-
 
12651
  def __eq__(self, other):
-
 
12652
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12653
 
-
 
12654
  def __ne__(self, other):
-
 
12655
    return not (self == other)
-
 
12656
 
-
 
12657
class getUserNotes_args:
-
 
12658
  """
-
 
12659
  Attributes:
-
 
12660
   - user_id
-
 
12661
   - entity_id
-
 
12662
  """
-
 
12663
 
-
 
12664
  thrift_spec = (
-
 
12665
    None, # 0
-
 
12666
    (1, TType.I64, 'user_id', None, None, ), # 1
-
 
12667
    (2, TType.I64, 'entity_id', None, None, ), # 2
-
 
12668
  )
-
 
12669
 
-
 
12670
  def __init__(self, user_id=None, entity_id=None,):
-
 
12671
    self.user_id = user_id
-
 
12672
    self.entity_id = entity_id
-
 
12673
 
-
 
12674
  def read(self, iprot):
-
 
12675
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12676
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12677
      return
-
 
12678
    iprot.readStructBegin()
-
 
12679
    while True:
-
 
12680
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12681
      if ftype == TType.STOP:
-
 
12682
        break
-
 
12683
      if fid == 1:
-
 
12684
        if ftype == TType.I64:
-
 
12685
          self.user_id = iprot.readI64();
-
 
12686
        else:
-
 
12687
          iprot.skip(ftype)
-
 
12688
      elif fid == 2:
-
 
12689
        if ftype == TType.I64:
-
 
12690
          self.entity_id = iprot.readI64();
-
 
12691
        else:
-
 
12692
          iprot.skip(ftype)
-
 
12693
      else:
-
 
12694
        iprot.skip(ftype)
-
 
12695
      iprot.readFieldEnd()
-
 
12696
    iprot.readStructEnd()
-
 
12697
 
-
 
12698
  def write(self, oprot):
-
 
12699
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12700
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12701
      return
-
 
12702
    oprot.writeStructBegin('getUserNotes_args')
-
 
12703
    if self.user_id != None:
-
 
12704
      oprot.writeFieldBegin('user_id', TType.I64, 1)
-
 
12705
      oprot.writeI64(self.user_id)
-
 
12706
      oprot.writeFieldEnd()
-
 
12707
    if self.entity_id != None:
-
 
12708
      oprot.writeFieldBegin('entity_id', TType.I64, 2)
-
 
12709
      oprot.writeI64(self.entity_id)
-
 
12710
      oprot.writeFieldEnd()
-
 
12711
    oprot.writeFieldStop()
-
 
12712
    oprot.writeStructEnd()
-
 
12713
 
-
 
12714
  def __repr__(self):
-
 
12715
    L = ['%s=%r' % (key, value)
-
 
12716
      for key, value in self.__dict__.iteritems()]
-
 
12717
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12718
 
-
 
12719
  def __eq__(self, other):
-
 
12720
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
12721
 
-
 
12722
  def __ne__(self, other):
-
 
12723
    return not (self == other)
-
 
12724
 
-
 
12725
class getUserNotes_result:
-
 
12726
  """
-
 
12727
  Attributes:
-
 
12728
   - success
-
 
12729
  """
-
 
12730
 
-
 
12731
  thrift_spec = (
-
 
12732
    (0, TType.LIST, 'success', (TType.STRUCT,(UserNote, UserNote.thrift_spec)), None, ), # 0
-
 
12733
  )
-
 
12734
 
-
 
12735
  def __init__(self, success=None,):
-
 
12736
    self.success = success
-
 
12737
 
-
 
12738
  def read(self, iprot):
-
 
12739
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
12740
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
12741
      return
-
 
12742
    iprot.readStructBegin()
-
 
12743
    while True:
-
 
12744
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
12745
      if ftype == TType.STOP:
-
 
12746
        break
-
 
12747
      if fid == 0:
-
 
12748
        if ftype == TType.LIST:
-
 
12749
          self.success = []
-
 
12750
          (_etype131, _size128) = iprot.readListBegin()
-
 
12751
          for _i132 in xrange(_size128):
-
 
12752
            _elem133 = UserNote()
-
 
12753
            _elem133.read(iprot)
-
 
12754
            self.success.append(_elem133)
-
 
12755
          iprot.readListEnd()
-
 
12756
        else:
-
 
12757
          iprot.skip(ftype)
-
 
12758
      else:
-
 
12759
        iprot.skip(ftype)
-
 
12760
      iprot.readFieldEnd()
-
 
12761
    iprot.readStructEnd()
-
 
12762
 
-
 
12763
  def write(self, oprot):
-
 
12764
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
12765
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
12766
      return
-
 
12767
    oprot.writeStructBegin('getUserNotes_result')
-
 
12768
    if self.success != None:
-
 
12769
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
12770
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
12771
      for iter134 in self.success:
-
 
12772
        iter134.write(oprot)
-
 
12773
      oprot.writeListEnd()
-
 
12774
      oprot.writeFieldEnd()
-
 
12775
    oprot.writeFieldStop()
-
 
12776
    oprot.writeStructEnd()
-
 
12777
 
12392
  def __repr__(self):
12778
  def __repr__(self):
12393
    L = ['%s=%r' % (key, value)
12779
    L = ['%s=%r' % (key, value)
12394
      for key, value in self.__dict__.iteritems()]
12780
      for key, value in self.__dict__.iteritems()]
12395
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
12781
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
12396
 
12782