Subversion Repositories SmartDukaan

Rev

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

Rev 12696 Rev 12722
Line 700... Line 700...
700
     - counter
700
     - counter
701
     - userId
701
     - userId
702
    """
702
    """
703
    pass
703
    pass
704
 
704
 
-
 
705
  def searchCounter(self, type1, searchString):
-
 
706
    """
-
 
707
    Parameters:
-
 
708
     - type1
-
 
709
     - searchString
-
 
710
    """
-
 
711
    pass
-
 
712
 
-
 
713
  def getAllUsersByCounter(self, counterId):
-
 
714
    """
-
 
715
    Parameters:
-
 
716
     - counterId
-
 
717
    """
-
 
718
    pass
-
 
719
 
705
 
720
 
706
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
721
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
707
  """
722
  """
708
  service
723
  service
709
  """
724
  """
Line 3357... Line 3372...
3357
    self._iprot.readMessageEnd()
3372
    self._iprot.readMessageEnd()
3358
    if result.success is not None:
3373
    if result.success is not None:
3359
      return result.success
3374
      return result.success
3360
    raise TApplicationException(TApplicationException.MISSING_RESULT, "registerCounter failed: unknown result");
3375
    raise TApplicationException(TApplicationException.MISSING_RESULT, "registerCounter failed: unknown result");
3361
 
3376
 
-
 
3377
  def searchCounter(self, type1, searchString):
-
 
3378
    """
-
 
3379
    Parameters:
-
 
3380
     - type1
-
 
3381
     - searchString
-
 
3382
    """
-
 
3383
    self.send_searchCounter(type1, searchString)
-
 
3384
    return self.recv_searchCounter()
-
 
3385
 
-
 
3386
  def send_searchCounter(self, type1, searchString):
-
 
3387
    self._oprot.writeMessageBegin('searchCounter', TMessageType.CALL, self._seqid)
-
 
3388
    args = searchCounter_args()
-
 
3389
    args.type1 = type1
-
 
3390
    args.searchString = searchString
-
 
3391
    args.write(self._oprot)
-
 
3392
    self._oprot.writeMessageEnd()
-
 
3393
    self._oprot.trans.flush()
-
 
3394
 
-
 
3395
  def recv_searchCounter(self, ):
-
 
3396
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3397
    if mtype == TMessageType.EXCEPTION:
-
 
3398
      x = TApplicationException()
-
 
3399
      x.read(self._iprot)
-
 
3400
      self._iprot.readMessageEnd()
-
 
3401
      raise x
-
 
3402
    result = searchCounter_result()
-
 
3403
    result.read(self._iprot)
-
 
3404
    self._iprot.readMessageEnd()
-
 
3405
    if result.success is not None:
-
 
3406
      return result.success
-
 
3407
    raise TApplicationException(TApplicationException.MISSING_RESULT, "searchCounter failed: unknown result");
-
 
3408
 
-
 
3409
  def getAllUsersByCounter(self, counterId):
-
 
3410
    """
-
 
3411
    Parameters:
-
 
3412
     - counterId
-
 
3413
    """
-
 
3414
    self.send_getAllUsersByCounter(counterId)
-
 
3415
    return self.recv_getAllUsersByCounter()
-
 
3416
 
-
 
3417
  def send_getAllUsersByCounter(self, counterId):
-
 
3418
    self._oprot.writeMessageBegin('getAllUsersByCounter', TMessageType.CALL, self._seqid)
-
 
3419
    args = getAllUsersByCounter_args()
-
 
3420
    args.counterId = counterId
-
 
3421
    args.write(self._oprot)
-
 
3422
    self._oprot.writeMessageEnd()
-
 
3423
    self._oprot.trans.flush()
-
 
3424
 
-
 
3425
  def recv_getAllUsersByCounter(self, ):
-
 
3426
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3427
    if mtype == TMessageType.EXCEPTION:
-
 
3428
      x = TApplicationException()
-
 
3429
      x.read(self._iprot)
-
 
3430
      self._iprot.readMessageEnd()
-
 
3431
      raise x
-
 
3432
    result = getAllUsersByCounter_result()
-
 
3433
    result.read(self._iprot)
-
 
3434
    self._iprot.readMessageEnd()
-
 
3435
    if result.success is not None:
-
 
3436
      return result.success
-
 
3437
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUsersByCounter failed: unknown result");
-
 
3438
 
3362
 
3439
 
3363
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3440
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3364
  def __init__(self, handler):
3441
  def __init__(self, handler):
3365
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3442
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3366
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
3443
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
Line 3440... Line 3517...
3440
    self._processMap["isPrivateDealUser"] = Processor.process_isPrivateDealUser
3517
    self._processMap["isPrivateDealUser"] = Processor.process_isPrivateDealUser
3441
    self._processMap["addPrivateDealUser"] = Processor.process_addPrivateDealUser
