member_webapp/@overflow/notification/service/notification.service.ts
crusader e367ce3ee3 ing
2018-06-06 00:51:49 +09:00

33 lines
1.1 KiB
TypeScript

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { RPCService } from '@loafer/ng-rpc';
import { Notification } from '@overflow/commons-typescript/model/notification';
import { Member } from '@overflow/commons-typescript/model/member';
import { PageParams } from '@overflow/commons-typescript/model/commons/PageParams';
import { Page } from '@overflow/commons-typescript/model/commons/Page';
@Injectable()
export class NotificationService {
public constructor(
private rpcService: RPCService,
) {
}
public readAllByMemberEmail(memberEmail: string, pageParams: PageParams): Observable<Page<Notification>> {
return this.rpcService.call('NotificationService.readAllByMemberEmail', memberEmail, pageParams);
}
public markAllAsReadByMemberEmail(memberEmail: string, pageParams: PageParams): Observable<Page<Notification>> {
return this.rpcService.call('NotificationService.markAllAsReadByMemberEmail', memberEmail, pageParams);
}
public markAsRead(notificationID: number): Observable<Notification> {
return this.rpcService.call('NotificationService.markAsRead', notificationID);
}
}