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';
|
2018-11-29 06:49:33 +08:00
|
|
|
import {Express} from 'express';
|
2019-02-16 00:47:09 +08:00
|
|
|
import {VersionMWs} from '../middlewares/VersionMWs';
|
2017-07-09 20:23:50 +08:00
|
|
|
|
|
|
|
export class NotificationRouter {
|
2018-11-29 06:49:33 +08:00
|
|
|
public static route(app: Express) {
|
2017-07-09 20:23:50 +08:00
|
|
|
|
|
|
|
this.addGetNotifications(app);
|
|
|
|
}
|
|
|
|
|
2018-11-29 06:49:33 +08:00
|
|
|
private static addGetNotifications(app: Express) {
|
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),
|
2019-02-16 00:47:09 +08:00
|
|
|
VersionMWs.injectGalleryVersion,
|
2017-07-09 20:23:50 +08:00
|
|
|
NotificationMWs.list,
|
|
|
|
RenderingMWs.renderResult
|
|
|
|
);
|
2018-03-31 03:30:30 +08:00
|
|
|
}
|
2017-07-09 20:23:50 +08:00
|
|
|
|
|
|
|
}
|