Subversion Repositories SmartDukaan

Rev

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

Rev 7092 Rev 7746
Line 28... Line 28...
28
     - startOn
28
     - startOn
29
     - endOn
29
     - endOn
30
    """
30
    """
31
    pass
31
    pass
32
 
32
 
-
 
33
  def removeAllCouponsByPromotionId(self, promotionId):
-
 
34
    """
-
 
35
    Parameters:
-
 
36
     - promotionId
-
 
37
    """
-
 
38
    pass
-
 
39
 
33
  def getCoupon(self, couponCode):
40
  def getCoupon(self, couponCode):
34
    """
41
    """
35
    Parameters:
42
    Parameters:
36
     - couponCode
43
     - couponCode
37
    """
44
    """
Line 249... Line 256...
249
    self._iprot.readMessageEnd()
256
    self._iprot.readMessageEnd()
250
    if result.pex is not None:
257
    if result.pex is not None:
251
      raise result.pex
258
      raise result.pex
252
    return
259
    return
253
 
260
 
-
 
261
  def removeAllCouponsByPromotionId(self, promotionId):
-
 
262
    """
-
 
263
    Parameters:
-
 
264
     - promotionId
-
 
265
    """
-
 
266
    self.send_removeAllCouponsByPromotionId(promotionId)
-
 
267
    return self.recv_removeAllCouponsByPromotionId()
-
 
268
 
-
 
269
  def send_removeAllCouponsByPromotionId(self, promotionId):
-
 
270
    self._oprot.writeMessageBegin('removeAllCouponsByPromotionId', TMessageType.CALL, self._seqid)
-
 
271
    args = removeAllCouponsByPromotionId_args()
-
 
272
    args.promotionId = promotionId
-
 
273
    args.write(self._oprot)
-
 
274
    self._oprot.writeMessageEnd()
-
 
275
    self._oprot.trans.flush()
-
 
276
 
-
 
277
  def recv_removeAllCouponsByPromotionId(self, ):
-
 
278
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
279
    if mtype == TMessageType.EXCEPTION:
-
 
280
      x = TApplicationException()
-
 
281
      x.read(self._iprot)
-
 
282
      self._iprot.readMessageEnd()
-
 
283
      raise x
-
 
284
    result = removeAllCouponsByPromotionId_result()
-
 
285
    result.read(self._iprot)
-
 
286
    self._iprot.readMessageEnd()
-
 
287
    if result.success is not None:
-
 
288
      return result.success
-
 
289
    if result.pex is not None:
-
 
290
      raise result.pex
-
 
291
    raise TApplicationException(TApplicationException.MISSING_RESULT, "removeAllCouponsByPromotionId failed: unknown result");
-
 
292
 
254
  def getCoupon(self, couponCode):
293
  def getCoupon(self, couponCode):
255
    """
294
    """
256
    Parameters:
295
    Parameters:
257
     - couponCode
296
     - couponCode
258
    """
297
    """
Line 1001... Line 1040...
1001
 
1040
 
1002
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1041
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1003
  def __init__(self, handler):
1042
  def __init__(self, handler):
1004
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1043
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1005
    self._processMap["createPromotion"] = Processor.process_createPromotion
1044
    self._processMap["createPromotion"] = Processor.process_createPromotion
-
 
1045
    self._processMap["removeAllCouponsByPromotionId"] = Processor.process_removeAllCouponsByPromotionId
1006
    self._processMap["getCoupon"] = Processor.process_getCoupon
1046
    self._processMap["getCoupon"] = Processor.process_getCoupon
1007
    self._processMap["isGiftVoucher"] = Processor.process_isGiftVoucher
1047
    self._processMap["isGiftVoucher"] = Processor.process_isGiftVoucher
1008
    self._processMap["isCodApplicable"] = Processor.process_isCodApplicable
1048
    self._processMap["isCodApplicable"] = Processor.process_isCodApplicable
1009
    self._processMap["getAllPromotions"] = Processor.process_getAllPromotions