3518
    self._processMap["addPrivateDealUser"] = Processor.process_addPrivateDealUser
3442
    self._processMap["changePrivateDealUserStatus"] = Processor.process_changePrivateDealUserStatus
3519
    self._processMap["changePrivateDealUserStatus"] = Processor.process_changePrivateDealUserStatus
3443
    self._processMap["getPrivateDealUser"] = Processor.process_getPrivateDealUser
3520
    self._processMap["getPrivateDealUser"] = Processor.process_getPrivateDealUser
3444
    self._processMap["registerCounter"] = Processor.process_registerCounter
3521
    self._processMap["registerCounter"] = Processor.process_registerCounter
-
 
3522
    self._processMap["searchCounter"] = Processor.process_searchCounter
-
 
3523
    self._processMap["getAllUsersByCounter"] = Processor.process_getAllUsersByCounter
3445
 
3524
 
3446
  def process(self, iprot, oprot):
3525
  def process(self, iprot, oprot):
3447
    (name, type, seqid) = iprot.readMessageBegin()
3526
    (name, type, seqid) = iprot.readMessageBegin()
3448
    if name not in self._processMap:
3527
    if name not in self._processMap:
3449
      iprot.skip(TType.STRUCT)
3528
      iprot.skip(TType.STRUCT)
Line 4501... Line 4580...
4501
    oprot.writeMessageBegin("registerCounter", TMessageType.REPLY, seqid)
4580
    oprot.writeMessageBegin("registerCounter", TMessageType.REPLY, seqid)
4502
    result.write(oprot)
4581
    result.write(oprot)
4503
    oprot.writeMessageEnd()
4582
    oprot.writeMessageEnd()
4504
    oprot.trans.flush()
4583
    oprot.trans.flush()
4505
 
4584
 
-
 
4585
  def process_searchCounter(self, seqid, iprot, oprot):
-
 
4586
    args = searchCounter_args()
-
 
4587
    args.read(iprot)
-
 
4588
    iprot.readMessageEnd()
-
 
4589
    result = searchCounter_result()
-
 
4590
    result.success = self._handler.searchCounter(args.type1, args.searchString)
-
 
4591
    oprot.writeMessageBegin("searchCounter", TMessageType.REPLY, seqid)
-
 
4592
    result.write(oprot)
-
 
4593
    oprot.writeMessageEnd()
-
 
4594
    oprot.trans.flush()
-
 
4595
 
-
 
4596
  def process_getAllUsersByCounter(self, seqid, iprot, oprot):
-
 
4597
    args = getAllUsersByCounter_args()
-
 
4598
    args.read(iprot)
-
 
4599
    iprot.readMessageEnd()
-
 
4600
    result = getAllUsersByCounter_result()
-
 
4601
    result.success = self._handler.getAllUsersByCounter(args.counterId)
-
 
4602
    oprot.writeMessageBegin("getAllUsersByCounter", TMessageType.REPLY, seqid)
-
 
4603
    result.write(oprot)
-
 
4604
    oprot.writeMessageEnd()
-
 
4605
    oprot.trans.flush()
-
 
4606
 
4506
 
4607
 
4507
# HELPER FUNCTIONS AND STRUCTURES
4608
# HELPER FUNCTIONS AND STRUCTURES
4508
 
4609
 
4509
class createAnonymousUser_args:
4610
class createAnonymousUser_args:
4510
  """
4611
  """
Line 15477... Line 15578...
15477
      oprot.writeFieldEnd()
15578
      oprot.writeFieldEnd()
15478
    oprot.writeFieldStop()
15579
    oprot.writeFieldStop()
15479
    oprot.writeStructEnd()
15580
    oprot.writeStructEnd()
15480
 
15581
 
15481
  def validate(self):
15582
  def validate(self):
-
 
15583
    return
-
 
15584
 
-
 
15585
 
-
 
15586
  def __repr__(self):
-
 
15587
    L = ['%s=%r' % (key, value)
-
 
15588
      for key, value in self.__dict__.iteritems()]
-
 
15589
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15590
 
-
 
15591
  def __eq__(self, other):
-
 
15592
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15593
 
-
 
15594
  def __ne__(self, other):
-
 
15595
    return not (self == other)
-
 
15596
 
-
 
15597
class searchCounter_args:
-
 
15598
  """
-
 
15599
  Attributes:
-
 
15600
   - type1
-
 
15601
   - searchString
-
 
15602
  """
-
 
15603
 
-
 
15604
  thrift_spec = (
-
 
15605
    None, # 0
-
 
15606
    (1, TType.STRING, 'type1', None, None, ), # 1
-
 
15607
    (2, TType.STRING, 'searchString', None, None, ), # 2
-
 
15608
  )
-
 
15609
 
-
 
15610
  def __init__(self, type1=None, searchString=None,):
