后台:服务器列表编辑

This commit is contained in:
luying
2021-06-16 20:22:07 +08:00
parent c0b3750f3b
commit ca6fa2523c
10 changed files with 254 additions and 24 deletions

View File

@@ -22,6 +22,12 @@ export default class Counter extends BaseModel {
return counter?.seq;
}
public static async getCounter(param:{name: string, def: number}, lean = true) {
let {name, def:defaultVal} = param;
let counter: CounterType = await CounterModel.findOne({ name }).lean(lean);
return counter?.seq||defaultVal;
}
}
export const CounterModel = getModelForClass(Counter);