Subversion Repositories SmartDukaan

Rev

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

Rev 11980 Rev 12696
Line 692... Line 692...
692
    Parameters:
692
    Parameters:
693
     - userId
693
     - userId
694
    """
694
    """
695
    pass
695
    pass
696
 
696
 
-
 
697
  def registerCounter(self, counter, userId):
-
 
698
    """
-
 
699
    Parameters:
-
 
700
     - counter
-
 
701
     - userId
-
 
702
    """
-
 
703
    pass
-
 
704
 
697
 
705
 
698
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
706
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
699
  """
707
  """
700
  service
708
  service
701
  """
709
  """
Line 3317... Line 3325...
3317
    self._iprot.readMessageEnd()
3325
    self._iprot.readMessageEnd()
3318
    if result.success is not None:
3326
    if result.success is not None:
3319
      return result.success
3327
      return result.success
3320
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPrivateDealUser failed: unknown result");
3328
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPrivateDealUser failed: unknown result");
3321
 
3329
 
-
 
3330
  def registerCounter(self, counter, userId):
-
 
3331
    """
-
 
3332
    Parameters:
-
 
3333
     - counter
-
 
3334
     - userId
-
 
3335
    """
-
 
3336
    self.send_registerCounter(counter, userId)
-
 
3337
    return self.recv_registerCounter()
-
 
3338
 
-
 
3339
  def send_registerCounter(self, counter, userId):
-
 
3340
    self._oprot.writeMessageBegin('registerCounter', TMessageType.CALL, self._seqid)
-
 
3341
    args = registerCounter_args()
-
 
3342
    args.counter = counter
-
 
3343
    args.userId = userId
-
 
3344
    args.write(self._oprot)
-
 
3345
    self._oprot.writeMessageEnd()
-
 
3346
    self._oprot.trans.flush()
-
 
3347
 
-
 
3348
  def recv_registerCounter(self, ):
-
 
3349
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3350
    if mtype == TMessageType.EXCEPTION:
-
 
3351
      x = TApplicationException()
-
 
3352
      x.read(self._iprot)
-
 
3353
      self._iprot.readMessageEnd()
-
 
3354
      raise x
-
 
3355
    result = registerCounter_result()
-
 
3356
    result.read(self._iprot)
-
 
3357
    self._iprot.readMessageEnd()
-
 
3358
    if result.success is not None:
-
 
3359
      return result.success
-
 
3360
    raise TApplicationException(TApplicationException.MISSING_RESULT, "registerCounter failed: unknown result");
-
 
3361
 
3322
 
3362
 
3323
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3363
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3324
  def __init__(self, handler):
3364
  def __init__(self, handler):
3325
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3365
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3326
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
3366
    self._processMap["createAnonymousUser"] = Processor.process_createAnonymousUser
Line 3399... Line 3439...
3399
    self._processMap["validateCartPlus"] = Processor.process_validateCartPlus
3439
    self._processMap["validateCartPlus"] = Processor.process_validateCartPlus
3400
    self._processMap["isPrivateDealUser"] = Processor.process_isPrivateDealUser
3440
    self._processMap["isPrivateDealUser"] = Processor.process_isPrivateDealUser
3401
    self._processMap["addPrivateDealUser"] = Processor.process_addPrivateDealUser
3441
    self._processMap["addPrivateDealUser"] = Processor.process_addPrivateDealUser
3402
    self._processMap["changePrivateDealUserStatus"] = Processor.process_changePrivateDealUserStatus
3442
    self._processMap["changePrivateDealUserStatus"] = Processor.process_changePrivateDealUserStatus
3403
    self._processMap["getPrivateDealUser"] = Processor.process_getPrivateDealUser
3443
    self._processMap["getPrivateDealUser"] = Processor.process_getPrivateDealUser
-
 
3444
    self._processMap["registerCounter"] = Processor.process_registerCounter
3404
 
3445
 
3405
  def process(self, iprot, oprot):
3446
  def process(self, iprot, oprot):
3406
    (name, type, seqid) = iprot.readMessageBegin()
