34 lines
964 B
TypeScript
34 lines
964 B
TypeScript
|
import { Injectable } from '@angular/core';
|
||
|
import { Observable } from 'rxjs/Observable';
|
||
|
|
||
|
import 'rxjs/add/operator/map';
|
||
|
|
||
|
import { RPCService } from '@loafer/ng-rpc/service';
|
||
|
|
||
|
import { Notification } from '../model';
|
||
|
import { Member } from '../../member/model';
|
||
|
import { PageParams, Page } from 'app/commons/model';
|
||
|
|
||
|
@Injectable()
|
||
|
export class NotificationService {
|
||
|
|
||
|
public constructor(
|
||
|
private rpcService: RPCService,
|
||
|
) {
|
||
|
|
||
|
}
|
||
|
|
||
|
public readAllByMember(member: Member, pageParams: PageParams): Observable<Page> {
|
||
|
return this.rpcService.call('NotificationService.readAllByMember', member, pageParams);
|
||
|
}
|
||
|
|
||
|
public markAllAsRead(member: Member, pageParams: PageParams): Observable<Page> {
|
||
|
return this.rpcService.call('NotificationService.markAllAsRead', member, pageParams);
|
||
|
}
|
||
|
|
||
|
public markAsRead(notification: Notification): Observable<Notification> {
|
||
|
return this.rpcService.call('NotificationService.markAsRead', notification);
|
||
|
}
|
||
|
|
||
|
}
|