Subversion Repositories SmartDukaan

Rev

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

Rev 4008 Rev 4018
Line 642... Line 642...
642
     - transactionId
642
     - transactionId
643
     - category
643
     - category
644
    """
644
    """
645
    pass
645
    pass
646
 
646
 
-
 
647
  def getItemWiseRiskyOrdersCount(self, ):
-
 
648
    """
-
 
649
    Returns a map containing the number of risky orders keyed by item id. A risky order
-
 
650
    is defined as one whose shipping date is about to expire.
-
 
651
    """
-
 
652
    pass
-
 
653
 
647
 
654
 
648
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
655
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
649
  def __init__(self, iprot, oprot=None):
656
  def __init__(self, iprot, oprot=None):
650
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
657
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
651
 
658
 
Line 2720... Line 2727...
2720
    result = markTransactionAsProcessed_result()
2727
    result = markTransactionAsProcessed_result()
2721
    result.read(self._iprot)
2728
    result.read(self._iprot)
2722
    self._iprot.readMessageEnd()
2729
    self._iprot.readMessageEnd()
2723
    return
2730
    return
2724
 
2731
 
-
 
2732
  def getItemWiseRiskyOrdersCount(self, ):
-
 
2733
    """
-
 
2734
    Returns a map containing the number of risky orders keyed by item id. A risky order
-
 
2735
    is defined as one whose shipping date is about to expire.
-
 
2736
    """
-
 
2737
    self.send_getItemWiseRiskyOrdersCount()
-
 
2738
    return self.recv_getItemWiseRiskyOrdersCount()
-
 
2739
 
-
 
2740
  def send_getItemWiseRiskyOrdersCount(self, ):
-
 
2741
    self._oprot.writeMessageBegin('getItemWiseRiskyOrdersCount', TMessageType.CALL, self._seqid)
-
 
2742
    args = getItemWiseRiskyOrdersCount_args()
-
 
2743
    args.write(self._oprot)
-
 
2744
    self._oprot.writeMessageEnd()
-
 
2745
    self._oprot.trans.flush()
-
 
2746
 
-
 
2747
  def recv_getItemWiseRiskyOrdersCount(self, ):
-
 
2748
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2749
    if mtype == TMessageType.EXCEPTION:
-
 
2750
      x = TApplicationException()
-
 
2751
      x.read(self._iprot)
-
 
2752
      self._iprot.readMessageEnd()
-
 
2753
      raise x
-
 
2754
    result = getItemWiseRiskyOrdersCount_result()
-
 
2755
    result.read(self._iprot)
-
 
2756
    self._iprot.readMessageEnd()
-
 
2757
    if result.success is not None:
-
 
2758
      return result.success
-
 
2759
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getItemWiseRiskyOrdersCount failed: unknown result");
-
 
2760
 
2725
 
2761
 
2726
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2762
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
2727
  def __init__(self, handler):
2763
  def __init__(self, handler):
2728
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2764
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
2729
    self._processMap["createTransaction"] = Processor.process_createTransaction
2765
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 2781... Line 2817...
2781
    self._processMap["shiftToWarehouse"] = Processor.process_shiftToWarehouse
2817
    self._processMap["shiftToWarehouse"] = Processor.process_shiftToWarehouse
2782
    self._processMap["addDelayReason"] = Processor.process_addDelayReason
2818
    self._processMap["addDelayReason"] = Processor.process_addDelayReason
2783
    self._processMap["reconcileCodCollection"] = Processor.process_reconcileCodCollection
2819
    self._processMap["reconcileCodCollection"] = Processor.process_reconcileCodCollection
2784
    self._processMap["getTransactionsRequiringExtraProcessing"] = Processor.process_getTransactionsRequiringExtraProcessing
2820
    self._processMap["getTransactionsRequiringExtraProcessing"] = Processor.process_getTransactionsRequiringExtraProcessing
2785
    self._processMap["markTransactionAsProcessed"] = Processor.process_markTransactionAsProcessed
2821
    self._processMap["markTransactionAsProcessed"] = Processor.process_markTransactionAsProcessed
-
 
2822
    self._processMap["getItemWiseRiskyOrdersCount"] = Processor.process_getItemWiseRiskyOrdersCount
2786
 
2823
 
2787
  def process(self, iprot, oprot):
2824
  def process(self, iprot, oprot):
2788
    (name, type, seqid) = iprot.readMessageBegin()
2825
    (name, type, seqid) = iprot.readMessageBegin()
2789
    if name not in self._processMap:
2826
    if name not in self._processMap:
2790
      iprot.skip(TType.STRUCT)
2827
      iprot.skip(TType.STRUCT)
Line 3562... Line 3599...
3562
    oprot.writeMessageBegin("markTransactionAsProcessed", TMessageType.REPLY, seqid)
3599
    oprot.writeMessageBegin("markTransactionAsProcessed", TMessageType.REPLY, seqid)
3563
    result.write(oprot)
3600
    result.write(oprot)
3564
    oprot.writeMessageEnd()
3601
    oprot.writeMessageEnd()
3565
    oprot.trans.flush()
3602
    oprot.trans.flush()
3566
 
3603
 
-
 
3604
  def process_getItemWiseRiskyOrdersCount(self, seqid, iprot, oprot):
-
 
3605
    args = getItemWiseRiskyOrdersCount_args()
-
 
3606
    args.read(iprot)
-
 
3607
    iprot.readMessageEnd()
-
 
3608
    result = getItemWiseRiskyOrdersCount_result()
-
 
3609
    result.success = self._handler.getItemWiseRiskyOrdersCount()
-
 
