1
|
|
|
import express from "express"; |
2
|
|
|
// import some model from some file |
3
|
|
|
|
4
|
|
|
const router = express.Router(); |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* @description Route for getting all users |
8
|
|
|
* |
9
|
|
|
* @param {express.Request} req Request object |
10
|
|
|
* @param {express.Response} res Response object |
11
|
|
|
* @param {express.NextFunction} next Next function |
12
|
|
|
* |
13
|
|
|
* @returns {void} |
14
|
|
|
*/ |
15
|
|
|
router.get("/", (req, res, next) => { |
|
|
|
|
16
|
|
|
// code here for getting all users |
17
|
|
|
}); |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @description Route for getting all users using pagination |
21
|
|
|
* |
22
|
|
|
* @param {express.Request} req Request object |
23
|
|
|
* @param {express.Response} res Response object |
24
|
|
|
* @param {express.NextFunction} next Next function |
25
|
|
|
* |
26
|
|
|
* @returns {void} |
27
|
|
|
*/ |
28
|
|
|
router.get("/limit/:limit/offset/:offset", (req, res, next) => { |
|
|
|
|
29
|
|
|
// code here for getting all users using pagination |
30
|
|
|
}); |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @description Route for searching for a user |
34
|
|
|
* |
35
|
|
|
* @param {express.Request} req Request object |
36
|
|
|
* @param {express.Response} res Response object |
37
|
|
|
* @param {express.NextFunction} next Next function |
38
|
|
|
* |
39
|
|
|
* @returns {void} |
40
|
|
|
*/ |
41
|
|
|
router.get("/search/:search", (req, res, next) => { |
|
|
|
|
42
|
|
|
// code here for searching for a user |
43
|
|
|
}); |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @description Route for getting one user |
47
|
|
|
* |
48
|
|
|
* @param {express.Request} req Request object |
49
|
|
|
* @param {express.Response} res Response object |
50
|
|
|
* @param {express.NextFunction} next Next function |
51
|
|
|
* |
52
|
|
|
* @returns {void} |
53
|
|
|
*/ |
54
|
|
|
router.get("/:id", (req, res, next) => { |
|
|
|
|
55
|
|
|
// code here for getting one user |
56
|
|
|
}); |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @description Route for billing users with negative balance |
60
|
|
|
* |
61
|
|
|
* @param {express.Request} req Request object |
62
|
|
|
* @param {express.Response} res Response object |
63
|
|
|
* @param {express.NextFunction} next Next function |
64
|
|
|
* |
65
|
|
|
* @returns {void} |
66
|
|
|
*/ |
67
|
|
|
router.post("/invoice", (req, res, next) => { |
|
|
|
|
68
|
|
|
// code here for billing users with negative balance |
69
|
|
|
}); |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @description Route for updating a user |
73
|
|
|
* |
74
|
|
|
* @param {express.Request} req Request object |
75
|
|
|
* @param {express.Response} res Response object |
76
|
|
|
* @param {express.NextFunction} next Next function |
77
|
|
|
* |
78
|
|
|
* @returns {void} |
79
|
|
|
*/ |
80
|
|
|
router.put("/", (req, res, next) => { |
|
|
|
|
81
|
|
|
// code here for updating a user |
82
|
|
|
}); |
83
|
|
|
|
84
|
|
|
export default router; |
85
|
|
|
|
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.