const currentPage = dv.current().file;
const dailyPages = dv.pages('"0-Daily"').sort(k=>k.file.name, "asc");
const currentPageName = currentPage.name;
const index = dailyPages.findIndex((e) => {return e.file.name === currentPageName});
if (index < 1) {
dv.table(["File", "Created", "Size"],[]);
} else {
const lastIndex = index - 1;
const lastPage = dailyPages[lastIndex].file;
const allPages = dv.pages().values;
const searchPages = [];
const lastTime = dv.parse(lastPage.name);
const currentTime = dv.parse(currentPage.name);
for (let page of allPages) {
const pageFile = page.file;
if (pageFile.cday > lastTime && pageFile.cday <= currentTime) {
searchPages.push(pageFile);
}
}
dv.table(["File", "Created", "Size"], searchPages.sort((a, b) => a.ctime > b.ctime ? 1 : -1).map(b => [b.link, b.ctime, b.size]));
}
Spring 中的 ModelAttribute 和前端请求
spring
RequestBody 和 RequestParam
const buildQueryString = (params, parentKey) => {
if (params === null) {return "";};
const queryString = Object.keys(params).map(key => {
const fullKey = parentKey ? `${parentKey}[${key}]` : key;
if (Array.isArray(params[key])) {
return params[key].map(item => `${encodeURIComponent(fullKey)}=${encodeURIComponent(item)}`).join('&');
} else if (typeof params[key] === 'object') {
return buildQueryString(params[key], fullKey);
} else {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(params[key])}`;
}
}).join('&');
return queryString;
};
class Bean {
private String resourceType;
private String[] groupPath;
private Map<String, String[]> tags;
}