2018-03-31 03:30:30 +08:00
|
|
|
import {UserRoles} from '../../common/entities/UserDTO';
|
|
|
|
import {AuthenticationMWs} from '../middlewares/user/AuthenticationMWs';
|
|
|
|
import {RenderingMWs} from '../middlewares/RenderingMWs';
|
|
|
|
import {NotificationMWs} from '../middlewares/NotificationMWs';
|
2017-07-09 20:23:50 +08:00
|
|
|
|
|
|
|
export class NotificationRouter {
|
|
|
|
public static route(app: any) {
|
|
|
|
|
|
|
|
this.addGetNotifications(app);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static addGetNotifications(app) {
|
2018-03-31 03:30:30 +08:00
|
|
|
app.get('/api/notifications',
|
2017-07-09 20:23:50 +08:00
|
|
|
AuthenticationMWs.authenticate,
|
|
|
|
AuthenticationMWs.authorise(UserRoles.Guest),
|
|
|
|
NotificationMWs.list,
|
|
|
|
RenderingMWs.renderResult
|
|
|
|
);
|
2018-03-31 03:30:30 +08:00
|
|
|
}
|
2017-07-09 20:23:50 +08:00
|
|
|
|
|
|
|
}
|