Subversion Repositories SmartDukaan

Rev

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

Rev 12722 Rev 15251
Line 715... Line 715...
715
    Parameters:
715
    Parameters:
716
     - counterId
716
     - counterId
717
    """
717
    """
718
    pass
718
    pass
719
 
719
 
-
 
720
  def getActiveAccessTokenForUser(self, userId, source):
-
 
721
    """
-
 
722
    Parameters:
-
 
723
     - userId
-
 
724
     - source
-
 
725
    """
-
 
726
    pass
-
 
727
 
-
 
728
  def validateAccessToken(self, accessToken):
-
 
729
    """
-
 
730
    Parameters:
-
 
731
     - accessToken
-
 
732
    """
-
 
733
    pass
-
 
734
 
720
 
735
 
721
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
736
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
722
  """
737
  """
723
  service
738
  service
724
  """
739
  """
Line 3434... Line 3449...
3434
    self._iprot.readMessageEnd()
3449
    self._iprot.readMessageEnd()
3435
    if result.success is not None:
3450
    if result.success is not None:
3436
      return result.success
3451
      return result.success
3437
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUsersByCounter failed: unknown result");
3452
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUsersByCounter failed: unknown result");
3438
 
3453
 
-
 
3454
  def getActiveAccessTokenForUser(self, userId, source):
-
 
3455
    """
-
 
3456
    Parameters:
-
 
3457
     - userId
-
 
3458
     - source
-
 
3459
    """
-
 
3460
    self.send_getActiveAccessTokenForUser(userId, source)
-
 
3461
    return self.recv_getActiveAccessTokenForUser()
-
 
3462
 
-
 
3463
  def send_getActiveAccessTokenForUser(self, userId, source):
-
 
3464
    self._oprot.writeMessageBegin('getActiveAccessTokenForUser', TMessageType.CALL, self._seqid)
-
 
3465
    args = getActiveAccessTokenForUser_args()
-
 
3466
    args.userId = userId
-
 
3467
    args.source = source
-
 
3468
    args.write(self._oprot)
-
 
3469
    self._oprot.writeMessageEnd()
-
 
3470
    self._oprot.trans.flush()
-
 
3471
 
-
 
3472
  def recv_getActiveAccessTokenForUser(self, ):
-
 
3473
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3474
    if mtype == TMessageType.EXCEPTION:
-
 
3475
      x = TApplicationException()
-
 
3476
      x.read(self._iprot)
-
 
3477
      self._iprot.readMessageEnd()
-
 
3478
      raise x
-
 
3479
    result = getActiveAccessTokenForUser_result()
-
 
3480
    result.read(self._iprot)
-
 
3481
    self._iprot.readMessageEnd()
-
 
3482
    if result.success is not None:
-
 
3483
      return result.success
-
 
3484
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getActiveAccessTokenForUser failed: unknown result");
-
 
3485
 
-
 
3486
  def validateAccessToken(self, accessToken):
-
 
3487
    """
-
 
3488
    Parameters:
-
 
3489
     - accessToken
-
 
3490
    """
-
 
3491
    self.send_validateAccessToken(accessToken)
-
 
3492
    return self.recv_validateAccessToken()
-
 
3493
 
-
 
3494
  def send_validateAccessToken(self, accessToken):
-
 
3495
    self._oprot.writeMessageBegin('validateAccessToken', TMessageType.CALL, self._seqid)
-
 
3496
    args = validateAccessToken_args()
-
 
3497
    args.accessToken = accessToken
-
 
3498
    args.write(self._oprot)
-
 
3499
    self._oprot.writeMessageEnd()
-
 
3500
    self._oprot.trans.flush()
-
 
3501
 
-
 
3502
  def recv_validateAccessToken(self, ):
-
 
3503
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3504
    if mtype == TMessageType.EXCEPTION:
-
 
3505
      x = TApplicationException()
-
 
3506
      x.read(self._iprot)
-
 
3507
      self._iprot.readMessageEnd()
-
 
3508
      raise x
-
 
3509
    result = validateAccessToken_result()
-
 
3510
    result.read(self._iprot)
-
 
3511
    self._iprot.readMessageEnd()
-
 
3512
    if result.success is not None:
-
 
3513
      return result.success
-
 
3514
    raise TApplicationException(TApplicationException.MISSING_RESULT, "validateAccessToken failed: unknown result");
-
 
3515
 
3439
 
3516
 
3440
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3517
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3441
  def __init__(self, handler):
3518
  def __init__(self, handler):
3442
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3519
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3443
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
3520
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
Line 3519... Line 3596...
3519
    self._processMap["changePrivateDealUserStatus"] = Processor.process_changePrivateDealUserStatus
