This commit is contained in:
2025-12-25 11:10:33 +08:00
parent 0d42e912f5
commit a06e12df5a
10 changed files with 622 additions and 20 deletions

View File

@@ -0,0 +1,32 @@
function getSearchId() {
const e = BigInt(Date.now()) << 64n;
const t = Math.floor(Math.random() * 2147483647);
return base36encode(e + BigInt(t));
}
function base36encode(num) {
return num.toString(36).toUpperCase();
}
const SearchSortType = Object.freeze({
// default
GENERAL: { value: 'general' },
// most popular
MOST_POPULAR: { value: 'popularity_descending' },
// Latest
LATEST: { value: 'time_descending' },
});
const SearchNoteType = Object.freeze({
// default
ALL: { value: 0 },
// only video
VIDEO: { value: 1 },
// only image
IMAGE: { value: 2 },
});
export {
getSearchId,
SearchSortType,
SearchNoteType,
};