Subversion Repositories SmartDukaan

Rev

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

Rev 17556 Rev 17560
Line 1460... Line 1460...
1460
        searchTerm = req.get_param("searchTerm")
1460
        searchTerm = req.get_param("searchTerm")
1461
        result = Mongo.searchDummyDeals(searchTerm, limit, offset)
1461
        result = Mongo.searchDummyDeals(searchTerm, limit, offset)
1462
        resp.body = dumps(result)
1462
        resp.body = dumps(result)
1463
 
1463
 
1464
class DummyPricing:
1464
class DummyPricing:
1465
    def on_get(self,req,resp):
1465
    def on_get(self, req, resp):
1466
        skuBundleId = req.get_param_as_int("skuBundleId")
1466
        skuBundleId = req.get_param_as_int("skuBundleId")
1467
        result = Mongo.getDummyPricing(skuBundleId)
1467
        result = Mongo.getDummyPricing(skuBundleId)
1468
        resp.body = dumps(result)
1468
        resp.body = dumps(result)
1469
 
1469
 
1470
class DealObject:
1470
class DealObject:
1471
    def on_post(self,req, resp):
1471
    def on_post(self, req, resp):
1472
            
1472
            
1473
        try:
1473
        try:
1474
            result_json = json.loads(req.stream.read(), encoding='utf-8')
1474
            result_json = json.loads(req.stream.read(), encoding='utf-8')
1475
        except ValueError:
1475
        except ValueError:
1476
            raise falcon.HTTPError(falcon.HTTP_400,
1476
            raise falcon.HTTPError(falcon.HTTP_400,
Line 1478... Line 1478...
1478
                'Could not decode the request body. The '
1478
                'Could not decode the request body. The '
1479
                'JSON was incorrect.')
1479
                'JSON was incorrect.')
1480
        result = Mongo.addDealObject(result_json)
1480
        result = Mongo.addDealObject(result_json)
1481
        resp.body = dumps(result)
1481
        resp.body = dumps(result)
1482
    
1482
    
-
 
1483
    def on_get(self, req, resp):
-
 
1484
        offset = req.get_param_as_int("offset")
-
 
1485
        limit = req.get_param_as_int("limit")
-
 
1486
        
-
 
1487
        result = Mongo.getAllDealObjects(offset, limit)
-
 
1488
        resp.body = dumps(result)
-
 
1489
 
-
 
1490
    
1483
    
1491
    
1484
    
1492
    
1485
def main():
1493
def main():
1486
    #tagActivatedReatilers()
1494
    #tagActivatedReatilers()
1487
    a = RetailerDetail()
1495
    a = RetailerDetail()