feat: validator decorator

This commit is contained in:
undefined committed 2020-07-08 20:37:06 +08:00
1 parent ba03d7a7bf
commit 4e85b696c0
23 files changed
+313 -180

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ export function getMany(query: any, sort: any, page: number, limit: number) {
.toArray();
}
export function getMulti(query: any) {
export function getMulti(query: any = {}) {
return coll.find(query);
}
+6
View File
@@ -44,6 +44,10 @@ export class User {
role: string;
regip: () => string;
loginip: () => string;
constructor(udoc, dudoc) {
this.udoc = () => udoc;
this.dudoc = () => dudoc;
@@ -55,7 +59,9 @@ export class User {
this.hashType = udoc.hashType || 'hydro';
this.priv = udoc.priv;
this.regat = udoc.regat;
this.regip = () => udoc.regip;
this.loginat = udoc.loginat;
this.loginip = () => udoc.loginip;
this.perm = dudoc.perm;
this.role = dudoc.role || 'default';