Loading capif_backend/backoffice_service/controllers/default_controller.py +6 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,12 @@ def get_capif_users(): return jsonify(message="Invalid id", object=None), 400 return operations.get_user() @backoffice_routes.route("/numUsers", methods=["GET"]) def get_capif_num_users(): if id == "null": return jsonify(message="Invalid id", object=None), 400 return operations.get_num_user() @backoffice_routes.route("/invokers/<id>", methods=["DELETE"]) def delete_invoker(id): if id == "null": Loading capif_backend/backoffice_service/core/operations.py +33 −3 Original line number Diff line number Diff line Loading @@ -371,11 +371,11 @@ class Operations: json_user = [ { "fullName": "Fogus", "info": "This is provider" "info": "http://www.fogus.gr" }, { "fullName": "OWOs", "info": "This is provider" "fullName": "OWO", "info": "https://owogame.com" } ] Loading @@ -386,6 +386,36 @@ class Operations: except Exception as e: return "Error when retreiving event: ", e def get_num_user(self, id=None): user_col = self.db.get_col_by_name_register(self.db.user) try: if id == None: user = user_col.find({}, {"_id": 0}) else: user = user_col.find({"$or": [ { "list_invokers": { "$elemMatch": { "$eq": id } } }, { "list_providers": { "$elemMatch": { "$eq": id } } } ]}, {"_id": 0}) json_user = [ { "fullName": "Fogus", "info": "http://www.fogus.gr" }, { "fullName": "OWO", "info": "https://owogame.com" } ] num_users = len(json_user) return jsonify(num_users), 200 except Exception as e: return "Error when retreiving event: ", e def delete_invoker(self, invoker_id): try: Loading Loading
capif_backend/backoffice_service/controllers/default_controller.py +6 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,12 @@ def get_capif_users(): return jsonify(message="Invalid id", object=None), 400 return operations.get_user() @backoffice_routes.route("/numUsers", methods=["GET"]) def get_capif_num_users(): if id == "null": return jsonify(message="Invalid id", object=None), 400 return operations.get_num_user() @backoffice_routes.route("/invokers/<id>", methods=["DELETE"]) def delete_invoker(id): if id == "null": Loading
capif_backend/backoffice_service/core/operations.py +33 −3 Original line number Diff line number Diff line Loading @@ -371,11 +371,11 @@ class Operations: json_user = [ { "fullName": "Fogus", "info": "This is provider" "info": "http://www.fogus.gr" }, { "fullName": "OWOs", "info": "This is provider" "fullName": "OWO", "info": "https://owogame.com" } ] Loading @@ -386,6 +386,36 @@ class Operations: except Exception as e: return "Error when retreiving event: ", e def get_num_user(self, id=None): user_col = self.db.get_col_by_name_register(self.db.user) try: if id == None: user = user_col.find({}, {"_id": 0}) else: user = user_col.find({"$or": [ { "list_invokers": { "$elemMatch": { "$eq": id } } }, { "list_providers": { "$elemMatch": { "$eq": id } } } ]}, {"_id": 0}) json_user = [ { "fullName": "Fogus", "info": "http://www.fogus.gr" }, { "fullName": "OWO", "info": "https://owogame.com" } ] num_users = len(json_user) return jsonify(num_users), 200 except Exception as e: return "Error when retreiving event: ", e def delete_invoker(self, invoker_id): try: Loading