import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { RESTService } from '@loafer/ng-rest'; import { RPCService } from '@loafer/ng-rpc'; 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, pw: string): Observable { return this.restService.request('post', '/account/signin', { body: { signinID: email, signinPW: pw, }, }); } public signup(member: Member, pw: string): Observable { return this.restService.request('post', '/account/signup', { body: { member: member, pw: pw, }, }); } public modify(member: Member): Observable { return this.rpcService.call('MemberService.modify', member, ''); } public sendEmailResetPassword(email: string): Observable { return this.restService.request('post', '/account/send_email_pw', { body: { signinID: email, }, }); } public resetPassword(token: string, pw: string, confirmPw: string): Observable { return this.restService.request('post', '/account/reset_password', { body: { token: token, pw: pw, confirmPw: confirmPw, }, }); } }