This commit is contained in:
2025-03-06 19:20:32 +08:00
parent b5fc5d279e
commit 1ae123e63a
6 changed files with 56 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
import { User } from '@/models/user.ts';
import { UserServices } from '@/models/user.ts';
import { app } from '@/app.ts';
@@ -12,7 +12,7 @@ app
if (!password) {
ctx.throw(500, 'root password are required');
}
const res = await User.initializeUser(password);
const res = await UserServices.initializeUser(password);
ctx.body = res;
})
.addTo(app);
@@ -28,7 +28,7 @@ app
if (!username && username.startsWith('demo')) {
ctx.throw(500, 'username are required, and must start with demo');
}
const res = await User.createDemoUser(username, password);
const res = await UserServices.createDemoUser(username, password);
ctx.body = res;
})
.addTo(app);