@@ -4,49 +4,17 @@ import (
4
4
"github.com/kataras/iris/v12"
5
5
"github.com/scutrobotlab/rm-schedule/internal/common"
6
6
"github.com/scutrobotlab/rm-schedule/internal/handler"
7
- "github.com/scutrobotlab/rm-schedule/internal/static"
8
7
)
9
8
10
- var Params = map [string ]handler.RouteHandlerParam {
11
- common .UpstreamNameGroupRankInfo : {
12
- Name : common .UpstreamNameGroupRankInfo ,
13
- Static : false ,
14
- CacheControl : "public, max-age=5" ,
15
- OriginalUrl : common .UpstreamUrlGroupRankInfo ,
16
- Data : static .GroupRankInfoBytes ,
17
- SeasonMap : map [string ][]byte {
18
- "2024" : static .GroupRankInfoBytes2024 ,
19
- },
20
- },
21
- common .UpstreamNameRobotData : {
22
- Name : common .UpstreamNameRobotData ,
23
- Static : false ,
24
- CacheControl : "public, max-age=5" ,
25
- OriginalUrl : common .UpstreamUrlRobotData ,
26
- Data : static .RobotDataBytes ,
27
- SeasonMap : nil ,
28
- },
29
- common .UpstreamNameSchedule : {
30
- Name : common .UpstreamNameSchedule ,
31
- Static : false ,
32
- CacheControl : "public, max-age=5" ,
33
- OriginalUrl : common .UpstreamUrlSchedule ,
34
- Data : static .ScheduleBytes ,
35
- SeasonMap : map [string ][]byte {
36
- "2024" : static .ScheduleBytes2024 ,
37
- },
38
- },
39
- }
40
-
41
9
// Router defines the router for this service
42
10
func Router (r * iris.Application , frontend string ) {
43
11
api := r .Party ("/api" )
44
12
api .Get ("/static/*path" , handler .RMStaticHandler )
45
13
api .Get ("/mp/match" , handler .MpMatchHandler )
46
14
api .Get ("/rank" , handler .RankListHandler )
47
- api .Get ("/group_rank_info" , handler .RouteHandlerFactory ( Params [common .UpstreamNameGroupRankInfo ]))
48
- api .Get ("/robot_data" , handler .RouteHandlerFactory ( Params [common .UpstreamNameRobotData ]))
49
- api .Get ("/schedule" , handler .RouteHandlerFactory ( Params [common .UpstreamNameSchedule ]))
15
+ api .Get ("/group_rank_info" , handler .RedirectRouteHandlerFactory ( RedirectParams [common .UpstreamNameGroupRankInfo ]))
16
+ api .Get ("/robot_data" , handler .RedirectRouteHandlerFactory ( RedirectParams [common .UpstreamNameRobotData ]))
17
+ api .Get ("/schedule" , handler .RedirectRouteHandlerFactory ( RedirectParams [common .UpstreamNameSchedule ]))
50
18
51
19
r .HandleDir ("/" , iris .Dir (frontend ), iris.DirOptions {
52
20
IndexName : "index.html" ,
0 commit comments