import axios from '@/utils/http';
const base = process.env.VUE_APP_SERVER + '/template';
const template = {
    list(params: any) {
        return axios.post(`${base}/list`, {
            // template_type: 0,
            // page: 1,
            // page_size: 20,
            ...params,
        });
    },
    systemList(params: any) {
        return axios.post(`${base}/systemList`, {

        });
    },
    get(id: number, params: any) {
        return axios.get(`${base}/get?id=${id}`, {
            ...params,
        });
    },
    folderList(params: any) {
        return axios.post(`${base}/folderList`, {
            template_type: 0,
            page: 1,
            page_size: 20,
            ...params,
        });
    },
    addFolder(name: string, params: any) {
        return axios.post(`${base}/addFolder`, {
            name,
            info: '-',
            ...params,
        });
    },
    customize(name: string, detail: any, folderId: number, params: any) {
        return axios.post(`${base}/customize`, {
            name,
            detail: JSON.stringify(detail),
            info: '自定义模板',
            s_image_url: '',
            folder_id: folderId,
            ...params,
        });
    },
    searchCustomize(key: string, params: any) {
        return axios.post(`${base}/searchCustomize`, {
            key,
            ...params,
        });
    },
};
export default template;
