22 lines
502 B
Python
22 lines
502 B
Python
|
from flask_restful import Resource, abort
|
||
|
|
||
|
from app.glob import get_manager
|
||
|
|
||
|
|
||
|
class EnterpriseModule(Resource):
|
||
|
def get(self):
|
||
|
manager = get_manager()
|
||
|
if not manager.has_module():
|
||
|
abort(404, message='not found')
|
||
|
return {
|
||
|
'message': 'found'
|
||
|
}
|
||
|
|
||
|
def put(self):
|
||
|
manager = get_manager()
|
||
|
if manager.has_module():
|
||
|
return '', 304
|
||
|
manager.add_module()
|
||
|
return {
|
||
|
'message': 'success'
|
||
|
}
|