Subversion Repositories SmartDukaan

Rev

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

Rev 14619 Rev 14853
Line 150... Line 150...
150
        categoryId = req.get_param_as_int("categoryId")
150
        categoryId = req.get_param_as_int("categoryId")
151
        offset = req.get_param_as_int("offset")
151
        offset = req.get_param_as_int("offset")
152
        limit = req.get_param_as_int("limit")
152
        limit = req.get_param_as_int("limit")
153
        sort = req.get_param("sort")
153
        sort = req.get_param("sort")
154
        direction = req.get_param_as_int("direction")
154
        direction = req.get_param_as_int("direction")
-
 
155
        filterData = req.get_param('filterData')
155
        result = Mongo.getNewDeals(int(userId), categoryId, offset, limit, sort, direction)
156
        result = Mongo.getNewDeals(int(userId), categoryId, offset, limit, sort, direction, filterData)
156
        json_docs = [json.dumps(doc, default=json_util.default) for doc in result]
157
        json_docs = [json.dumps(doc, default=json_util.default) for doc in result]
157
        resp.body = json.dumps(json_docs, encoding='utf-8')
158
        resp.body = json.dumps(json_docs, encoding='utf-8')
158
 
159
 
159
class MasterData():
160
class MasterData():
160
    def on_get(self,req, resp, skuId):
161
    def on_get(self,req, resp, skuId):
Line 432... Line 433...
432
class CricScore():
433
class CricScore():
433
    
434
    
434
    def on_get(self,req,resp):
435
    def on_get(self,req,resp):
435
 
436
 
436
        result = Mongo.getLiveCricScore()
437
        result = Mongo.getLiveCricScore()
437
        resp.body = dumps(result)
-
 
438
438
        resp.body = dumps(result)
-
 
439
 
-
 
440
class Notification():
-
 
441
    
-
 
442
    def on_post(self, req, resp):
-
 
443
        
-
 
444
        try:
-
 
445
            result_json = json.loads(req.stream.read(), encoding='utf-8')
-
 
446
        except ValueError:
-
 
447
            raise falcon.HTTPError(falcon.HTTP_400,
-
 
448
                'Malformed JSON',
-
 
449
                'Could not decode the request body. The '
-
 
450
                'JSON was incorrect.')
-
 
451
            
-
 
452
        result = Mongo.addBundleToNotification(result_json)
-
 
453
        resp.body = json.dumps(result, encoding='utf-8')
-
 
454
    
-
 
455
    def on_get(self, req, resp):
-
 
456
 
-
 
457
        offset = req.get_param_as_int("offset")
-
 
458
        limit = req.get_param_as_int("limit")
-
 
459
        
-
 
460
        result = Mongo.getAllNotifications(offset, limit)
-
 
461
        resp.body = dumps(result)
-
 
462
 
-
 
463
    
-
 
464