forked from p15670423/monkey
island: Extract methods (all static) in class RansomwareReportService and remove the class
This commit is contained in:
parent
27058cc827
commit
38bead54ae
|
@ -2,12 +2,10 @@ import flask_restful
|
||||||
from flask import jsonify
|
from flask import jsonify
|
||||||
|
|
||||||
from monkey_island.cc.resources.auth.auth import jwt_required
|
from monkey_island.cc.resources.auth.auth import jwt_required
|
||||||
from monkey_island.cc.services.ransomware_report import RansomwareReportService
|
from monkey_island.cc.services.ransomware_report import get_exploitation_details
|
||||||
|
|
||||||
|
|
||||||
class RansomwareReport(flask_restful.Resource):
|
class RansomwareReport(flask_restful.Resource):
|
||||||
@jwt_required
|
@jwt_required
|
||||||
def get(self):
|
def get(self):
|
||||||
return jsonify(
|
return jsonify({"report": None, "stats": get_exploitation_details()})
|
||||||
{"report": None, "stats": RansomwareReportService.get_exploitation_details()}
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
from monkey_island.cc.services.reporting.report import ReportService
|
from monkey_island.cc.services.reporting.report import ReportService
|
||||||
|
|
||||||
|
|
||||||
class RansomwareReportService:
|
def get_exploitation_details():
|
||||||
@staticmethod
|
|
||||||
def get_exploitation_details():
|
|
||||||
scanned = ReportService.get_scanned()
|
scanned = ReportService.get_scanned()
|
||||||
exploited = ReportService.get_exploited()
|
exploited = ReportService.get_exploited()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue