提交 a3db8394 authored 作者: vipcxj's avatar vipcxj

add: 新增模版相关管理接口

上级 5c34c6f7
......@@ -6,6 +6,7 @@
<w>arcfour</w>
<w>authed</w>
<w>dropdown</w>
<w>infoes</w>
<w>infos</w>
<w>inited</w>
<w>lodash</w>
......
import _, { partial } from 'lodash';
import request from '../utils/request';
import post from '../utils/post';
import doDelete from '../utils/delete';
// noinspection JSUnusedGlobalSymbols
export const templateApi = (dmPath) => {
return {
admin: {
getInfo: partial(getAdminTemplateInfo, _, dmPath),
getAllInfoes: partial(getAllAdminTemplateInfoes, dmPath),
getConfigure: partial(getAdminTemplateConfigure, _, dmPath),
getPlainConfigure: partial(getAdminTemplatePlainConfigure, _, dmPath),
setConfigure: partial(setAdminTemplateConfigure, _, _, dmPath),
removeConfigure: partial(removeAdminTemplateConfigure, _, dmPath),
getTemplate: partial(getAdminTemplateTemplate, _, dmPath),
setTemplate: partial(setAdminTemplateTemplate, _, _, dmPath),
},
};
};
export async function getAllAdminTemplateInfoes(dmPath) {
return request('/api/template/admin/info', { dmPath });
}
export async function getAdminTemplateInfo(name, dmPath) {
return request(`/api/template/admin/${encodeURIComponent(name)}/info`, { dmPath });
}
export async function getAdminTemplateConfigure(name, dmPath) {
return request(`/api/template/admin/${encodeURIComponent(name)}/configure`, { dmPath });
}
export async function getAdminTemplatePlainConfigure(name, dmPath) {
return request(`/api/template/admin/${encodeURIComponent(name)}/plainConfigure`, { dmPath });
}
export async function setAdminTemplateConfigure(name, configure, dmPath) {
return post(`/api/template/admin/${encodeURIComponent(name)}/configure`, { configure, dmPath });
}
export async function removeAdminTemplateConfigure(name, dmPath) {
return doDelete(`/api/template/admin/${encodeURIComponent(name)}/configure`, { dmPath });
}
export async function setAdminTemplateTemplate(name, uri, dmPath) {
return post(`/api/template/admin/${encodeURIComponent(name)}/template`, { uri, dmPath });
}
export async function getAdminTemplateTemplate(name, dmPath) {
return request(`/api/template/admin/${encodeURIComponent(name)}/template`, { dmPath });
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论