This commit is contained in:
2024-11-30 13:24:46 +07:00
commit 3e32e5869e
30 changed files with 1196 additions and 0 deletions

12
src/routes/private.ts Normal file
View File

@ -0,0 +1,12 @@
import express from 'express';
import { Language } from '../langs/lang';
import JwtHelper from '../helpers/jwt';
export class RoutePrivate {
static setup(app: express.Application) {
// app.use(Language.apply)
JwtHelper.secure(app);
}
}

17
src/routes/public.ts Normal file
View File

@ -0,0 +1,17 @@
import express from 'express';
import { UserController } from '../controllers/user';
import { Language } from '../langs/lang';
export class RoutePublic {
static setup(app: express.Application) {
app.use(Language.apply)
app.get('/api/user/list', UserController.list)
app.get('/api/user/export', UserController.export)
app.post('/api/user/create', UserController.create)
app.put('/api/user/update/:id', UserController.update)
app.delete('/api/user/delete/:id', UserController.delete)
app.put('/api/user/restore/:id', UserController.restore)
}
}