import upload from '@/utils/upload'
import request from '@/utils/request'

// 查询伴宠师列表
export function getTeacherList(params) {
    return request({
        url: '/applet/mall/teacher/getTeacherList',
        headers: {
            "isToken": true
        },
        method: 'get',
        params
    })
}


// 查询伴宠师详情
export function getTeacherDetail(params) {
    return request({
        url: '/applet/mall/teacher/getTeacherDetail',
        headers: {
            "isToken": true
        },
        method: 'get',
        params
    })
}

// 查询指定伴宠师的宠物列表
export function getTeacherPetList(params) {
    return request({
        headers: {
            "isToken": true
        },
        url: "/applet/pet/list",
        method: 'get',
        params
    })
}

// 查询指定伴宠师的地址列表
export const getTeacherAddressList = (params) => {
    return request({
        url: '/applet/address/addressList',
        headers: {
            isToken: true
        },
        method: "get",
        params
    })
}

// 查询指定伴宠师的服务小结
export const getTeacherServiceLogList = (params) => {
    return request({
        url: '/applet/serviceLog/serviceLogList',
        headers: {
            isToken: true
        },
        method: "get",
        params
    }).then(res => {
        return res.data?.map?.(item => {
            return {
                ...item,
                typeIds: item.serviceType?.split?.(','),
                images: item.image?.split?.(',') || []
            }
        }) || []
    })
}
