From 497f54b264eba626b77e79fec2ca6947ccae19e4 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期二, 14 十二月 2021 15:45:23 +0800 Subject: [PATCH] refactor: myAppointmentList --- PAMapp/assets/ts/api/appointment.ts | 43 ++++++------------------------------------- 1 files changed, 6 insertions(+), 37 deletions(-) diff --git a/PAMapp/assets/ts/api/appointment.ts b/PAMapp/assets/ts/api/appointment.ts index cfb1c6b..84bcded 100644 --- a/PAMapp/assets/ts/api/appointment.ts +++ b/PAMapp/assets/ts/api/appointment.ts @@ -1,14 +1,6 @@ -import { service } from '~/assets/ts/api/share'; -import { AxiosResponse } from 'axios'; -import { AppointmentLog } from '../models/appointment.model'; +import { http } from '~/assets/ts/services/httpClient'; -// ��������� -export function getMyAppointmentList():Promise<ClientInfo[]> { - const headers = { - Authorization: 'Bearer ' + localStorage.getItem('id_token') - } - return service.get('/consultant/getMyAppointment', {headers}).then(res => res.data); -} +import { AppointmentLog } from '../models/appointment.model'; // 璅�撌脰蝯� export function markAsContact(appointmentId: number) { @@ -16,7 +8,7 @@ Authorization: 'Bearer ' + localStorage.getItem('id_token') } // TODO: 頝�垢蝣箄���ㄐ��� API 銝�府���� void, ���府���敺���� - Ben 2021/11/16 - return service.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers}) + return http.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers}) .then(res => res.data) } @@ -24,7 +16,7 @@ const headers = { Authorization: 'Bearer ' + localStorage.getItem('id_token') } - return service.get('/satisfaction/getMySatisfaction', { headers }).then(res => res.data); + return http.get('/satisfaction/getMySatisfaction', { headers }).then(res => res.data); } @@ -33,7 +25,7 @@ const headers = { Authorization: 'Bearer ' + localStorage.getItem('id_token') } - return service.post('/consultant/record/allAppointmentsView', undefined, {headers}) + return http.post('/consultant/record/allAppointmentsView', undefined, {headers}) } // 霈�������孛� @@ -41,28 +33,5 @@ const headers = { Authorization: 'Bearer ' + localStorage.getItem('id_token') } - return service.post('/appointment/recordRead/' + appointmentId, undefined, {headers}) + return http.post('/appointment/recordRead/' + appointmentId, undefined, {headers}) } - - -export interface ClientInfo { - id : number, - phone : string, - email : string, - contactType : string, - gender : string, - age : string, - job : string, - requirement : string, - communicateStatus: string, - hopeContactTime : string, - otherRequirement : string, - appointmentDate : Date, - agentNo : string, - customerId : number, - name : string, - consultantViewTime: Date, - consultantReadTime: Date, - contactTime : Date, - satisfactionScore: number -} \ No newline at end of file -- Gitblit v1.8.0