This commit is contained in:
syuilo 2022-09-19 03:11:50 +09:00
parent 92c78218bc
commit a2eac9fff6
82 changed files with 671 additions and 671 deletions

View file

@ -9,19 +9,19 @@ import { genObjectId } from '@/misc/id/object-id.js';
@Injectable()
export class IdService {
#metohd: string;
private metohd: string;
constructor(
@Inject(DI.config)
private config: Config,
) {
this.#metohd = config.id.toLowerCase();
this.metohd = config.id.toLowerCase();
}
public genId(date?: Date): string {
if (!date || (date > new Date())) date = new Date();
switch (this.#metohd) {
switch (this.metohd) {
case 'aid': return genAid(date);
case 'meid': return genMeid(date);
case 'meidg': return genMeidg(date);