3596
    self._processMap["changePrivateDealUserStatus"] = Processor.process_changePrivateDealUserStatus
3520
    self._processMap["getPrivateDealUser"] = Processor.process_getPrivateDealUser
3597
    self._processMap["getPrivateDealUser"] = Processor.process_getPrivateDealUser
3521
    self._processMap["registerCounter"] = Processor.process_registerCounter
3598
    self._processMap["registerCounter"] = Processor.process_registerCounter
3522
    self._processMap["searchCounter"] = Processor.process_searchCounter
3599
    self._processMap["searchCounter"] = Processor.process_searchCounter
3523
    self._processMap["getAllUsersByCounter"] = Processor.process_getAllUsersByCounter
3600
    self._processMap["getAllUsersByCounter"] = Processor.process_getAllUsersByCounter
-
 
3601
    self._processMap["getActiveAccessTokenForUser"] = Processor.process_getActiveAccessTokenForUser
-
 
3602
    self._processMap["validateAccessToken"] = Processor.process_validateAccessToken
3524
 
3603
 
3525
  def process(self, iprot, oprot):
3604
  def process(self, iprot, oprot):
3526
    (name, type, seqid) = iprot.readMessageBegin()
3605
    (name, type, seqid) = iprot.readMessageBegin()
3527
    if name not in self._processMap:
3606
    if name not in self._processMap:
3528
      iprot.skip(TType.STRUCT)
3607
      iprot.skip(TType.STRUCT)
Line 4602... Line 4681...
4602
    oprot.writeMessageBegin("getAllUsersByCounter", TMessageType.REPLY, seqid)
4681
    oprot.writeMessageBegin("getAllUsersByCounter", TMessageType.REPLY, seqid)
4603
    result.write(oprot)
4682
    result.write(oprot)
4604
    oprot.writeMessageEnd()
4683
    oprot.writeMessageEnd()
4605
    oprot.trans.flush()
4684
    oprot.trans.flush()
4606
 
4685
 
-
 
4686
  def process_getActiveAccessTokenForUser(self, seqid, iprot, oprot):
-
 
4687
    args = getActiveAccessTokenForUser_args()
-
 
4688
    args.read(iprot)
-
 
4689
    iprot.readMessageEnd()
-
 
4690
    result = getActiveAccessTokenForUser_result()
-
 
4691
    result.success = self._handler.getActiveAccessTokenForUser(args.userId, args.source)
-
 
4692
    oprot.writeMessageBegin("getActiveAccessTokenForUser", TMessageType.REPLY, seqid)
-
 
4693
    result.write(oprot)
-
 
4694
    oprot.writeMessageEnd()
-
 
4695
    oprot.trans.flush()
-
 
4696
 
-
 
4697
  def process_validateAccessToken(self, seqid, iprot, oprot):
-
 
4698
    args = validateAccessToken_args()
-
 
4699
    args.read(iprot)
-
 
4700
    iprot.readMessageEnd()
-
 
4701
    result = validateAccessToken_result()
-
 
4702
    result.success = self._handler.validateAccessToken(args.accessToken)
-
 
4703
    oprot.writeMessageBegin("validateAccessToken", TMessageType.REPLY, seqid)
-
 
4704
    result.write(oprot)
-
 
4705
    oprot.writeMessageEnd()
-
 
4706
    oprot.trans.flush()
-
 
4707
 
4607
 
4708
 
4608
# HELPER FUNCTIONS AND STRUCTURES
4709
# HELPER FUNCTIONS AND STRUCTURES
4609
 
4710
 
4610
class createAnonymousUser_args:
4711
class createAnonymousUser_args:
4611
  """
4712
  """
Line 15846... Line 15947...
15846
      oprot.writeFieldEnd()
15947
      oprot.writeFieldEnd()
15847
    oprot.writeFieldStop()
15948
    oprot.writeFieldStop()
15848
    oprot.writeStructEnd()
15949
    oprot.writeStructEnd()
15849
 
15950
 
15850
  def validate(self):
15951
  def validate(self):
-
 
15952
    return
-
 
15953
 
-
 
15954
 
-
 
15955
  def __repr__(self):
-
 
15956
    L = ['%s=%r' % (key, value)
-
 
15957
      for key, value in self.__dict__.iteritems()]
-
 
15958
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15959
 
-
 
15960
  def __eq__(self, other):
-
 
15961
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15962
 
-
 
15963
  def __ne__(self, other):
-
 
15964
    return not (self == other)
-
 
15965
 
-
 
15966
class getActiveAccessTokenForUser_args:
-
 
15967
  """
-
 
15968
  Attributes:
-
 
15969
   - userId
-
 
15970
   - source
-
 
15971
  """
-
 
15972
 
-
 
15973
  thrift_spec = (
-
 
15974
    None, # 0
-
 
15975
    (1, TType.I64, 'userId', None, None, ), # 1
-
 
15976
    (2, TType.STRING, 'source', None, None, ), # 2
-
 
15977
  )
-
 
15978
 
-
 
15979
  def __init__(self, userId=None, source=None,):
-
 
15980
    self.userId = userId
-
 
15981
    self.source = source
-
 
15982
 
-
 
15983
  def read(self, iprot):
-
 
15984
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15985
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15986
      return
-
 
15987
    iprot.readStructBegin()
-
 
15988
    while True:
-
 
15989
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15990
      if ftype == TType.STOP:
-
 
15991
        break
-
 
15992
      if fid == 1:
-
 
15993
        if ftype == TType.I64:
-
 
15994
          self.userId = iprot.readI64();
-
 
15995
        else:
-
 
15996
          iprot.skip(ftype)
-
 
15997
      elif fid == 2:
-
 
15998
        if ftype == TType.STRING:
-
 
15999
          self.source = iprot.readString();
-
 
16000
        else:
-
 
16001
          iprot.skip(ftype)
-
 
16002
      else:
-
 
16003
        iprot.skip(ftype)
-
 
16004
      iprot.readFieldEnd()
-
 
16005
    iprot.readStructEnd()
-
 
16006
 
-
 
16007
  def write(self, oprot):
-
 
16008
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
16009
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
16010
      return
-
 
16011
    oprot.writeStructBegin('getActiveAccessTokenForUser_args')
-
 
16012
    if self.userId is not None:
-
 
16013
      oprot.writeFieldBegin('userId', TType.I64, 1)
-
 
16014
      oprot.writeI64(self.userId)
-
 
16015
      oprot.writeFieldEnd()
-
 
16016
    if self.source is not None:
-
 
16017
      oprot.writeFieldBegin('source', TType.STRING, 2)
-
 
16018
      oprot.writeString(self.source)
-
 
16019
      oprot.writeFieldEnd()
-
 
16020
    oprot.writeFieldStop()
-
 
16021
    oprot.writeStructEnd()
-
 
16022
 
-
 
16023
  def validate(self):
-
 
16024
    return
-
 
16025
 
-
 
16026
 
-
 
16027
  def __repr__(self):
-
 
16028
    L = ['%s=%r' % (key, value)
-
 
16029
      for key, value in self.__dict__.iteritems()]
-
 
16030
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
16031
 
-
 
16032
  def __eq__(self, other):
-
 
16033
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
16034
 
-
 
16035
  def __ne__(self, other):
-
 
16036
    return not (self == other)
-
 
16037
 
-
 
16038
class getActiveAccessTokenForUser_result:
-
 
16039
  """
-
 
16040
  Attributes:
-
 
16041
   - success
-
 
16042
  """
-
 
16043
 
-
 
16044
  thrift_spec = (
-
 
16045
    (0, TType.STRING, 'success', None, None, ), # 0
-
 
16046
  )
-
 
16047
 
-
 
16048
  def __init__(self, success=None,):
-
 
16049
    self.success = success
-
 
16050
 
-
 
16051
  def read(self, iprot):
-
 
16052
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
16053
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
16054
      return
-
 
16055
    iprot.readStructBegin()
-
 
16056
    while True:
-
 
16057
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
16058
      if ftype == TType.STOP:
-
 
16059
        break
-
 
16060
      if fid == 0:
-
 
16061
        if ftype == TType.STRING:
-
 
16062
          self.success = iprot.readString();
-
 
16063
        else:
-
 
16064
          iprot.skip(ftype)
-
 
16065
      else:
-
 
16066
        iprot.skip(ftype)
-
 
16067
      iprot.readFieldEnd()
-
 
16068
    iprot.readStructEnd()
-
 
16069
 
-
 
16070
  def write(self, oprot):
-
 
16071
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
16072
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
16073
      return
-
 
16074
    oprot.writeStructBegin('getActiveAccessTokenForUser_result')
-
 
16075
    if self.success is not None:
-
 
16076
      oprot.writeFieldBegin('success', TType.STRING, 0)
-
 
16077
      oprot.writeString(self.success)
-
 
16078
      oprot.writeFieldEnd()
-
 
16079
    oprot.writeFieldStop()
-
 
16080
    oprot.writeStructEnd()
-
 
16081
 
-
 
16082
  def validate(self):
-
 
