LabelingApi.js 5.81 KB
import {axiosInstance} from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject, getCountGte, getCountLte} from "@/PublicUtil/PublicUtil"

class LabelingApi {
    getPeopleImageList(packId, personUnid) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/subTasks`,
                params: {
                    packId: packId,
                    personUnid: personUnid,
                    sortName: 'create_time'
                },
            }
        )
    }

    getSimilarPeopleImageFolderList(picIdArr, folderNum, packId, minutes, currentPersonUnid) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/getSimilarPerson`,
                params: {
                    picIdArr: picIdArr,
                    size: folderNum,
                    packId: packId,
                    timeInterval: minutes,
                    currentPerson: currentPersonUnid,
                },
            }
        )
    }

    completeLabel(personUnid, packId) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/setPure`,
                params: {
                    personUnid: personUnid,
                    packId: packId,
                },
            }
        )
    }

    mergeImagesAsNewPerson(picIdArr, packId) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/mergeAsNewPerson`,
                params: {
                    picIdArr: picIdArr,
                    packId: packId,
                },
            }
        )
    }

    mergeMultiplePersonsAsNewPerson(personUnidArr, packId, currentPersonUnid) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/mergePerson`,
                params: {
                    personUnidArr: personUnidArr,
                    packId: packId,
                    currentPerson: currentPersonUnid,
                },
            }
        )
    }

    mergeMultipleImagesToOnePerson(picIdArr, personUnid, packId, currentPersonUnid) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/mergeTo`,
                params: {
                    picIdArr: picIdArr,
                    personUnid: personUnid,
                    packId: packId,
                    currentPerson: currentPersonUnid,
                },
            }
        )
    }

    deleteImages(picIdArr, packId) {
        return axiosInstance.request(
            {
                method: 'DELETE',
                url: `/reid/deletePic`,
                params: {
                    picIdArr: picIdArr,
                    packId: packId,
                },
            }
        )
    }

    recycle(personUnid, subTaskIdArr, packId) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/recovery`,
                params: filterEmptyValueInObject(
                    {
                        personUnid: personUnid,
                        subTaskIdArr: subTaskIdArr,
                        packId: packId,
                    }
                ),
            }
        )
    }

    highQualityExtract(personUnid, subTaskIdArr, packId, currentPersonUnid) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/mergeAndTodo`,
                params: filterEmptyValueInObject(
                    {
                        personUnidArr: personUnid,
                        subTaskIdArr: subTaskIdArr,
                        packId: packId,
                        currentPerson: currentPersonUnid,
                    }
                ),
            }
        )
    }

    lowQualityExtract(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/mergeAndLowQuality`,
                params: filterEmptyValueInObject(
                    {
                        personUnidArr: data.personUnidArr,
                        subTaskIdArr: data.subTaskIdArr,
                        packId: data.packId,
                        currentPerson: data.currentPerson,
                    }
                ),
            }
        )
    }

    exitLabeling(personUnid, packId) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/exitLabeling`,
                params: {
                    personUnid: personUnid,
                    packId: packId,
                },
            }
        )
    }

    getPreviousPerson(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/getOtherPeople`,
                params: filterEmptyValueInObject(
                    {
                        personUnid: data.personUnid,
                        packId: data.packId,
                        type: 1,
                        status: data.status,
                        countGTE: getCountGte(),
                        countLTE: getCountLte(),
                    }
                ),
            }
        )
    }

    getNextPerson(data) {
        return axiosInstance.request(
            {
                method: 'GET',
                url: `/reid/getOtherPeople`,
                params: filterEmptyValueInObject(
                    {
                        personUnid: data.personUnid,
                        packId: data.packId,
                        type: 0,
                        status: data.status,
                        countGTE: getCountGte(),
                        countLTE: getCountLte(),
                    }
                ),
            }
        )
    }
}

const labelingApi = new LabelingApi()

export default labelingApi