1049
    self._processMap["getAllPromotions"] = Processor.process_getAllPromotions
1010
    self._processMap["getPromotionById"] = Processor.process_getPromotionById
1050
    self._processMap["getPromotionById"] = Processor.process_getPromotionById
Line 1054... Line 1094...
1054
    oprot.writeMessageBegin("createPromotion", TMessageType.REPLY, seqid)
1094
    oprot.writeMessageBegin("createPromotion", TMessageType.REPLY, seqid)
1055
    result.write(oprot)
1095
    result.write(oprot)
1056
    oprot.writeMessageEnd()
1096
    oprot.writeMessageEnd()
1057
    oprot.trans.flush()
1097
    oprot.trans.flush()
1058
 
1098
 
-
 
1099
  def process_removeAllCouponsByPromotionId(self, seqid, iprot, oprot):
-
 
1100
    args = removeAllCouponsByPromotionId_args()
-
 
1101
    args.read(iprot)
-
 
1102
    iprot.readMessageEnd()
-
 
1103
    result = removeAllCouponsByPromotionId_result()
-
 
1104
    try:
-
 
1105
      result.success = self._handler.removeAllCouponsByPromotionId(args.promotionId)
-
 
1106
    except PromotionException, pex:
-
 
1107
      result.pex = pex
-
 
1108
    oprot.writeMessageBegin("removeAllCouponsByPromotionId", TMessageType.REPLY, seqid)
-
 
1109
    result.write(oprot)
-
 
1110
    oprot.writeMessageEnd()
-
 
1111
    oprot.trans.flush()
-
 
1112
 
1059
  def process_getCoupon(self, seqid, iprot, oprot):
1113
  def process_getCoupon(self, seqid, iprot, oprot):
1060
    args = getCoupon_args()
1114
    args = getCoupon_args()
1061
    args.read(iprot)
1115
    args.read(iprot)
1062
    iprot.readMessageEnd()
1116
    iprot.readMessageEnd()
1063
    result = getCoupon_result()
1117
    result = getCoupon_result()
Line 1504... Line 1558...
1504
    if self.pex is not None:
1558
    if self.pex is not None:
1505
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1559
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
1506
      self.pex.write(oprot)
1560
      self.pex.write(oprot)
1507
      oprot.writeFieldEnd()
1561
      oprot.writeFieldEnd()
1508
    oprot.writeFieldStop()
1562
    oprot.writeFieldStop()
-
 
1563
    oprot.writeStructEnd()
-
 
1564
 
-
 
1565
  def validate(self):
-
 
1566
    return
-
 
1567
 
-
 
1568
 
-
 
1569
  def __repr__(self):
-
 
1570
    L = ['%s=%r' % (key, value)
-
 
1571
      for key, value in self.__dict__.iteritems()]
-
 
1572
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1573
 
-
 
1574
  def __eq__(self, other):
-
 
1575
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1576
 
-
 
1577
  def __ne__(self, other):
-
 
1578
    return not (self == other)
-
 
1579
 
-
 
1580
class removeAllCouponsByPromotionId_args:
-
 
1581
  """
-
 
1582
  Attributes:
-
 
1583
   - promotionId
-
 
1584
  """
-
 
1585
 
-
 
1586
  thrift_spec = (
-
 
1587
    None, # 0
-
 
1588
    (1, TType.I64, 'promotionId', None, None, ), # 1
-
 
1589
  )
-
 
1590
 
-
 
1591
  def __init__(self, promotionId=None,):
-
 
1592
    self.promotionId = promotionId
-
 
1593
 
-
 
1594
  def read(self, iprot):
-
 
1595
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1596
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1597
      return
-
 
1598
    iprot.readStructBegin()
-
 
1599
    while True:
-
 
1600
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1601
      if ftype == TType.STOP:
-
 
1602
        break
-
 
1603
      if fid == 1:
-
 
1604
        if ftype == TType.I64:
-
 
