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