Subversion Repositories SmartDukaan

Rev

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

Rev 6643 Rev 7256
Line 43... Line 43...
43
     - destination_pin
43
     - destination_pin
44
     - type
44
     - type
45
    """
45
    """
46
    pass
46
    pass
47
 
47
 
-
 
48
  def getLogisticsEstimationForStore(self, itemId, destination_pin, type):
-
 
49
    """
-
 
50
    Parameters:
-
 
51
     - itemId
-
 
52
     - destination_pin
-
 
53
     - type
-
 
54
    """
-
 
55
    pass
-
 
56
 
48
  def getLogisticsInfo(self, destination_pincode, item_id, type, pickUp):
57
  def getLogisticsInfo(self, destination_pincode, item_id, type, pickUp):
49
    """
58
    """
50
    Same as above excpet that an airway bill number is also allocated and returned.
59
    Same as above excpet that an airway bill number is also allocated and returned.
51
 
60
 
52
    Parameters:
61
    Parameters:
Line 290... Line 299...
290
      return result.success
299
      return result.success
291
    if result.se is not None:
300
    if result.se is not None:
292
      raise result.se
301
      raise result.se
293
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");
302
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimation failed: unknown result");
294
 
303
 
-
 
304
  def getLogisticsEstimationForStore(self, itemId, destination_pin, type):
-
 
305
    """
-
 
306
    Parameters:
-
 
307
     - itemId
-
 
308
     - destination_pin
-
 
309
     - type
-
 
310
    """
-
 
311
    self.send_getLogisticsEstimationForStore(itemId, destination_pin, type)
-
 
312
    return self.recv_getLogisticsEstimationForStore()
-
 
313
 
-
 
314
  def send_getLogisticsEstimationForStore(self, itemId, destination_pin, type):
-
 
315
    self._oprot.writeMessageBegin('getLogisticsEstimationForStore', TMessageType.CALL, self._seqid)
-
 
316
    args = getLogisticsEstimationForStore_args()
-
 
317
    args.itemId = itemId
-
 
318
    args.destination_pin = destination_pin
-
 
319
    args.type = type
-
 
320
    args.write(self._oprot)
-
 
321
    self._oprot.writeMessageEnd()
-
 
322
    self._oprot.trans.flush()
-
 
323
 
-
 
324
  def recv_getLogisticsEstimationForStore(self, ):
-
 
325
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
326
    if mtype == TMessageType.EXCEPTION:
-
 
327
      x = TApplicationException()
-
 
328
      x.read(self._iprot)
-
 
329
      self._iprot.readMessageEnd()
-
 
330
      raise x
-
 
331
    result = getLogisticsEstimationForStore_result()
-
 
332
    result.read(self._iprot)
-
 
333
    self._iprot.readMessageEnd()
-
 
334
    if result.success is not None:
-
 
335
      return result.success
-
 
336
    if result.se is not None:
-
 
337
      raise result.se
-
 
338
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsEstimationForStore failed: unknown result");
-
 
339
 
295
  def getLogisticsInfo(self, destination_pincode, item_id, type, pickUp):
340
  def getLogisticsInfo(self, destination_pincode, item_id, type, pickUp):
296
    """
341
    """
297
    Same as above excpet that an airway bill number is also allocated and returned.
342
    Same as above excpet that an airway bill number is also allocated and returned.
298
 
343
 
299
    Parameters:
344
    Parameters:
Line 782... Line 827...
782
  def __init__(self, handler):
827
  def __init__(self, handler):
783
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
828
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
784
    self._processMap["getProvider"] = Processor.process_getProvider
829
    self._processMap["getProvider"] = Processor.process_getProvider
785
    self._processMap["getAllProviders"] = Processor.process_getAllProviders
830
    self._processMap["getAllProviders"] = Processor.process_getAllProviders
786
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
831
    self._processMap["getLogisticsEstimation"] = Processor.process_getLogisticsEstimation
-
 
832
    self._processMap["getLogisticsEstimationForStore"] = Processor.process_getLogisticsEstimationForStore
787
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
833
    self._processMap["getLogisticsInfo"] = Processor.process_getLogisticsInfo
788
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
834
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
789
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
835
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
790
    self._processMap["storeShipmentInfo"] = Processor.process_storeShipmentInfo
836
    self._processMap["storeShipmentInfo"] = Processor.process_storeShipmentInfo
