member_webapp/@overflow/notification/service/notification.service.ts
crusader cd1e53f67a ing
2018-06-04 17:25:29 +09:00

35 lines
1.1 KiB
TypeScript

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
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 readAllByMember(member: Member, pageParams: PageParams): Observable<Page<Notification>> {
return this.rpcService.call('NotificationService.readAllByMember', member, pageParams);
}
public markAllAsRead(member: Member, pageParams: PageParams): Observable<Page<Notification>> {
return this.rpcService.call('NotificationService.markAllAsRead', member, pageParams);
}
public markAsRead(notification: Notification): Observable<Notification> {
return this.rpcService.call('NotificationService.markAsRead', notification);
}
}