From f36e617e9e534a4b05f2029724d678bbd6c655b3 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期三, 22 十二月 2021 11:38:54 +0800 Subject: [PATCH] refactor: separate api/consultant.ts into serveral services --- PAMapp/shared/services/query-consultant.service.ts | 33 ++++++++++++++++++++++++++++----- 1 files changed, 28 insertions(+), 5 deletions(-) diff --git a/PAMapp/shared/services/query-consultant.service.ts b/PAMapp/shared/services/query-consultant.service.ts index 1236fdc..a11cd13 100644 --- a/PAMapp/shared/services/query-consultant.service.ts +++ b/PAMapp/shared/services/query-consultant.service.ts @@ -1,13 +1,36 @@ import { http } from "./httpClient"; -import { Consultant } from "../models/consultant.model"; +import { Consultant } from "~/shared/models/consultant.model"; +import { FastQueryParams } from "~/shared/models/quick-filter.model"; +import { AgentOfStrictQuery, StrictQueryParams } from "~/shared/models/strict-query.model"; +import { AppointmentParams } from "~/shared/models/appointment.model"; class QueryConsultantService { - // ��靽憿批�� - async getRecommendConsultantList(): Promise<Consultant[]> { - return http.get<Consultant[]>('/consultant/recommend').then((res) => res.data); - } + // ��靽憿批�� + async getRecommendConsultantList(): Promise<Consultant[]> { + return http.get<Consultant[]>('/consultant/recommend').then((res) => res.data); + } + + // 敹恍�祟� + async fastQuery(data: FastQueryParams): Promise<Consultant[]> { + return http.post<Consultant[]>('/consultant/fastQuery', data).then(res => res.data); + } + + // ������ + async strictQuery(data:StrictQueryParams): Promise<AgentOfStrictQuery[]>{ + return http.post('/consultant/strictQuery', data).then((res) => res.data); + } + + // ��憿批�� + async addFavoriteConsultant(agentNoList: string[]) { + return http.post('/consultant/favorite', { agentNoList }); + } + + // ����岷��� + async appointmentDemand(data: AppointmentParams) { + return http.post('/appointment/customer/create', data); + } } -- Gitblit v1.8.0