791
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
837
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
Line 854... Line 900...
854
    oprot.writeMessageBegin("getLogisticsEstimation", TMessageType.REPLY, seqid)
900
    oprot.writeMessageBegin("getLogisticsEstimation", TMessageType.REPLY, seqid)
855
    result.write(oprot)
901
    result.write(oprot)
856
    oprot.writeMessageEnd()
902
    oprot.writeMessageEnd()
857
    oprot.trans.flush()
903
    oprot.trans.flush()
858
 
904
 
-
 
905
  def process_getLogisticsEstimationForStore(self, seqid, iprot, oprot):
-
 
906
    args = getLogisticsEstimationForStore_args()
-
 
907
    args.read(iprot)
-
 
908
    iprot.readMessageEnd()
-
 
909
    result = getLogisticsEstimationForStore_result()
-
 
910
    try:
-
 
911
      result.success = self._handler.getLogisticsEstimationForStore(args.itemId, args.destination_pin, args.type)
-
 
912
    except LogisticsServiceException, se:
-
 
913
      result.se = se
-
 
914
    oprot.writeMessageBegin("getLogisticsEstimationForStore", TMessageType.REPLY, seqid)
-
 
915
    result.write(oprot)
-
 
916
    oprot.writeMessageEnd()
-
 
917
    oprot.trans.flush()
-
 
918
 
859
  def process_getLogisticsInfo(self, seqid, iprot, oprot):
919
  def process_getLogisticsInfo(self, seqid, iprot, oprot):
860
    args = getLogisticsInfo_args()
920
    args = getLogisticsInfo_args()
861
    args.read(iprot)
921
    args.read(iprot)
862
    iprot.readMessageEnd()
922
    iprot.readMessageEnd()
863
    result = getLogisticsInfo_result()
923
    result = getLogisticsInfo_result()
Line 1421... Line 1481...
1421
    if self.success is not None:
1481
    if self.success is not None:
1422
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1482
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
1423
      self.success.write(oprot)
1483
      self.success.write(oprot)
1424
      oprot.writeFieldEnd()
1484
      oprot.writeFieldEnd()
1425
    if self.se is not None:
1485
    if self.se is not None:
-
 
1486
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
-
 
1487
      self.se.write(oprot)
-
 
1488
      oprot.writeFieldEnd()
-
 
1489
    oprot.writeFieldStop()
-
 
1490
    oprot.writeStructEnd()
-
 
1491
 
-
 
1492
  def validate(self):
-
 
1493
    return
-
 
1494
 
-
 
1495
 
-
 
1496
  def __repr__(self):
-
 
1497
    L = ['%s=%r' % (key, value)
-
 
1498
      for key, value in self.__dict__.iteritems()]
-
 
1499
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1500
 
-
 
1501
  def __eq__(self, other):
-
 
1502
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1503
 
-
 
1504
  def __ne__(self, other):
-
 
1505
    return not (self == other)
-
 
1506
 
-
 
1507
class getLogisticsEstimationForStore_args:
-
 
1508
  """
-
 
1509
  Attributes:
-
 
1510
   - itemId
-
 
1511
   - destination_pin
-
 
1512
   - type
-
 
1513
  """
-
 
1514
 
-
 
1515
  thrift_spec = (
-
 
1516
    None, # 0
-
 
1517
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
1518
    (2, TType.STRING, 'destination_pin', None, None, ), # 2
-
 
1519
    (3, TType.I32, 'type', None, None, ), # 3
-
 
1520
  )
-
 
1521
 
-
 
1522
  def __init__(self, itemId=None, destination_pin=None, type=None,):
-
 
1523
    self.itemId = itemId
-
 
1524
    self.destination_pin = destination_pin
-
 
1525
    self.type = type
-
 
1526
 
-
 
1527
  def read(self, iprot):
-
 
1528
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1529
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1530
      return
-
 
1531
    iprot.readStructBegin()
-
 
1532
    while True:
-
 
1533
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1534
      if ftype == TType.STOP:
-
 
1535
        break
-
 
1536
      if fid == 1:
-
 
1537
        if ftype == TType.I64:
-
 
1538
          self.itemId = iprot.readI64();
-
 
1539
        else:
-
 
1540
          iprot.skip(ftype)
-
 
1541
      elif fid == 2:
-
 
1542
        if ftype == TType.STRING:
-
 
1543
          self.destination_pin = iprot.readString();
-
 
1544
        else:
-
 
1545
          iprot.skip(ftype)
-
 
1546
      elif fid == 3:
