From 46da7429ca192bf6a947d79437e8076b94676a05 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期四, 13 一月 2022 16:29:45 +0800 Subject: [PATCH] update: 刪除重複的 interface: clientInfo => appointment --- PAMapp/shared/services/my-consultant.service.ts | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-) diff --git a/PAMapp/shared/services/my-consultant.service.ts b/PAMapp/shared/services/my-consultant.service.ts index 1b97fed..3d4dd78 100644 --- a/PAMapp/shared/services/my-consultant.service.ts +++ b/PAMapp/shared/services/my-consultant.service.ts @@ -1,8 +1,9 @@ -import { http } from "./httpClient"; +import _ from "lodash"; +import { http } from "./httpClient"; import { AgentInfo } from '~/shared/models/agent-info.model'; import { Consultant } from "../models/consultant.model"; - +import { Appointment } from "../models/appointment.model"; class MyConsultantService { async getFavoriteConsultantList(): Promise<Consultant[]> { @@ -24,6 +25,28 @@ return http.get('/consultant/detail', {params:{agentNo:agentNo}}).then((res) => res.data); } + // 蝘駁憿批�� + async deleteConsultant(agentId: string) { + return http.delete(`/consultant/favorite/${agentId}`); + } + + // 璅�撌脰蝯� + markAsContact(appointmentId: number): Promise<Appointment> { + return http.post(`/appointment/markAsContacted/${appointmentId}`).then(res => res.data); + } + + // ���“����� + getConsultantAvatar(agentNo:string):Promise<string>{ + return http.get(`/consultant/avatar/${agentNo}`,{ responseType : 'arraybuffer' }) + .then( response => { + const toBase64 = window.btoa( + _.reduce( new Uint8Array(response.data),(data,byte) => + data + String.fromCharCode(byte),'') + ); + const imgSrc = `data:image/png;base64,${toBase64}`; + return imgSrc; + }); + } } export default new MyConsultantService(); -- Gitblit v1.8.0