import { Request, Response, NextFunction } from 'express';
import publicService from '../../../application/services/PublicService';

export class PublicController {
  static announcements = async (req: Request, res: Response, next: NextFunction) => {
    try {
      const data = await publicService.getAnnouncements();
      return res.status(200).json({ success: true, data });
    } catch (error) {
      next(error);
    }
  };

  static settings = async (req: Request, res: Response, next: NextFunction) => {
    try {
      const data = await publicService.getSettings();
      return res.status(200).json({ success: true, data });
    } catch (error) {
      next(error);
    }
  };
}

export default PublicController;