16083
    return
-
 
16084
 
-
 
16085
 
-
 
16086
  def __repr__(self):
-
 
16087
    L = ['%s=%r' % (key, value)
-
 
16088
      for key, value in self.__dict__.iteritems()]
-
 
16089
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
16090
 
-
 
16091
  def __eq__(self, other):
-
 
16092
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
16093
 
-
 
16094
  def __ne__(self, other):
-
 
16095
    return not (self == other)
-
 
16096
 
-
 
16097
class validateAccessToken_args:
-
 
16098
  """
-
 
16099
  Attributes:
-
 
16100
   - accessToken
-
 
16101
  """
-
 
16102
 
-
 
16103
  thrift_spec = (
-
 
16104
    None, # 0
-
 
16105
    (1, TType.STRING, 'accessToken', None, None, ), # 1
-
 
16106
  )
-
 
16107
 
-
 
16108
  def __init__(self, accessToken=None,):
-
 
16109
    self.accessToken = accessToken
-
 
16110
 
-
 
16111
  def read(self, iprot):
-
 
16112
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
16113
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
16114
      return
-
 
16115
    iprot.readStructBegin()
-
 
16116
    while True:
-
 
16117
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
16118
      if ftype == TType.STOP:
-
 
16119
        break
-
 
16120
      if fid == 1:
-
 
16121
        if ftype == TType.STRING:
-
 
16122
          self.accessToken = iprot.readString();
-
 
16123
        else:
-
 
16124
          iprot.skip(ftype)
-
 
16125
      else:
-
 
16126
        iprot.skip(ftype)
-
 
16127
      iprot.readFieldEnd()
-
 
16128
    iprot.readStructEnd()
-
 
16129
 
-
 
16130
  def write(self, oprot):
-
 
16131
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
16132
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
16133
      return
-
 
16134
    oprot.writeStructBegin('validateAccessToken_args')
-
 
16135
    if self.accessToken is not None:
-
 
16136
      oprot.writeFieldBegin('accessToken', TType.STRING, 1)
-
 
16137
      oprot.writeString(self.accessToken)
-
 
16138
      oprot.writeFieldEnd()
-
 
16139
    oprot.writeFieldStop()
-
 
16140
    oprot.writeStructEnd()
-
 
16141
 
-
 
16142
  def validate(self):
-
 
16143
    return
-
 
16144
 
-
 
16145
 
-
 
16146
  def __repr__(self):
-
 
16147
    L = ['%s=%r' % (key, value)
-
 
16148
      for key, value in self.__dict__.iteritems()]
-
 
16149
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
16150
 
-
 
16151
  def __eq__(self, other):
-
 
16152
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
16153
 
-
 
16154
  def __ne__(self, other):
-
 
16155
    return not (self == other)
-
 
16156
 
-
 
16157
class validateAccessToken_result:
-
 
16158
  """
-
 
16159
  Attributes:
-
 
16160
   - success
-
 
16161
  """
-
 
16162
 
-
 
16163
  thrift_spec = (
-
 
16164
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
16165
  )
-
 
16166
 
-
 
16167
  def __init__(self, success=None,):
-
 
16168
    self.success = success
-
 
16169
 
-
 
16170
  def read(self, iprot):
-
 
16171
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
16172
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
16173
      return
-
 
16174
    iprot.readStructBegin()
-
 
16175
    while True:
-
 
16176
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
16177
      if ftype == TType.STOP:
-
 
16178
        break
-
 
16179
      if fid == 0:
-
 
16180
        if ftype == TType.BOOL:
-
 
16181
          self.success = iprot.readBool();
-
 
16182
        else:
-
 
16183
          iprot.skip(ftype)
-
 
16184
      else:
-
 
16185
        iprot.skip(ftype)
-
 
16186
      iprot.readFieldEnd()
-
 
16187
    iprot.readStructEnd()
-
 
16188
 
-
 
16189
  def write(self, oprot):
-
 
16190
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
16191
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
16192
      return
-
 
16193
    oprot.writeStructBegin('validateAccessToken_result')
-
 
16194
    if self.success is not None:
-
 
16195
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
16196
      oprot.writeBool(self.success)
-
 
16197
      oprot.writeFieldEnd()
-
 
16198
    oprot.writeFieldStop()
-
 
16199
    oprot.writeStructEnd()
-
 
16200
 
-
 
16201
  def validate(self):
15851
    return
16202
    return
15852
 
16203
 
15853
 
16204
 
15854
  def __repr__(self):
16205
  def __repr__(self):
15855
    L = ['%s=%r' % (key, value)
16206
    L = ['%s=%r' % (key, value)