-
 
1547
        if ftype == TType.I32:
-
 
1548
          self.type = iprot.readI32();
-
 
1549
        else:
-
 
1550
          iprot.skip(ftype)
-
 
1551
      else:
-
 
1552
        iprot.skip(ftype)
-
 
1553
      iprot.readFieldEnd()
-
 
1554
    iprot.readStructEnd()
-
 
1555
 
-
 
1556
  def write(self, oprot):
-
 
1557
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1558
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1559
      return
-
 
1560
    oprot.writeStructBegin('getLogisticsEstimationForStore_args')
-
 
1561
    if self.itemId is not None:
-
 
1562
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
1563
      oprot.writeI64(self.itemId)
-
 
1564
      oprot.writeFieldEnd()
-
 
1565
    if self.destination_pin is not None:
-
 
1566
      oprot.writeFieldBegin('destination_pin', TType.STRING, 2)
-
 
1567
      oprot.writeString(self.destination_pin)
-
 
1568
      oprot.writeFieldEnd()
-
 
1569
    if self.type is not None:
-
 
1570
      oprot.writeFieldBegin('type', TType.I32, 3)
-
 
1571
      oprot.writeI32(self.type)
-
 
1572
      oprot.writeFieldEnd()
-
 
1573
    oprot.writeFieldStop()
-
 
1574
    oprot.writeStructEnd()
-
 
1575
 
-
 
1576
  def validate(self):
-
 
1577
    return
-
 
1578
 
-
 
1579
 
-
 
1580
  def __repr__(self):
-
 
1581
    L = ['%s=%r' % (key, value)
-
 
1582
      for key, value in self.__dict__.iteritems()]
-
 
1583
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1584
 
-
 
1585
  def __eq__(self, other):
-
 
1586
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1587
 
-
 
1588
  def __ne__(self, other):
-
 
1589
    return not (self == other)
-
 
1590
 
-
 
1591
class getLogisticsEstimationForStore_result:
-
 
1592
  """
-
 
1593
  Attributes:
-
 
1594
   - success
-
 
1595
   - se
-
 
1596
  """
-
 
1597
 
-
 
1598
  thrift_spec = (
-
 
1599
    (0, TType.STRUCT, 'success', (LogisticsInfo, LogisticsInfo.thrift_spec), None, ), # 0
-
 
1600
    (1, TType.STRUCT, 'se', (LogisticsServiceException, LogisticsServiceException.thrift_spec), None, ), # 1
-
 
1601
  )
-
 
1602
 
-
 
1603
  def __init__(self, success=None, se=None,):
-
 
1604
    self.success = success
-
 
1605
    self.se = se
-
 
1606
 
-
 
1607
  def read(self, iprot):
-
 
1608
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1609
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1610
      return
-
 
1611
    iprot.readStructBegin()
-
 
1612
    while True:
-
 
1613
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1614
      if ftype == TType.STOP:
-
 
1615
        break
-
 
1616
      if fid == 0:
-
 
1617
        if ftype == TType.STRUCT:
-
 
1618
          self.success = LogisticsInfo()
-
 
1619
          self.success.read(iprot)
-
 
1620
        else:
-
 
1621
          iprot.skip(ftype)
-
 
1622
      elif fid == 1:
-
 
1623
        if ftype == TType.STRUCT:
-
 
1624
          self.se = LogisticsServiceException()
-
 
1625
          self.se.read(iprot)
-
 
1626
        else:
-
 
1627
          iprot.skip(ftype)
-
 
1628
      else:
-
 
1629
        iprot.skip(ftype)
-
 
1630
      iprot.readFieldEnd()
-
 
1631
    iprot.readStructEnd()
-
 
1632
 
-
 
1633
  def write(self, oprot):
-
 
1634
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1635
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1636
      return
-
 
1637
    oprot.writeStructBegin('getLogisticsEstimationForStore_result')
-
 
1638
    if self.success is not None:
-
 
1639
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
1640
      self.success.write(oprot)
-
 
1641
      oprot.writeFieldEnd()
-
 
1642
    if self.se is not None:
1426
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1643
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1427
      self.se.write(oprot)
1644
      self.se.write(oprot)
1428
      oprot.writeFieldEnd()
1645
      oprot.writeFieldEnd()
1429
    oprot.writeFieldStop()
1646
    oprot.writeFieldStop()
1430
    oprot.writeStructEnd()
1647
    oprot.writeStructEnd()