From e02d6534d2dba4b8adcbb80e37cc77bf8bddd26c Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期三, 09 三月 2022 16:50:48 +0800
Subject: [PATCH] update#136137: [諮詢度表現] 顧問詳細資訊API 前端調整串接

---
 PAMapp/shared/services/appointment.service.ts |   63 ++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/PAMapp/shared/services/appointment.service.ts b/PAMapp/shared/services/appointment.service.ts
index c8c6f9d..6ba2c18 100644
--- a/PAMapp/shared/services/appointment.service.ts
+++ b/PAMapp/shared/services/appointment.service.ts
@@ -1,14 +1,13 @@
 import { http } from "./httpClient";
 
-import { ClientInfo } from "~/shared/models/client.model";
-import { AppointmentDetail, EditAppointmentParams } from "~/shared/models/appointment.model";
+import { Appointment, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams,  InterviewRecordInfo, ToCloseAppointment, ToDoneAppointment, ToInformAppointment, updatedMemoInfo, UpdateInterviewRecordInfo } from "~/shared/models/appointment.model";
 
 class AppointmentService {
 
-  // ���������
-  async getMyAppointmentList(): Promise<ClientInfo[]> {
+  // 憿批������撌梁���API
+  async getMyAppointmentList(): Promise<Appointment[]> {
     return http.get('/consultant/getMyAppointment').then((res) => {
-      const hasNewAppointment = res.data.find((appointment: ClientInfo) => !appointment.consultantViewTime);
+      const hasNewAppointment = res.data.find((appointment: Appointment) => !appointment.consultantViewTime);
       if (hasNewAppointment) {
         this.viewAllAppointment();
       }
@@ -16,7 +15,7 @@
     });
   }
 
-  // 憿批��憿舐內����蝑敺孛�
+  // 憿批��汗�撌望������蝝���孛�API
   private viewAllAppointment(): void {
     http.post('/consultant/record/allAppointmentsView').then();
   }
@@ -27,7 +26,7 @@
   }
 
   // �����蝝啁�
-  async getAppointmentDetail(appointmentId: number):Promise<AppointmentDetail> {
+  async getAppointmentDetail(appointmentId: number):Promise<Appointment> {
     return http.get(`/appointment/getDetail/${appointmentId}`).then((res) => res.data);
   }
 
@@ -41,6 +40,56 @@
     return http.put('/appointment', editAppointmentParams);
   }
 
+  // �憓酉閮�
+  async createMemo(memoInfo: createdMemoInfo): Promise<AppointmentMemoInfo> {
+    return http.post('/appointment/memo/create', memoInfo).then(res => res.data);
+  }
+
+  // 蝺刻摩閮餉��
+  async updateMemo(memoInfo: updatedMemoInfo): Promise<AppointmentMemoInfo> {
+    return http.post('/appointment/memo/update', memoInfo).then(res => res.data);
+  }
+
+  // ��閮餉��
+  deleteMemo(appointmentMemoId: number) {
+    return http.delete(`/appointment/memo/${appointmentMemoId}`)
+  }
+
+  // ���蝯��, ��蝯��敦
+  async closeAppointment(appointmentInfo: ToDoneAppointment | ToCloseAppointment) {
+    return http.post(`/appointment/close`, appointmentInfo).then((res) => res.data);
+  }
+
+  // 蝝赤� API
+  async informAppointment(appointmentInformation: ToInformAppointment) {
+    return http.post(`/notice/send`, appointmentInformation).then((res) => res.data);
+  }
+
+  // �憓�赤閮��
+  async createInterviewRecord(interviewRecordInfo: InterviewRecordInfo) {
+    return http.post('/interview_record/create', interviewRecordInfo).then(res => res.data);
+  }
+
+  // 靽格蝝赤閮��
+  async updateInterviewRecord(updateInterviewRecordInfo: UpdateInterviewRecordInfo) {
+    return http.post('/interview_record/update', updateInterviewRecordInfo)
+  }
+
+  // ��蝝赤閮��
+  async deleteInterviewRecord(interviewRecordId) {
+    return http.delete(`/interview_record/${interviewRecordId}`);
+  }
+
+  // 摰X��������������
+  async getNotContactAppointment(): Promise<Appointment> {
+    return http.get(`/appointment/customer/expiring/newest`).then((res) => res.data);
+  }
+
+  // 憿批������������
+  async getPendingAppointmentSum(): Promise<number> {
+    return http.get(`/appointment/consultant/pending/sum`).then((res) => res.data)
+  }
+
 }
 
 export default new AppointmentService();

--
Gitblit v1.8.0