3610
    oprot.writeMessageBegin("getItemWiseRiskyOrdersCount", TMessageType.REPLY, seqid)
-
 
3611
    result.write(oprot)
-
 
3612
    oprot.writeMessageEnd()
-
 
3613
    oprot.trans.flush()
-
 
3614
 
3567
 
3615
 
3568
# HELPER FUNCTIONS AND STRUCTURES
3616
# HELPER FUNCTIONS AND STRUCTURES
3569
 
3617
 
3570
class createTransaction_args:
3618
class createTransaction_args:
3571
  """
3619
  """
Line 11751... Line 11799...
11751
    oprot.writeFieldStop()
11799
    oprot.writeFieldStop()
11752
    oprot.writeStructEnd()
11800
    oprot.writeStructEnd()
11753
 
11801
 
11754
  def validate(self):
11802
  def validate(self):
11755
    return
11803
    return
-
 
11804
 
-
 
11805
 
-
 
11806
  def __repr__(self):
-
 
11807
    L = ['%s=%r' % (key, value)
-
 
11808
      for key, value in self.__dict__.iteritems()]
-
 
11809
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11810
 
-
 
11811
  def __eq__(self, other):
-
 
11812
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11813
 
-
 
11814
  def __ne__(self, other):
-
 
11815
    return not (self == other)
-
 
11816
 
-
 
11817
class getItemWiseRiskyOrdersCount_args:
-
 
11818
 
-
 
11819
  thrift_spec = (
-
 
11820
  )
-
 
11821
 
-
 
11822
  def read(self, iprot):
-
 
11823
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11824
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11825
      return
-
 
11826
    iprot.readStructBegin()
-
 
11827
    while True:
-
 
11828
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11829
      if ftype == TType.STOP:
-
 
11830
        break
-
 
11831
      else:
-
 
11832
        iprot.skip(ftype)
-
 
11833
      iprot.readFieldEnd()
-
 
11834
    iprot.readStructEnd()
-
 
11835
 
-
 
11836
  def write(self, oprot):
-
 
11837
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11838
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11839
      return
-
 
11840
    oprot.writeStructBegin('getItemWiseRiskyOrdersCount_args')
-
 
11841
    oprot.writeFieldStop()
-
 
11842
    oprot.writeStructEnd()
-
 
11843
 
-
 
11844
  def validate(self):
-
 
11845
    return
-
 
11846
 
-
 
11847
 
-
 
11848
  def __repr__(self):
-
 
11849
    L = ['%s=%r' % (key, value)
-
 
11850
      for key, value in self.__dict__.iteritems()]
-
 
11851
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
11852
 
-
 
11853
  def __eq__(self, other):
-
 
11854
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
11855
 
-
 
11856
  def __ne__(self, other):
-
 
11857
    return not (self == other)
-
 
11858
 
-
 
11859
class getItemWiseRiskyOrdersCount_result:
-
 
11860
  """
-
 
11861
  Attributes:
-
 
11862
   - success
-
 
11863
  """
-
 
11864
 
-
 
11865
  thrift_spec = (
-
 
11866
    (0, TType.MAP, 'success', (TType.I64,None,TType.I64,None), None, ), # 0
-
 
11867
  )
-
 
11868
 
-
 
11869
  def __init__(self, success=None,):
-
 
11870
    self.success = success
-
 
11871
 
-
 
11872
  def read(self, iprot):
-
 
11873
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
11874
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
11875
      return
-
 
11876
    iprot.readStructBegin()
-
 
11877
    while True:
-
 
11878
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
11879
      if ftype == TType.STOP:
-
 
11880
        break
-
 
11881
      if fid == 0:
-
 
11882
        if ftype == TType.MAP:
-
 
11883
          self.success = {}
-
 
11884
          (_ktype218, _vtype219, _size217 ) = iprot.readMapBegin() 
-
 
11885
          for _i221 in xrange(_size217):
-
 
11886
            _key222 = iprot.readI64();
-
 
11887
            _val223 = iprot.readI64();
-
 
11888
            self.success[_key222] = _val223
-
 
11889
          iprot.readMapEnd()
-
 
11890
        else:
-
 
11891
          iprot.skip(ftype)
-
 
11892
      else:
-
 
11893
        iprot.skip(ftype)
-
 
11894
      iprot.readFieldEnd()
-
 
11895
    iprot.readStructEnd()
-
 
11896
 
-
 
11897
  def write(self, oprot):
-
 
11898
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
11899
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
11900
      return
-
 
11901
    oprot.writeStructBegin('getItemWiseRiskyOrdersCount_result')
-
 
11902
    if self.success is not None:
-
 
11903
      oprot.writeFieldBegin('success', TType.MAP, 0)
-
 
11904
      oprot.writeMapBegin(TType.I64, TType.I64, len(self.success))
-
 
11905
      for kiter224,viter225 in self.success.items():
-
 
11906
        oprot.writeI64(kiter224)
-
 
11907
        oprot.writeI64(viter225)
-
 
11908
      oprot.writeMapEnd()
-
 
11909
      oprot.writeFieldEnd()
-
 
11910
    oprot.writeFieldStop()
-
 
11911
    oprot.writeStructEnd()
-
 
11912
 
-
 
11913
  def validate(self):
-
 
11914
    return
11756
 
11915
 
11757
 
11916
 
11758
  def __repr__(self):
11917
  def __repr__(self):
11759
    L = ['%s=%r' % (key, value)
11918
    L = ['%s=%r' % (key, value)
11760
      for key, value in self.__dict__.iteritems()]
11919
      for key, value in self.__dict__.iteritems()]