"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.notificationsService = exports.NotificationsService = void 0;
const models_1 = require("../../models");
/**
 * 通知服务
 */
class NotificationsService {
    /**
     * 获取用户通知列表
     */
    async getNotifications(userId) {
        return await models_1.prisma.notification.findMany({
            where: { userId },
            orderBy: { createdAt: 'desc' },
            take: 50,
        });
    }
    /**
     * 标记通知为已读
     */
    async markAsRead(id) {
        return await models_1.prisma.notification.update({
            where: { id },
            data: { isRead: true },
        });
    }
}
exports.NotificationsService = NotificationsService;
exports.notificationsService = new NotificationsService();
