Subversion Repositories SmartDukaan

Rev

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

Rev 6850 Rev 6921
Line 623... Line 623...
623
    pass
623
    pass
624
 
624
 
625
  def getAllAliveItems(self, ):
625
  def getAllAliveItems(self, ):
626
    pass
626
    pass
627
 
627
 
628
  def getInsuranceAmount(self, itemId, insurerId, quantity):
628
  def getInsuranceAmount(self, itemId, price, insurerId, quantity):
629
    """
629
    """
630
    This method returns the insurance amount needed to insure the given item for a given quantity.
630
    This method returns the insurance amount needed to insure the given item for a given quantity.
631
 
631
 
632
    Parameters:
632
    Parameters:
633
     - itemId
633
     - itemId
-
 
634
     - price
634
     - insurerId
635
     - insurerId
635
     - quantity
636
     - quantity
636
    """
637
    """
637
    pass
638
    pass
638
 
639
 
Line 3172... Line 3173...
3172
    self._iprot.readMessageEnd()
3173
    self._iprot.readMessageEnd()
3173
    if result.success is not None:
3174
    if result.success is not None:
3174
      return result.success
3175
      return result.success
3175
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllAliveItems failed: unknown result");
3176
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllAliveItems failed: unknown result");
3176
 
3177
 
3177
  def getInsuranceAmount(self, itemId, insurerId, quantity):
3178
  def getInsuranceAmount(self, itemId, price, insurerId, quantity):
3178
    """
3179
    """
3179
    This method returns the insurance amount needed to insure the given item for a given quantity.
3180
    This method returns the insurance amount needed to insure the given item for a given quantity.
3180
 
3181
 
3181
    Parameters:
3182
    Parameters:
3182
     - itemId
3183
     - itemId
-
 
3184
     - price
3183
     - insurerId
3185
     - insurerId
3184
     - quantity
3186
     - quantity
3185
    """
3187
    """
3186
    self.send_getInsuranceAmount(itemId, insurerId, quantity)
3188
    self.send_getInsuranceAmount(itemId, price, insurerId, quantity)
3187
    return self.recv_getInsuranceAmount()
3189
    return self.recv_getInsuranceAmount()
3188
 
3190
 
3189
  def send_getInsuranceAmount(self, itemId, insurerId, quantity):
3191
  def send_getInsuranceAmount(self, itemId, price, insurerId, quantity):
3190
    self._oprot.writeMessageBegin('getInsuranceAmount', TMessageType.CALL, self._seqid)
3192
    self._oprot.writeMessageBegin('getInsuranceAmount', TMessageType.CALL, self._seqid)
3191
    args = getInsuranceAmount_args()
3193
    args = getInsuranceAmount_args()
3192
    args.itemId = itemId
3194
    args.itemId = itemId
-
 
3195
    args.price = price
3193
    args.insurerId = insurerId
3196
    args.insurerId = insurerId
3194
    args.quantity = quantity
3197
    args.quantity = quantity
3195
    args.write(self._oprot)
3198
    args.write(self._oprot)
3196
    self._oprot.writeMessageEnd()
3199
    self._oprot.writeMessageEnd()
3197
    self._oprot.trans.flush()
3200
    self._oprot.trans.flush()
Line 4350... Line 4353...
4350
  def process_getInsuranceAmount(self, seqid, iprot, oprot):
4353
  def process_getInsuranceAmount(self, seqid, iprot, oprot):
4351
    args = getInsuranceAmount_args()
4354
    args = getInsuranceAmount_args()
4352
    args.read(iprot)
4355
    args.read(iprot)
4353
    iprot.readMessageEnd()
4356
    iprot.readMessageEnd()
4354
    result = getInsuranceAmount_result()
4357
    result = getInsuranceAmount_result()
4355
    result.success = self._handler.getInsuranceAmount(args.itemId, args.insurerId, args.quantity)
4358
    result.success = self._handler.getInsuranceAmount(args.itemId, args.price, args.insurerId, args.quantity)
4356
    oprot.writeMessageBegin("getInsuranceAmount", TMessageType.REPLY, seqid)
4359
    oprot.writeMessageBegin("getInsuranceAmount", TMessageType.REPLY, seqid)
4357
    result.write(oprot)
4360
    result.write(oprot)
4358
    oprot.writeMessageEnd()
4361
    oprot.writeMessageEnd()
4359
    oprot.trans.flush()
4362
    oprot.trans.flush()
4360
 
4363
 
Line 14853... Line 14856...
14853
 
14856
 
14854
class getInsuranceAmount_args:
14857
class getInsuranceAmount_args:
14855
  """
14858
  """
14856
  Attributes:
14859
  Attributes:
14857
   - itemId
14860
   - itemId
-
 
14861
   - price
14858
   - insurerId
14862
   - insurerId
14859
   - quantity
14863
   - quantity
14860
  """
14864
  """
14861
 
14865
 
14862
  thrift_spec = (
14866
  thrift_spec = (
14863
    None, # 0
14867
    None, # 0
14864
    (1, TType.I64, 'itemId', None, None, ), # 1
14868
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
14869
    (2, TType.DOUBLE, 'price', None, None, ), # 2
14865
    (2, TType.I64, 'insurerId', None, None, ), # 2
14870
    (3, TType.I64, 'insurerId', None, None, ), # 3
14866
    (3, TType.I64, 'quantity', None, None, ), # 3
14871
    (4, TType.I64, 'quantity', None, None, ), # 4
14867
  )
14872
  )
14868
 
14873
 
14869
  def __init__(self, itemId=None, insurerId=None, quantity=None,):
14874
  def __init__(self, itemId=None, price=None, insurerId=None, quantity=None,):
14870
    self.itemId = itemId
14875
    self.itemId = itemId
-
 
14876
    self.price = price
14871
    self.insurerId = insurerId
14877
    self.insurerId = insurerId
14872
    self.quantity = quantity
14878
    self.quantity = quantity
14873
 
14879
 
14874
  def read(self, iprot):
14880
  def read(self, iprot):
14875
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
14881
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
Line 14884... Line 14890...
14884
        if ftype == TType.I64:
14890
        if ftype == TType.I64:
14885
          self.itemId = iprot.readI64();
14891
          self.itemId = iprot.readI64();
14886
        else:
14892
        else:
14887
          iprot.skip(ftype)
14893
          iprot.skip(ftype)
14888
      elif fid == 2:
14894
      elif fid == 2:
-
 
14895
        if ftype == TType.DOUBLE:
-
 
14896
          self.price = iprot.readDouble();
-
 
14897
        else:
-
 
14898
          iprot.skip(ftype)
-
 
14899
      elif fid == 3:
14889
        if ftype == TType.I64:
14900
        if ftype == TType.I64:
14890
          self.insurerId = iprot.readI64();
14901
          self.insurerId = iprot.readI64();
14891
        else:
14902
        else:
14892
          iprot.skip(ftype)
14903
          iprot.skip(ftype)
14893
      elif fid == 3:
14904
      elif fid == 4:
14894
        if ftype == TType.I64:
14905
        if ftype == TType.I64:
14895
          self.quantity = iprot.readI64();
14906
          self.quantity = iprot.readI64();
14896
        else:
14907
        else:
14897
          iprot.skip(ftype)
14908
          iprot.skip(ftype)
14898
      else:
14909
      else:
Line 14907... Line 14918...
14907
    oprot.writeStructBegin('getInsuranceAmount_args')
14918
    oprot.writeStructBegin('getInsuranceAmount_args')
14908
    if self.itemId is not None:
14919
    if self.itemId is not None:
14909
      oprot.writeFieldBegin('itemId', TType.I64, 1)
14920
      oprot.writeFieldBegin('itemId', TType.I64, 1)
14910
      oprot.writeI64(self.itemId)
14921
      oprot.writeI64(self.itemId)
14911
      oprot.writeFieldEnd()
14922
      oprot.writeFieldEnd()
-
 
14923
    if self.price is not None:
-
 
14924
      oprot.writeFieldBegin('price', TType.DOUBLE, 2)
-
 
14925
      oprot.writeDouble(self.price)
-
 
14926
      oprot.writeFieldEnd()
14912
    if self.insurerId is not None:
14927
    if self.insurerId is not None:
14913
      oprot.writeFieldBegin('insurerId', TType.I64, 2)
14928
      oprot.writeFieldBegin('insurerId', TType.I64, 3)
14914
      oprot.writeI64(self.insurerId)
14929
      oprot.writeI64(self.insurerId)
14915
      oprot.writeFieldEnd()
14930
      oprot.writeFieldEnd()
14916
    if self.quantity is not None:
14931
    if self.quantity is not None:
14917
      oprot.writeFieldBegin('quantity', TType.I64, 3)
14932
      oprot.writeFieldBegin('quantity', TType.I64, 4)
14918
      oprot.writeI64(self.quantity)
14933
      oprot.writeI64(self.quantity)
14919
      oprot.writeFieldEnd()
14934
      oprot.writeFieldEnd()
14920
    oprot.writeFieldStop()
14935
    oprot.writeFieldStop()
14921
    oprot.writeStructEnd()
14936
    oprot.writeStructEnd()
14922
 
14937