-
 
15611
    self.type1 = type1
-
 
15612
    self.searchString = searchString
-
 
15613
 
-
 
15614
  def read(self, iprot):
-
 
15615
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15616
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15617
      return
-
 
15618
    iprot.readStructBegin()
-
 
15619
    while True:
-
 
15620
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15621
      if ftype == TType.STOP:
-
 
15622
        break
-
 
15623
      if fid == 1:
-
 
15624
        if ftype == TType.STRING:
-
 
15625
          self.type1 = iprot.readString();
-
 
15626
        else:
-
 
15627
          iprot.skip(ftype)
-
 
15628
      elif fid == 2:
-
 
15629
        if ftype == TType.STRING:
-
 
15630
          self.searchString = iprot.readString();
-
 
15631
        else:
-
 
15632
          iprot.skip(ftype)
-
 
15633
      else:
-
 
15634
        iprot.skip(ftype)
-
 
15635
      iprot.readFieldEnd()
-
 
15636
    iprot.readStructEnd()
-
 
15637
 
-
 
15638
  def write(self, oprot):
-
 
15639
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15640
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15641
      return
-
 
15642
    oprot.writeStructBegin('searchCounter_args')
-
 
15643
    if self.type1 is not None:
-
 
15644
      oprot.writeFieldBegin('type1', TType.STRING, 1)
-
 
15645
      oprot.writeString(self.type1)
-
 
15646
      oprot.writeFieldEnd()
-
 
15647
    if self.searchString is not None:
-
 
15648
      oprot.writeFieldBegin('searchString', TType.STRING, 2)
-
 
15649
      oprot.writeString(self.searchString)
-
 
15650
      oprot.writeFieldEnd()
-
 
15651
    oprot.writeFieldStop()
-
 
15652
    oprot.writeStructEnd()
-
 
15653
 
-
 
15654
  def validate(self):
-
 
15655
    return
-
 
15656
 
-
 
15657
 
-
 
15658
  def __repr__(self):
-
 
15659
    L = ['%s=%r' % (key, value)
-
 
15660
      for key, value in self.__dict__.iteritems()]
-
 
15661
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15662
 
-
 
15663
  def __eq__(self, other):
-
 
15664
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15665
 
-
 
15666
  def __ne__(self, other):
-
 
15667
    return not (self == other)
-
 
15668
 
-
 
15669
class searchCounter_result:
-
 
15670
  """
-
 
15671
  Attributes:
-
 
15672
   - success
-
 
15673
  """
-
 
15674
 
-
 
15675
  thrift_spec = (
-
 
15676
    (0, TType.LIST, 'success', (TType.STRUCT,(Counter, Counter.thrift_spec)), None, ), # 0
-
 
15677
  )
-
 
15678
 
-
 
15679
  def __init__(self, success=None,):
-
 
15680
    self.success = success
-
 
15681
 
-
 
15682
  def read(self, iprot):
-
 
15683
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15684
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15685
      return
-
 
15686
    iprot.readStructBegin()
-
 
15687
    while True:
-
 
15688
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15689
      if ftype == TType.STOP:
-
 
15690
        break
-
 
15691
      if fid == 0:
-
 
15692
        if ftype == TType.LIST:
-
 
15693
          self.success = []
-
 
15694
          (_etype237, _size234) = iprot.readListBegin()
-
 
15695
          for _i238 in xrange(_size234):
-
 
15696
            _elem239 = Counter()
-
 
15697
            _elem239.read(iprot)
-
 
15698
            self.success.append(_elem239)
-
 
15699
          iprot.readListEnd()
-
 
15700
        else:
-
 
15701
          iprot.skip(ftype)
-
 
15702
      else:
-
 
15703
        iprot.skip(ftype)
-
 
15704
      iprot.readFieldEnd()
-
 
15705
    iprot.readStructEnd()
-
 
15706
 
-
 
15707
  def write(self, oprot):
-
 
15708
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15709
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15710
      return
-
 
15711
    oprot.writeStructBegin('searchCounter_result')
-
 
15712
    if self.success is not None:
-
 
15713
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
15714
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
15715
      for iter240 in self.success:
-
 
15716
        iter240.write(oprot)
-
 
15717
      oprot.writeListEnd()
-
 
15718
      oprot.writeFieldEnd()
-
 
15719
    oprot.writeFieldStop()
-
 
15720
    oprot.writeStructEnd()
-
 
15721
 
-
 
15722
  def validate(self):
-
 
15723
    return
-
 
15724
 
-
 
15725
 
-
 
15726
  def __repr__(self):
-
 
15727
    L = ['%s=%r' % (key, value)
-
 
15728
      for key, value in self.__dict__.iteritems()]
-
 
15729
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15730
 
-
 
15731
  def __eq__(self, other):
-
 
15732
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15733
 
-
 
