Subversion Repositories SmartDukaan

Rev

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

Rev 2690 Rev 2700
Line 466... Line 466...
466
     - fromDate
466
     - fromDate
467
     - toDate
467
     - toDate
468
    """
468
    """
469
    pass
469
    pass
470
 
470
 
-
 
471
  def getReturnOrder(self, id):
-
 
472
    """
-
 
473
    Returns the ReturnOrder corresponding to the given id.
-
 
474
    Throws an exception if the return order with the given id couldn't be found.
-
 
475
    
-
 
476
    Parameters:
-
 
477
     - id
-
 
478
    """
-
 
479
    pass
-
 
480
 
471
  def processReturn(self, returnOrderId):
481
  def processReturn(self, returnOrderId):
472
    """
482
    """
473
    Marks the return order with the given id as processed. Raises an exception if no such return order exists.
483
    Marks the return order with the given id as processed. Raises an exception if no such return order exists.
474
    
484
    
475
    Parameters:
485
    Parameters:
Line 2065... Line 2075...
2065
    self._iprot.readMessageEnd()
2075
    self._iprot.readMessageEnd()
2066
    if result.success != None:
2076
    if result.success != None:
2067
      return result.success
2077
      return result.success
2068
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getReturnOrders failed: unknown result");
2078
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getReturnOrders failed: unknown result");
2069
 
2079
 
-
 
2080
  def getReturnOrder(self, id):
-
 
2081
    """
-
 
2082
    Returns the ReturnOrder corresponding to the given id.
-
 
2083
    Throws an exception if the return order with the given id couldn't be found.
-
 
2084
    
-
 
2085
    Parameters:
-
 
2086
     - id
-
 
2087
    """
-
 
2088
    self.send_getReturnOrder(id)
-
 
2089
    return self.recv_getReturnOrder()
-
 
2090
 
-
 
2091
  def send_getReturnOrder(self, id):
-
 
2092
    self._oprot.writeMessageBegin('getReturnOrder', TMessageType.CALL, self._seqid)
-
 
2093
    args = getReturnOrder_args()
-
 
2094
    args.id = id
-
 
2095
    args.write(self._oprot)
-
 
2096
    self._oprot.writeMessageEnd()
-
 
2097
    self._oprot.trans.flush()
-
 
2098
 
-
 
2099
  def recv_getReturnOrder(self, ):
-
 
2100
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
2101
    if mtype == TMessageType.EXCEPTION:
-
 
2102
      x = TApplicationException()
-
 
2103
      x.read(self._iprot)
-
 
2104
      self._iprot.readMessageEnd()
-
 
2105
      raise x
-
 
2106
    result = getReturnOrder_result()
-
 
2107
    result.read(self._iprot)
-
 
2108
    self._iprot.readMessageEnd()
-
 
2109
    if result.success != None:
-
 
2110
      return result.success
-
 
2111
    if result.ex != None:
-
 
2112
      raise result.ex
-
 
2113
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getReturnOrder failed: unknown result");
-
 
2114
 
2070
  def processReturn(self, returnOrderId):
2115
  def processReturn(self, returnOrderId):
2071
    """
2116
    """
2072
    Marks the return order with the given id as processed. Raises an exception if no such return order exists.
2117
    Marks the return order with the given id as processed. Raises an exception if no such return order exists.
2073
    
2118
    
2074
    Parameters:
2119
    Parameters:
Line 2147... Line 2192...
2147
    self._processMap["receiveReturn"] = Processor.process_receiveReturn
2192
    self._processMap["receiveReturn"] = Processor.process_receiveReturn
2148
    self._processMap["validateDoa"] = Processor.process_validateDoa
2193
    self._processMap["validateDoa"] = Processor.process_validateDoa
2149
    self._processMap["reshipOrder"] = Processor.process_reshipOrder
2194
    self._processMap["reshipOrder"] = Processor.process_reshipOrder
2150
    self._processMap["refundOrder"] = Processor.process_refundOrder
2195
    self._processMap["refundOrder"] = Processor.process_refundOrder
2151
    self._processMap["getReturnOrders"] = Processor.process_getReturnOrders
2196
    self._processMap["getReturnOrders"] = Processor.process_getReturnOrders
-
 
2197
    self._processMap["getReturnOrder"] = Processor.process_getReturnOrder
2152
    self._processMap["processReturn"] = Processor.process_processReturn
2198
    self._processMap["processReturn"] = Processor.process_processReturn
2153
 
2199
 
2154
  def process(self, iprot, oprot):
2200
  def process(self, iprot, oprot):
2155
    (name, type, seqid) = iprot.readMessageBegin()
2201
    (name, type, seqid) = iprot.readMessageBegin()
2156
    if name not in self._processMap:
2202
    if name not in self._processMap:
Line 2767... Line 2813...
2767
    oprot.writeMessageBegin("getReturnOrders", TMessageType.REPLY, seqid)
2813
    oprot.writeMessageBegin("getReturnOrders", TMessageType.REPLY, seqid)
2768
    result.write(oprot)
2814
    result.write(oprot)
2769
    oprot.writeMessageEnd()
2815
    oprot.writeMessageEnd()
2770
    oprot.trans.flush()
2816
    oprot.trans.flush()
2771
 
2817
 
-
 
2818
  def process_getReturnOrder(self, seqid, iprot, oprot):
-
 
2819
    args = getReturnOrder_args()
-
 
2820
    args.read(iprot)
-
 
2821
    iprot.readMessageEnd()
-
 
2822
    result = getReturnOrder_result()
-
 
2823
    try:
-
 
2824
      result.success = self._handler.getReturnOrder(args.id)
-
 
2825
    except TransactionServiceException, ex:
-
 
2826
      result.ex = ex
-
 
2827
    oprot.writeMessageBegin("getReturnOrder", TMessageType.REPLY, seqid)
-
 
2828
    result.write(oprot)
-
 
2829
    oprot.writeMessageEnd()
-
 
2830
    oprot.trans.flush()
-
 
2831
 
2772
  def process_processReturn(self, seqid, iprot, oprot):
2832
  def process_processReturn(self, seqid, iprot, oprot):
2773
    args = processReturn_args()
2833
    args = processReturn_args()
2774
    args.read(iprot)
2834
    args.read(iprot)
2775
    iprot.readMessageEnd()
2835
    iprot.readMessageEnd()
2776
    result = processReturn_result()
2836
    result = processReturn_result()
Line 8728... Line 8788...
8728
      oprot.writeFieldEnd()
8788
      oprot.writeFieldEnd()
8729
    oprot.writeFieldStop()
8789
    oprot.writeFieldStop()
8730
    oprot.writeStructEnd()
8790
    oprot.writeStructEnd()
8731
 
8791
 
8732
  def __repr__(self):
8792
  def __repr__(self):
-
 
8793
    L = ['%s=%r' % (key, value)
-
 
8794
      for key, value in self.__dict__.iteritems()]
-
 
8795
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
8796
 
-
 
8797
  def __eq__(self, other):
-
 
8798
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
8799
 
-
 
8800
  def __ne__(self, other):
-
 
8801
    return not (self == other)
-
 
8802
 
-
 
8803
class getReturnOrder_args:
-
 
8804
  """
-
 
8805
  Attributes:
-
 
8806
   - id
-
 
8807
  """
-
 
8808
 
-
 
8809
  thrift_spec = (
-
 
8810
    None, # 0
-
 
8811
    (1, TType.I64, 'id', None, None, ), # 1
-
 
8812
  )
-
 
8813
 
-
 
8814
  def __init__(self, id=None,):
-
 
8815
    self.id = id
-
 
8816
 
-
 
8817
  def read(self, iprot):
-
 
8818
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
8819
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
8820
      return
-
 
8821
    iprot.readStructBegin()
-
 
8822
    while True:
-
 
8823
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
8824
      if ftype == TType.STOP:
-
 
8825
        break
-
 
8826
      if fid == 1:
-
 
8827
        if ftype == TType.I64:
-
 
8828
          self.id = iprot.readI64();
-
 
8829
        else:
-
 
8830
          iprot.skip(ftype)
-
 
8831
      else:
-
 
8832
        iprot.skip(ftype)
-
 
8833
      iprot.readFieldEnd()
-
 
8834
    iprot.readStructEnd()
-
 
8835
 
-
 
8836
  def write(self, oprot):
-
 
8837
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
8838
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
8839
      return
-
 
8840
    oprot.writeStructBegin('getReturnOrder_args')
-
 
8841
    if self.id != None:
-
 
8842
      oprot.writeFieldBegin('id', TType.I64, 1)
-
 
8843
      oprot.writeI64(self.id)
-
 
8844
      oprot.writeFieldEnd()
-
 
8845
    oprot.writeFieldStop()
-
 
8846
    oprot.writeStructEnd()
-
 
8847
 
-
 
8848
  def __repr__(self):
-
 
8849
    L = ['%s=%r' % (key, value)
-
 
8850
      for key, value in self.__dict__.iteritems()]
-
 
8851
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
8852
 
-
 
8853
  def __eq__(self, other):
-
 
8854
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
8855
 
-
 
8856
  def __ne__(self, other):
-
 
8857
    return not (self == other)
-
 
8858
 
-
 
8859
class getReturnOrder_result:
-
 
8860
  """
-
 
8861
  Attributes:
-
 
8862
   - success
-
 
8863
   - ex
-
 
8864
  """
-
 
8865
 
-
 
8866
  thrift_spec = (
-
 
8867
    (0, TType.STRUCT, 'success', (ReturnOrder, ReturnOrder.thrift_spec), None, ), # 0
-
 
8868
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
8869
  )
-
 
8870
 
-
 
8871
  def __init__(self, success=None, ex=None,):
-
 
8872
    self.success = success
-
 
8873
    self.ex = ex
-
 
8874
 
-
 
8875
  def read(self, iprot):
-
 
8876
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
8877
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
8878
      return
-
 
8879
    iprot.readStructBegin()
-
 
8880
    while True:
-
 
8881
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
8882
      if ftype == TType.STOP:
-
 
8883
        break
-
 
8884
      if fid == 0:
-
 
8885
        if ftype == TType.STRUCT:
-
 
8886
          self.success = ReturnOrder()
-
 
8887
          self.success.read(iprot)
-
 
8888
        else:
-
 
8889
          iprot.skip(ftype)
-
 
8890
      elif fid == 1:
-
 
8891
        if ftype == TType.STRUCT:
-
 
8892
          self.ex = TransactionServiceException()
-
 
8893
          self.ex.read(iprot)
-
 
8894
        else:
-
 
8895
          iprot.skip(ftype)
-
 
8896
      else:
-
 
8897
        iprot.skip(ftype)
-
 
8898
      iprot.readFieldEnd()
-
 
8899
    iprot.readStructEnd()
-
 
8900
 
-
 
8901
  def write(self, oprot):
-
 
8902
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
8903
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
8904
      return
-
 
8905
    oprot.writeStructBegin('getReturnOrder_result')
-
 
8906
    if self.success != None:
-
 
8907
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
-
 
8908
      self.success.write(oprot)
-
 
8909
      oprot.writeFieldEnd()
-
 
8910
    if self.ex != None:
-
 
8911
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
8912
      self.ex.write(oprot)
-
 
8913
      oprot.writeFieldEnd()
-
 
8914
    oprot.writeFieldStop()
-
 
8915
    oprot.writeStructEnd()
-
 
8916
 
-
 
8917
  def __repr__(self):
8733
    L = ['%s=%r' % (key, value)
8918
    L = ['%s=%r' % (key, value)
8734
      for key, value in self.__dict__.iteritems()]
8919
      for key, value in self.__dict__.iteritems()]
8735
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
8920
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
8736
 
8921
 
8737
  def __eq__(self, other):
8922
  def __eq__(self, other):