from flask import Blueprint
from flask_restx import Api, Namespace, Resource
from datetime import datetime

api_blueprint = Blueprint('api_pages', __name__)
api = Api(api_blueprint)

dome_ns = Namespace('dome', description='Dome operations')
telescope_ns = Namespace('telescope', description='Telescope operations')

@dome_ns.route('/a')
class DomeAResource(Resource):
    def get(self):
        return {'message': datetime.utcnow().isoformat()}

@dome_ns.route('/b')
class DomeBResource(Resource):
    def get(self):
        return {'message': 'Dome B'}

@telescope_ns.route('/c')
class TelescopeCResource(Resource):
    def get(self):
        return {'message': 'Telescope C'}

api.add_namespace(dome_ns)
api.add_namespace(telescope_ns)
