28 lines
752 B
TypeScript
28 lines
752 B
TypeScript
|
import { Injectable } from '@angular/core';
|
||
|
import { HttpClient } from '@angular/common/http';
|
||
|
|
||
|
import { Observable } from 'rxjs';
|
||
|
import { map } from 'rxjs/operators';
|
||
|
import { NGXLogger } from 'ngx-logger';
|
||
|
|
||
|
import { decodeMailCount, MailCountResponse } from '../apis/api';
|
||
|
|
||
|
@Injectable({
|
||
|
providedIn: 'root'
|
||
|
})
|
||
|
export class DaesangApiService {
|
||
|
constructor(private httpClient: HttpClient) {}
|
||
|
|
||
|
public retrieveMailCount(url: string): Observable<MailCountResponse> {
|
||
|
return this.httpClient
|
||
|
.post<any>(url, {}, {})
|
||
|
.pipe(map(res => decodeMailCount(res)));
|
||
|
}
|
||
|
|
||
|
public retrievePaymentCount(url: string): Observable<any> {
|
||
|
return this.httpClient
|
||
|
.post<any>(url, {}, {})
|
||
|
.pipe(map(res => decodeMailCount(res)));
|
||
|
}
|
||
|
}
|