-
Notifications
You must be signed in to change notification settings - Fork 0
/
router-sprint.ts
94 lines (72 loc) · 2.28 KB
/
router-sprint.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
///<reference path='./typings/main.d.ts' />
import {logger} from "./util";
import {sprintReport} from "./reports";
import {Router} from "express"
export const router = Router();
router.use('/search', async (req, res, next) => {
try {
throw new Error("Not implemented");
}
catch(e) {
next(e);
}
});
/**
* Resumen general
*/
router.use('/:projectKey/:sprintId/resumen', async (req, res, next) => {
try {
var reportResult:any = await sprintReport.resumenGeneral(req.params.projectKey, req.params.sprintId);
res.render("sprint/resumen", Object.assign(reportResult, { projectKey: req.params.projectKey
, sprintId: req.params.sprintId}));
}
catch(e) {
next(e);
}
});
/**
* Por situación
*/
router.use('/:projectKey/:sprintId/situacion', async (req, res, next) => {
try {
var reportResult:any = await sprintReport.situacion(req.params.sprintId);
res.render("sprint/resumen-detalle", Object.assign(reportResult, { projectKey: req.params.projectKey
, sprintId: req.params.sprintId, menuOption:"situacion"}));
}
catch(e) {
next(e);
}
});
/**
* Por tipo
*/
router.use('/:projectKey/:sprintId/tipo', async (req, res, next) => {
try {
var reportResult:any = await sprintReport.tipo(req.params.sprintId);
res.render("sprint/resumen-detalle", Object.assign(reportResult, { projectKey: req.params.projectKey
, sprintId: req.params.sprintId, menuOption:"tipo"}));
}
catch(e) {
next(e);
}
});
router.use('/rest/result/:projectKey/:sprintId/resumen', async (req, res, next) => {
try {
var reportResult:any = await sprintReport.resumenGeneral(req.params.projectKey, req.params.sprintId);
res.send(Object.assign(reportResult, { projectKey: req.params.projectKey
, sprintId: req.params.sprintId}));
}
catch(e) {
next(e);
}
});
router.use('/rest/result/:projectKey/:sprintId/situacion', async (req, res, next) => {
try {
var reportResult:any = await sprintReport.situacion(req.params.sprintId);
res.send(Object.assign(reportResult, { projectKey: req.params.projectKey
, sprintId: req.params.sprintId}));
}
catch(e) {
next(e);
}
});