15734
  def __ne__(self, other):
-
 
15735
    return not (self == other)
-
 
15736
 
-
 
15737
class getAllUsersByCounter_args:
-
 
15738
  """
-
 
15739
  Attributes:
-
 
15740
   - counterId
-
 
15741
  """
-
 
15742
 
-
 
15743
  thrift_spec = (
-
 
15744
    None, # 0
-
 
15745
    (1, TType.I64, 'counterId', None, None, ), # 1
-
 
15746
  )
-
 
15747
 
-
 
15748
  def __init__(self, counterId=None,):
-
 
15749
    self.counterId = counterId
-
 
15750
 
-
 
15751
  def read(self, iprot):
-
 
15752
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15753
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15754
      return
-
 
15755
    iprot.readStructBegin()
-
 
15756
    while True:
-
 
15757
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15758
      if ftype == TType.STOP:
-
 
15759
        break
-
 
15760
      if fid == 1:
-
 
15761
        if ftype == TType.I64:
-
 
15762
          self.counterId = iprot.readI64();
-
 
15763
        else:
-
 
15764
          iprot.skip(ftype)
-
 
15765
      else:
-
 
15766
        iprot.skip(ftype)
-
 
15767
      iprot.readFieldEnd()
-
 
15768
    iprot.readStructEnd()
-
 
15769
 
-
 
15770
  def write(self, oprot):
-
 
15771
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15772
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15773
      return
-
 
15774
    oprot.writeStructBegin('getAllUsersByCounter_args')
-
 
15775
    if self.counterId is not None:
-
 
15776
      oprot.writeFieldBegin('counterId', TType.I64, 1)
-
 
15777
      oprot.writeI64(self.counterId)
-
 
15778
      oprot.writeFieldEnd()
-
 
15779
    oprot.writeFieldStop()
-
 
15780
    oprot.writeStructEnd()
-
 
15781
 
-
 
15782
  def validate(self):
-
 
15783
    return
-
 
15784
 
-
 
15785
 
-
 
15786
  def __repr__(self):
-
 
15787
    L = ['%s=%r' % (key, value)
-
 
15788
      for key, value in self.__dict__.iteritems()]
-
 
15789
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15790
 
-
 
15791
  def __eq__(self, other):
-
 
15792
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15793
 
-
 
15794
  def __ne__(self, other):
-
 
15795
    return not (self == other)
-
 
15796
 
-
 
15797
class getAllUsersByCounter_result:
-
 
15798
  """
-
 
15799
  Attributes:
-
 
15800
   - success
-
 
15801
  """
-
 
15802
 
-
 
15803
  thrift_spec = (
-
 
15804
    (0, TType.LIST, 'success', (TType.STRUCT,(User, User.thrift_spec)), None, ), # 0
-
 
15805
  )
-
 
15806
 
-
 
15807
  def __init__(self, success=None,):
-
 
15808
    self.success = success
-
 
15809
 
-
 
15810
  def read(self, iprot):
-
 
15811
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15812
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15813
      return
-
 
15814
    iprot.readStructBegin()
-
 
15815
    while True:
-
 
15816
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15817
      if ftype == TType.STOP:
-
 
15818
        break
-
 
15819
      if fid == 0:
-
 
15820
        if ftype == TType.LIST:
-
 
15821
          self.success = []
-
 
15822
          (_etype244, _size241) = iprot.readListBegin()
-
 
15823
          for _i245 in xrange(_size241):
-
 
15824
            _elem246 = User()
-
 
15825
            _elem246.read(iprot)
-
 
15826
            self.success.append(_elem246)
-
 
15827
          iprot.readListEnd()
-
 
15828
        else:
-
 
15829
          iprot.skip(ftype)
-
 
15830
      else:
-
 
15831
        iprot.skip(ftype)
-
 
15832
      iprot.readFieldEnd()
-
 
15833
    iprot.readStructEnd()
-
 
15834
 
-
 
15835
  def write(self, oprot):
-
 
15836
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15837
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15838
      return
-
 
15839
    oprot.writeStructBegin('getAllUsersByCounter_result')
-
 
15840
    if self.success is not None:
-
 
15841
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
15842
      oprot.writeListBegin(TType.STRUCT, len(self.success))
-
 
15843
      for iter247 in self.success:
-
 
15844
        iter247.write(oprot)
-
 
15845
      oprot.writeListEnd()
-
 
15846
      oprot.writeFieldEnd()
-
 
15847
    oprot.writeFieldStop()
-
 
15848
    oprot.writeStructEnd()
-
 
15849
 
-
 
15850
  def validate(self):
15482
    return
15851
    return
15483
 
15852
 
15484
 
15853
 
15485
  def __repr__(self):
15854
  def __repr__(self):
15486
    L = ['%s=%r' % (key, value)
15855
    L = ['%s=%r' % (key, value)