import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import { RESTService } from '@loafer/ng-rest/service'; import { RPCService } from '@loafer/ng-rpc/service'; import { DomainMember } from '@overflow/commons-typescript/model/domain'; import { Member } from '@overflow/commons-typescript/model/member'; @Injectable() export class MemberService { public constructor( private restService: RESTService, private rpcService: RPCService, ) { } public signin(email: string, password: string): Observable { return this.restService.request('post', '/account/signin', { body: { signinID: email, signinPW: password, }, }); } public signin_cookie(authToken: string): Observable { return this.restService.request('post', '/account/signin_cookie', { body: { authToken: authToken, }, }); } public signup(member: Member, password: string): Observable { return this.restService.request('post', '/account/signup', { body: { member: member, password: password, }, }); } public modify(member: Member): Observable { return this.rpcService.call('MemberService.modify', member, ''); } public sendEmailResetPassword(email: string): Observable { return this.rpcService.call('MemberService.sendEmailForPassword', email); } }