Subversion Repositories SmartDukaan

Rev

Rev 11819 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11819 Rev 13521
Line 98... Line 98...
98
     - totalAmount
98
     - totalAmount
99
     - userId
99
     - userId
100
    """
100
    """
101
    pass
101
    pass
102
 
102
 
103
  def trackCouponUsage(self, couponCode, transactionId, userId):
103
  def trackCouponUsage(self, couponCode, transactionId, userId, amount, isDigital):
104
    """
104
    """
105
    Parameters:
105
    Parameters:
106
     - couponCode
106
     - couponCode
107
     - transactionId
107
     - transactionId
108
     - userId
108
     - userId
-
 
109
     - amount
-
 
110
     - isDigital
109
    """
111
    """
110
    pass
112
    pass
111
 
113
 
112
  def getCouponUsageCountByUser(self, couponCode, userId):
114
  def getCouponUsageCountByUser(self, couponCode, userId):
113
    """
115
    """
Line 578... Line 580...
578
      return result.success
580
      return result.success
579
    if result.pex is not None:
581
    if result.pex is not None:
580
      raise result.pex
582
      raise result.pex
581
    raise TApplicationException(TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
583
    raise TApplicationException(TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
582
 
584
 
583
  def trackCouponUsage(self, couponCode, transactionId, userId):
585
  def trackCouponUsage(self, couponCode, transactionId, userId, amount, isDigital):
584
    """
586
    """
585
    Parameters:
587
    Parameters:
586
     - couponCode
588
     - couponCode
587
     - transactionId
589
     - transactionId
588
     - userId
590
     - userId
-
 
591
     - amount
-
 
592
     - isDigital
589
    """
593
    """
590
    self.send_trackCouponUsage(couponCode, transactionId, userId)
594
    self.send_trackCouponUsage(couponCode, transactionId, userId, amount, isDigital)
591
    self.recv_trackCouponUsage()
595
    self.recv_trackCouponUsage()
592
 
596
 
593
  def send_trackCouponUsage(self, couponCode, transactionId, userId):
597
  def send_trackCouponUsage(self, couponCode, transactionId, userId, amount, isDigital):
594
    self._oprot.writeMessageBegin('trackCouponUsage', TMessageType.CALL, self._seqid)
598
    self._oprot.writeMessageBegin('trackCouponUsage', TMessageType.CALL, self._seqid)
595
    args = trackCouponUsage_args()
599
    args = trackCouponUsage_args()
596
    args.couponCode = couponCode
600
    args.couponCode = couponCode
597
    args.transactionId = transactionId
601
    args.transactionId = transactionId
598
    args.userId = userId
602
    args.userId = userId
-
 
603
    args.amount = amount
-
 
604
    args.isDigital = isDigital
599
    args.write(self._oprot)
605
    args.write(self._oprot)
600
    self._oprot.writeMessageEnd()
606
    self._oprot.writeMessageEnd()
601
    self._oprot.trans.flush()
607
    self._oprot.trans.flush()
602
 
608
 
603
  def recv_trackCouponUsage(self, ):
609
  def recv_trackCouponUsage(self, ):
Line 1243... Line 1249...
1243
    args = trackCouponUsage_args()
1249
    args = trackCouponUsage_args()
1244
    args.read(iprot)
1250
    args.read(iprot)
1245
    iprot.readMessageEnd()
1251
    iprot.readMessageEnd()
1246
    result = trackCouponUsage_result()
1252
    result = trackCouponUsage_result()
1247
    try:
1253
    try:
1248
      self._handler.trackCouponUsage(args.couponCode, args.transactionId, args.userId)
1254
      self._handler.trackCouponUsage(args.couponCode, args.transactionId, args.userId, args.amount, args.isDigital)
1249
    except PromotionException, pex:
1255
    except PromotionException, pex:
1250
      result.pex = pex
1256
      result.pex = pex
1251
    oprot.writeMessageBegin("trackCouponUsage", TMessageType.REPLY, seqid)
1257
    oprot.writeMessageBegin("trackCouponUsage", TMessageType.REPLY, seqid)
1252
    result.write(oprot)
1258
    result.write(oprot)
1253
    oprot.writeMessageEnd()
1259
    oprot.writeMessageEnd()
Line 2956... Line 2962...
2956
  """
2962
  """
2957
  Attributes:
2963
  Attributes:
2958
   - couponCode
2964
   - couponCode
2959
   - transactionId
2965
   - transactionId
2960
   - userId
2966
   - userId
-
 
2967
   - amount
-
 
2968
   - isDigital
2961
  """
2969
  """
2962
 
2970
 
2963
  thrift_spec = (
2971
  thrift_spec = (
2964
    None, # 0
2972
    None, # 0
2965
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2973
    (1, TType.STRING, 'couponCode', None, None, ), # 1
2966
    (2, TType.I64, 'transactionId', None, None, ), # 2
2974
    (2, TType.I64, 'transactionId', None, None, ), # 2
2967
    (3, TType.I64, 'userId', None, None, ), # 3
2975
    (3, TType.I64, 'userId', None, None, ), # 3
-
 
2976
    (4, TType.I64, 'amount', None, None, ), # 4
-
 
2977
    (5, TType.BOOL, 'isDigital', None, None, ), # 5
2968
  )
2978
  )
2969
 
2979
 
2970
  def __init__(self, couponCode=None, transactionId=None, userId=None,):
2980
  def __init__(self, couponCode=None, transactionId=None, userId=None, amount=None, isDigital=None,):
2971
    self.couponCode = couponCode
2981
    self.couponCode = couponCode
2972
    self.transactionId = transactionId
2982
    self.transactionId = transactionId
2973
    self.userId = userId
2983
    self.userId = userId
-
 
2984
    self.amount = amount
-
 
2985
    self.isDigital = isDigital
2974
 
2986
 
2975
  def read(self, iprot):
2987
  def read(self, iprot):
2976
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2988
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
2977
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2989
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
2978
      return
2990
      return
Line 2994... Line 3006...
2994
      elif fid == 3:
3006
      elif fid == 3:
2995
        if ftype == TType.I64:
3007
        if ftype == TType.I64:
2996
          self.userId = iprot.readI64();
3008
          self.userId = iprot.readI64();
2997
        else:
3009
        else:
2998
          iprot.skip(ftype)
3010
          iprot.skip(ftype)
-
 
3011
      elif fid == 4:
-
 
3012
        if ftype == TType.I64:
-
 
3013
          self.amount = iprot.readI64();
-
 
3014
        else:
-
 
3015
          iprot.skip(ftype)
-
 
3016
      elif fid == 5:
-
 
3017
        if ftype == TType.BOOL:
-
 
3018
          self.isDigital = iprot.readBool();
-
 
3019
        else:
-
 
3020
          iprot.skip(ftype)
2999
      else:
3021
      else:
3000
        iprot.skip(ftype)
3022
        iprot.skip(ftype)
3001
      iprot.readFieldEnd()
3023
      iprot.readFieldEnd()
3002
    iprot.readStructEnd()
3024
    iprot.readStructEnd()
3003
 
3025
 
Line 3016... Line 3038...
3016
      oprot.writeFieldEnd()
3038
      oprot.writeFieldEnd()
3017
    if self.userId is not None:
3039
    if self.userId is not None:
3018
      oprot.writeFieldBegin('userId', TType.I64, 3)
3040
      oprot.writeFieldBegin('userId', TType.I64, 3)
3019
      oprot.writeI64(self.userId)
3041
      oprot.writeI64(self.userId)
3020
      oprot.writeFieldEnd()
3042
      oprot.writeFieldEnd()
-
 
3043
    if self.amount is not None:
-
 
3044
      oprot.writeFieldBegin('amount', TType.I64, 4)
-
 
3045
      oprot.writeI64(self.amount)
-
 
3046
      oprot.writeFieldEnd()
-
 
3047
    if self.isDigital is not None:
-
 
3048
      oprot.writeFieldBegin('isDigital', TType.BOOL, 5)
-
 
3049
      oprot.writeBool(self.isDigital)
-
 
3050
      oprot.writeFieldEnd()
3021
    oprot.writeFieldStop()
3051
    oprot.writeFieldStop()
3022
    oprot.writeStructEnd()
3052
    oprot.writeStructEnd()
3023
 
3053
 
3024
  def validate(self):
3054
  def validate(self):
3025
    return
3055
    return