3447
    (name, type, seqid) = iprot.readMessageBegin()
3407
    if name not in self._processMap:
3448
    if name not in self._processMap:
3408
      iprot.skip(TType.STRUCT)
3449
      iprot.skip(TType.STRUCT)
Line 4449... Line 4490...
4449
    oprot.writeMessageBegin("getPrivateDealUser", TMessageType.REPLY, seqid)
4490
    oprot.writeMessageBegin("getPrivateDealUser", TMessageType.REPLY, seqid)
4450
    result.write(oprot)
4491
    result.write(oprot)
4451
    oprot.writeMessageEnd()
4492
    oprot.writeMessageEnd()
4452
    oprot.trans.flush()
4493
    oprot.trans.flush()
4453
 
4494
 
-
 
4495
  def process_registerCounter(self, seqid, iprot, oprot):
-
 
4496
    args = registerCounter_args()
-
 
4497
    args.read(iprot)
-
 
4498
    iprot.readMessageEnd()
-
 
4499
    result = registerCounter_result()
-
 
4500
    result.success = self._handler.registerCounter(args.counter, args.userId)
-
 
4501
    oprot.writeMessageBegin("registerCounter", TMessageType.REPLY, seqid)
-
 
4502
    result.write(oprot)
-
 
4503
    oprot.writeMessageEnd()
-
 
4504
    oprot.trans.flush()
-
 
4505
 
4454
 
4506
 
4455
# HELPER FUNCTIONS AND STRUCTURES
4507
# HELPER FUNCTIONS AND STRUCTURES
4456
 
4508
 
4457
class createAnonymousUser_args:
4509
class createAnonymousUser_args:
4458
  """
4510
  """
Line 15283... Line 15335...
15283
      oprot.writeFieldEnd()
15335
      oprot.writeFieldEnd()
15284
    oprot.writeFieldStop()
15336
    oprot.writeFieldStop()
15285
    oprot.writeStructEnd()
15337
    oprot.writeStructEnd()
15286
 
15338
 
15287
  def validate(self):
15339
  def validate(self):
-
 
15340
    return
-
 
15341
 
-
 
15342
 
-
 
15343
  def __repr__(self):
-
 
15344
    L = ['%s=%r' % (key, value)
-
 
15345
      for key, value in self.__dict__.iteritems()]
-
 
15346
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15347
 
-
 
15348
  def __eq__(self, other):
-
 
15349
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15350
 
-
 
15351
  def __ne__(self, other):
-
 
15352
    return not (self == other)
-
 
15353
 
-
 
15354
class registerCounter_args:
-
 
15355
  """
-
 
15356
  Attributes:
-
 
15357
   - counter
-
 
15358
   - userId
-
 
15359
  """
-
 
15360
 
-
 
15361
  thrift_spec = (
-
 
15362
    None, # 0
-
 
15363
    (1, TType.STRUCT, 'counter', (Counter, Counter.thrift_spec), None, ), # 1
-
 
15364
    (2, TType.I64, 'userId', None, None, ), # 2
-
 
15365
  )
-
 
15366
 
-
 
15367
  def __init__(self, counter=None, userId=None,):
-
 
15368
    self.counter = counter
-
 
15369
    self.userId = userId
-
 
15370
 
-
 
15371
  def read(self, iprot):
-
 
15372
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15373
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15374
      return
-
 
15375
    iprot.readStructBegin()
-
 
15376
    while True:
-
 
15377
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15378
      if ftype == TType.STOP:
-
 
15379
        break
-
 
15380
      if fid == 1:
-
 
15381
        if ftype == TType.STRUCT:
-
 
15382
          self.counter = Counter()
-
 
15383
          self.counter.read(iprot)
-
 
15384
        else:
-
 
15385
          iprot.skip(ftype)
-
 
15386
      elif fid == 2:
-
 
15387
        if ftype == TType.I64:
-
 
15388
          self.userId = iprot.readI64();
-
 
15389
        else:
-
 
15390
          iprot.skip(ftype)
