2018-04-06 11:02:18 +00:00
|
|
|
import { Injectable } from '@angular/core';
|
2018-06-04 08:25:29 +00:00
|
|
|
import { Observable } from 'rxjs';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
2018-05-24 06:44:13 +00:00
|
|
|
import { RPCService } from '@loafer/ng-rpc';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
2018-05-02 08:09:39 +00:00
|
|
|
import { Notification } from '@overflow/commons-typescript/model/notification';
|
|
|
|
import { Member } from '@overflow/commons-typescript/model/member';
|
2018-05-25 03:31:08 +00:00
|
|
|
import { PageParams } from '@overflow/commons-typescript/model/commons/PageParams';
|
|
|
|
import { Page } from '@overflow/commons-typescript/model/commons/Page';
|
2018-04-06 11:02:18 +00:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class NotificationService {
|
|
|
|
|
|
|
|
public constructor(
|
|
|
|
private rpcService: RPCService,
|
|
|
|
) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-06-05 15:51:49 +00:00
|
|
|
public readAllByMemberEmail(memberEmail: string, pageParams: PageParams): Observable<Page<Notification>> {
|
|
|
|
return this.rpcService.call('NotificationService.readAllByMemberEmail', memberEmail, pageParams);
|
2018-05-25 03:31:08 +00:00
|
|
|
}
|
2018-04-06 11:02:18 +00:00
|
|
|
|
2018-06-05 15:51:49 +00:00
|
|
|
public markAllAsReadByMemberEmail(memberEmail: string, pageParams: PageParams): Observable<Page<Notification>> {
|
|
|
|
return this.rpcService.call('NotificationService.markAllAsReadByMemberEmail', memberEmail, pageParams);
|
2018-05-25 03:31:08 +00:00
|
|
|
}
|
2018-04-06 11:02:18 +00:00
|
|
|
|
2018-06-05 15:51:49 +00:00
|
|
|
public markAsRead(notificationID: number): Observable<Notification> {
|
|
|
|
return this.rpcService.call('NotificationService.markAsRead', notificationID);
|
2018-04-06 11:02:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|