import request from '/@/utils/request';

export function getApi() {
    return {
        listApi: (params?: object) => {
            return request({
                url: 'forms/setups/v1',
                method: 'get',
                params,
            });
        },
        uploadApi: () => {
            return import.meta.env.VITE_API_URL + 'forms/setups/v1/upload'
        },
        saveApi: (data?: object) => {
            return request({
                url: '/forms/setups/v1',
                method: 'post',
                data,
            });
        },
        stateApi: (data?: object) => {
            return request({
                url: '/forms/setups/v1/editState',
                method: 'PUT',
                data,
            });
        },
        download: (urls: string) => {
            return request({
                url: urls,
                method: 'get',
                responseType: 'blob',
            });
        },
        downloadUrl: (id: string) => {
            return import.meta.env.VITE_API_URL + id
        },
        pdflook: (url: string) => {
            return import.meta.env.VITE_API_URL + url
        },
    };

}