-
 
15391
      else:
-
 
15392
        iprot.skip(ftype)
-
 
15393
      iprot.readFieldEnd()
-
 
15394
    iprot.readStructEnd()
-
 
15395
 
-
 
15396
  def write(self, oprot):
-
 
15397
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15398
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15399
      return
-
 
15400
    oprot.writeStructBegin('registerCounter_args')
-
 
15401
    if self.counter is not None:
-
 
15402
      oprot.writeFieldBegin('counter', TType.STRUCT, 1)
-
 
15403
      self.counter.write(oprot)
-
 
15404
      oprot.writeFieldEnd()
-
 
15405
    if self.userId is not None:
-
 
15406
      oprot.writeFieldBegin('userId', TType.I64, 2)
-
 
15407
      oprot.writeI64(self.userId)
-
 
15408
      oprot.writeFieldEnd()
-
 
15409
    oprot.writeFieldStop()
-
 
15410
    oprot.writeStructEnd()
-
 
15411
 
-
 
15412
  def validate(self):
-
 
15413
    return
-
 
15414
 
-
 
15415
 
-
 
15416
  def __repr__(self):
-
 
15417
    L = ['%s=%r' % (key, value)
-
 
15418
      for key, value in self.__dict__.iteritems()]
-
 
15419
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
15420
 
-
 
15421
  def __eq__(self, other):
-
 
15422
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
15423
 
-
 
15424
  def __ne__(self, other):
-
 
15425
    return not (self == other)
-
 
15426
 
-
 
15427
class registerCounter_result:
-
 
15428
  """
-
 
15429
  Attributes:
-
 
15430
   - success
-
 
15431
  """
-
 
15432
 
-
 
15433
  thrift_spec = (
-
 
15434
    (0, TType.MAP, 'success', (TType.STRING,None,TType.STRING,None), None, ), # 0
-
 
15435
  )
-
 
15436
 
-
 
15437
  def __init__(self, success=None,):
-
 
15438
    self.success = success
-
 
15439
 
-
 
15440
  def read(self, iprot):
-
 
15441
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
15442
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
15443
      return
-
 
15444
    iprot.readStructBegin()
-
 
15445
    while True:
-
 
15446
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
15447
      if ftype == TType.STOP:
-
 
15448
        break
-
 
15449
      if fid == 0:
-
 
15450
        if ftype == TType.MAP:
-
 
15451
          self.success = {}
-
 
15452
          (_ktype226, _vtype227, _size225 ) = iprot.readMapBegin() 
-
 
15453
          for _i229 in xrange(_size225):
-
 
15454
            _key230 = iprot.readString();
-
 
15455
            _val231 = iprot.readString();
-
 
15456
            self.success[_key230] = _val231
-
 
15457
          iprot.readMapEnd()
-
 
15458
        else:
-
 
15459
          iprot.skip(ftype)
-
 
15460
      else:
-
 
15461
        iprot.skip(ftype)
-
 
15462
      iprot.readFieldEnd()
-
 
15463
    iprot.readStructEnd()
-
 
15464
 
-
 
15465
  def write(self, oprot):
-
 
15466
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
15467
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
15468
      return
-
 
15469
    oprot.writeStructBegin('registerCounter_result')
-
 
15470
    if self.success is not None:
-
 
15471
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
15472
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success))
-
 
15473
      for kiter232,viter233 in self.success.items():
-
 
15474
        oprot.writeString(kiter232)
-
 
15475
        oprot.writeString(viter233)
-
 
15476
      oprot.writeMapEnd()
-
 
15477
      oprot.writeFieldEnd()
-
 
15478
    oprot.writeFieldStop()
-
 
15479
    oprot.writeStructEnd()
-
 
15480
 
-
 
15481
  def validate(self):
15288
    return
15482
    return
15289
 
15483
 
15290
 
15484
 
15291
  def __repr__(self):
15485
  def __repr__(self):
15292
    L = ['%s=%r' % (key, value)
15486
    L = ['%s=%r' % (key, value)