1605
          self.promotionId = iprot.readI64();
-
 
1606
        else:
-
 
1607
          iprot.skip(ftype)
-
 
1608
      else:
-
 
1609
        iprot.skip(ftype)
-
 
1610
      iprot.readFieldEnd()
-
 
1611
    iprot.readStructEnd()
-
 
1612
 
-
 
1613
  def write(self, oprot):
-
 
1614
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1615
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1616
      return
-
 
1617
    oprot.writeStructBegin('removeAllCouponsByPromotionId_args')
-
 
1618
    if self.promotionId is not None:
-
 
1619
      oprot.writeFieldBegin('promotionId', TType.I64, 1)
-
 
1620
      oprot.writeI64(self.promotionId)
-
 
1621
      oprot.writeFieldEnd()
-
 
1622
    oprot.writeFieldStop()
-
 
1623
    oprot.writeStructEnd()
-
 
1624
 
-
 
1625
  def validate(self):
-
 
1626
    return
-
 
1627
 
-
 
1628
 
-
 
1629
  def __repr__(self):
-
 
1630
    L = ['%s=%r' % (key, value)
-
 
1631
      for key, value in self.__dict__.iteritems()]
-
 
1632
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1633
 
-
 
1634
  def __eq__(self, other):
-
 
1635
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1636
 
-
 
1637
  def __ne__(self, other):
-
 
1638
    return not (self == other)
-
 
1639
 
-
 
1640
class removeAllCouponsByPromotionId_result:
-
 
1641
  """
-
 
1642
  Attributes:
-
 
1643
   - success
-
 
1644
   - pex
-
 
1645
  """
-
 
1646
 
-
 
1647
  thrift_spec = (
-
 
1648
    (0, TType.I64, 'success', None, None, ), # 0
-
 
1649
    (1, TType.STRUCT, 'pex', (PromotionException, PromotionException.thrift_spec), None, ), # 1
-
 
1650
  )
-
 
1651
 
-
 
1652
  def __init__(self, success=None, pex=None,):
-
 
1653
    self.success = success
-
 
1654
    self.pex = pex
-
 
1655
 
-
 
1656
  def read(self, iprot):
-
 
1657
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1658
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1659
      return
-
 
1660
    iprot.readStructBegin()
-
 
1661
    while True:
-
 
1662
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1663
      if ftype == TType.STOP:
-
 
1664
        break
-
 
1665
      if fid == 0:
-
 
1666
        if ftype == TType.I64:
-
 
1667
          self.success = iprot.readI64();
-
 
1668
        else:
-
 
1669
          iprot.skip(ftype)
-
 
1670
      elif fid == 1:
-
 
1671
        if ftype == TType.STRUCT:
-
 
1672
          self.pex = PromotionException()
-
 
1673
          self.pex.read(iprot)
-
 
1674
        else:
-
 
1675
          iprot.skip(ftype)
-
 
1676
      else:
-
 
1677
        iprot.skip(ftype)
-
 
1678
      iprot.readFieldEnd()
-
 
1679
    iprot.readStructEnd()
-
 
1680
 
-
 
1681
  def write(self, oprot):
-
 
1682
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1683
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1684
      return
-
 
1685
    oprot.writeStructBegin('removeAllCouponsByPromotionId_result')
-
 
1686
    if self.success is not None:
-
 
1687
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
1688
      oprot.writeI64(self.success)
-
 
1689
      oprot.writeFieldEnd()
-
 
1690
    if self.pex is not None:
-
 
1691
      oprot.writeFieldBegin('pex', TType.STRUCT, 1)
-
 
1692
      self.pex.write(oprot)
-
 
1693
      oprot.writeFieldEnd()
-
 
1694
    oprot.writeFieldStop()
1509
    oprot.writeStructEnd()
1695
    oprot.writeStructEnd()
1510
 
1696
 
1511
  def validate(self):
1697
  def validate(self):
1512
    return
1698
    return
1513
 
1699