mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core&ui&elastic: support elastic search and allow search result pagination
This commit is contained in:
1 parent
ea6529b523
commit
18fc66ecb7
33 files changed
+411
-244
No files matched your search
@@ -103,6 +103,13 @@ export interface GDoc {
|
||||
uids: number[];
|
||||
}
|
||||
|
||||
export interface UserPreferenceDoc {
|
||||
_id: ObjectID;
|
||||
filename: string;
|
||||
uid: number;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export type ownerInfo = { owner: number, maintainer?: number[] };
|
||||
|
||||
export type User = import('./model/user').User;
|
||||
@@ -579,6 +586,7 @@ export interface Collections {
|
||||
'document.status': any;
|
||||
'problem': ProblemDoc;
|
||||
'user': Udoc;
|
||||
'user.preference': UserPreferenceDoc;
|
||||
'vuser': VUdoc;
|
||||
'user.group': GDoc;
|
||||
'check': any;
|
||||
@@ -631,11 +639,23 @@ export interface Service {
|
||||
storage: typeof import('./service/storage'),
|
||||
}
|
||||
|
||||
interface GeoIP {
|
||||
export interface GeoIP {
|
||||
provider: string,
|
||||
lookup: (ip: string, locale?: string) => any,
|
||||
}
|
||||
|
||||
export interface ProblemSearchResponse {
|
||||
hits: string[];
|
||||
total: number;
|
||||
countRelation: 'eq' | 'gte';
|
||||
}
|
||||
export interface ProblemSearchOptions {
|
||||
limit?: number;
|
||||
skip?: number;
|
||||
}
|
||||
|
||||
export type ProblemSearch = (domainId: string, q: string, options?: ProblemSearchOptions) => Promise<ProblemSearchResponse>;
|
||||
|
||||
export interface Lib extends Record<string, any> {
|
||||
download: typeof import('./lib/download'),
|
||||
difficulty: typeof import('./lib/difficulty'),
|
||||
@@ -655,6 +675,7 @@ export interface Lib extends Record<string, any> {
|
||||
validator: typeof import('./lib/validator'),
|
||||
template?: any,
|
||||
geoip?: GeoIP,
|
||||
problemSearch: ProblemSearch;
|
||||
}
|
||||
|
||||
export interface UI {
|
||||
|
||||
Reference in new issue
Block a user