router.go
10.8 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package routers
import (
"oppmg/controllers"
"oppmg/middleware"
"github.com/astaxie/beego"
)
func init() {
nsV1 := beego.NewNamespace("/v1",
beego.NSBefore(middleware.AllowOption),
beego.NSBefore(middleware.LogRequestData),
beego.NSBefore(middleware.AuthToken),
beego.NSNamespace("/department",
beego.NSRouter("/list", &controllers.CompanyController{}, "post:DepartmentList"),
// beego.NSRouter("/add", &controllers.CompanyController{}, "post:DepartmentAdd"),
// beego.NSRouter("/edit", &controllers.CompanyController{}, "post:DepartmentUpdate"),
// beego.NSRouter("/delete", &controllers.CompanyController{}, "post:DepartmentDelete"),
beego.NSRouter("/user", &controllers.CompanyController{}, "post:DepartmentUser"),
beego.NSRouter("/info", &controllers.CompanyController{}, "post:DepartmentInfo"),
),
beego.NSNamespace("/company",
// beego.NSRouter("/current/edit", &controllers.CompanyController{}, "post:CurrentCompanyEdit"),
beego.NSRouter("/current/info", &controllers.CompanyController{}, "post:CurrentCompanyInfo"),
),
beego.NSNamespace("position",
beego.NSRouter("/list", &controllers.CompanyController{}, "post:PositionList"),
// beego.NSRouter("/add", &controllers.CompanyController{}, "post:PositionAdd"),
// beego.NSRouter("/edit", &controllers.CompanyController{}, "post:PositionEdit"),
// beego.NSRouter("/delete", &controllers.CompanyController{}, "post:PositionDelete"),
),
beego.NSNamespace("/rbac",
beego.NSRouter("/role/add", &controllers.RbacController{}, "post:RoleAdd"),
beego.NSRouter("/role/edit", &controllers.RbacController{}, "post:RoleUpdate"),
beego.NSRouter("/role/delete", &controllers.RbacController{}, "post:RoleDelete"),
beego.NSRouter("/role_group/add", &controllers.RbacController{}, "post:RoleGroupAdd"),
beego.NSRouter("/role_group/edit", &controllers.RbacController{}, "post:RoleGroupUpdate"),
beego.NSRouter("/role_group/delete", &controllers.RbacController{}, "post:RoleGroupDelete"),
beego.NSRouter("/role/list", &controllers.RbacController{}, "post:RoleList"),
beego.NSRouter("/menu/list", &controllers.RbacController{}, "post:MenuList"),
beego.NSRouter("/role/menu", &controllers.RbacController{}, "post:RoleHasMenu"),
beego.NSRouter("/role/menu/edit", &controllers.RbacController{}, "post:RoleMenuEdit"),
beego.NSRouter("/role/menu/opportunity", &controllers.RbacController{}, "post:RoleMenuOpportunity"),
beego.NSRouter("/role/menu/opportunity/edit", &controllers.RbacController{}, "post:RoleMenuOpportunityEdit"),
),
beego.NSNamespace("/user",
beego.NSRouter("/list", &controllers.CompanyController{}, "post:UserList"),
// beego.NSRouter("/add", &controllers.CompanyController{}, "post:UserAdd"),
beego.NSRouter("/edit", &controllers.CompanyController{}, "post:UserEdit"),
// beego.NSRouter("/delete", &controllers.CompanyController{}, "post:UserDelete"),
// beego.NSRouter("/allow_forbid", &controllers.CompanyController{}, "post:UserAllowForbid"),
beego.NSRouter("/info", &controllers.CompanyController{}, "post:UserDetail"),
),
beego.NSNamespace("/auth",
beego.NSRouter("/change_company", &controllers.AuthController{}, "post:ChangeCompany"),
beego.NSRouter("/me", &controllers.AuthController{}, "post:Me"),
beego.NSRouter("/smscode/check", &controllers.AuthController{}, "post:SmsCodeCheck"),
),
beego.NSNamespace("/bulletin",
beego.NSRouter("/add", &controllers.BulletinController{}, "post:BulletinRelease"),
beego.NSRouter("/list", &controllers.BulletinController{}, "post:BulletinList"),
beego.NSRouter("/get", &controllers.BulletinController{}, "post:GetBulletin"),
beego.NSRouter("/update", &controllers.BulletinController{}, "post:UpdateBulletin"),
beego.NSRouter("/operate", &controllers.BulletinController{}, "post:OperateBulletin"),
beego.NSRouter("/feedbacks", &controllers.BulletinController{}, "post:BulletinFeedbacks"),
beego.NSRouter("/exportFeedBacks", &controllers.BulletinController{}, "post:ExportFeedBacks"),
),
beego.NSNamespace("/common",
beego.NSRouter("/department", &controllers.CommonController{}, "post:SelectorDepartment"),
beego.NSRouter("/role", &controllers.CommonController{}, "post:SelectorRole"),
beego.NSRouter("/position", &controllers.CommonController{}, "post:SelectorPosition"),
beego.NSRouter("/user_and_department", &controllers.CommonController{}, "post:SelectorUserAndDepart"),
beego.NSRouter("/default_image", &controllers.CommonController{}, "post:DefaultImage"),
beego.NSRouter("/role/user", &controllers.CommonController{}, "post:SelectorRoleUser"),
beego.NSRouter("/chance_type", &controllers.CommonController{}, "post:SelectorChanceType"),
beego.NSRouter("/user", &controllers.CommonController{}, "post:SelectCompanyUserList"),
beego.NSRouter("/chance", &controllers.CommonController{}, "post:SelectChanceList"),
beego.NSRouter("/department/list", &controllers.CompanyController{}, "post:DepartmentList"),
),
beego.NSNamespace("/template",
beego.NSRouter("/add", &controllers.TemplateController{}, "post:TemplateAdd"),
beego.NSRouter("/list", &controllers.TemplateController{}, "post:TemplateList"),
beego.NSRouter("/get", &controllers.TemplateController{}, "post:TemplateGet"),
beego.NSRouter("/update", &controllers.TemplateController{}, "post:TemplateUpdate"),
beego.NSRouter("/delete", &controllers.TemplateController{}, "post:TemplateDelete"),
beego.NSRouter("/editVisible", &controllers.TemplateController{}, "post:TemplateEditVisible"),
beego.NSRouter("/editEnable", &controllers.TemplateController{}, "post:TemplateEditEnable"),
beego.NSRouter("/editSort", &controllers.TemplateController{}, "post:TemplateEditSort"),
beego.NSRouter("/operateCategory", &controllers.TemplateController{}, "post:TemplateOperateCategory"),
beego.NSRouter("/deleteCategory", &controllers.TemplateController{}, "post:TemplateDeleteCategory"),
beego.NSRouter("/sortCategory", &controllers.TemplateController{}, "post:CategoryEditSort"),
),
beego.NSNamespace("/upload",
beego.NSRouter("/image", &controllers.UploadController{}, "post:UploadImage"),
beego.NSRouter("/video", &controllers.UploadController{}, "post:UploadVideo"),
),
beego.NSNamespace("/config",
beego.NSRouter("/score", &controllers.ConfigController{}, "post:ConfigScore"),
beego.NSRouter("/score/get", &controllers.ConfigController{}, "post:GetConfigScore"),
),
beego.NSNamespace("/audit",
beego.NSRouter("/list", &controllers.AuditController{}, "post:AuditList"),
beego.NSRouter("/list/before", &controllers.AuditController{}, "post:AuditListBefore"),
beego.NSRouter("/info", &controllers.AuditController{}, "post:AuditInfo"),
beego.NSRouter("/allow_forbid", &controllers.AuditController{}, "post:AllowForbidAudit"),
beego.NSRouter("/revise/info", &controllers.AuditController{}, "post:GetChanceReviseLog"),
beego.NSRouter("/check_result/list", &controllers.AuditController{}, "post:GetChanceCheckResultList"),
),
beego.NSNamespace("/rank",
beego.NSRouter("/type/list", &controllers.RankController{}, "post:GetRankType"),
beego.NSRouter("/type/edit", &controllers.RankController{}, "post:EditRankType"),
beego.NSRouter("/type/forbid_allow", &controllers.RankController{}, "post:RankTypeForbidAllow"),
beego.NSRouter("/type/config_set", &controllers.RankController{}, "post:RankTypeConfigSet"),
beego.NSRouter("/type/config_show", &controllers.RankController{}, "post:RankTypeConfigShow"),
beego.NSRouter("/season/add", &controllers.RankController{}, "post:RankSeasonAdd"),
beego.NSRouter("/season/list", &controllers.RankController{}, "post:RankSeasonList"),
beego.NSRouter("/season/edit", &controllers.RankController{}, "post:RankSeasonEdit"),
beego.NSRouter("/range/list", &controllers.RankController{}, "post:RankRangeList"),
beego.NSRouter("/range/edit", &controllers.RankController{}, "post:RankRangeEdit"),
beego.NSRouter("/range/add", &controllers.RankController{}, "post:RankRangeAdd"),
beego.NSRouter("/range/forbid_allow", &controllers.RankController{}, "post:RankRangeForbidAllow"),
beego.NSRouter("/range/info", &controllers.RankController{}, "post:RankRangeInfo"),
beego.NSRouter("/range/sort", &controllers.RankController{}, "post:RankRangeSort"),
beego.NSRouter("/range/move", &controllers.RankController{}, "post:RankRangeMove"),
beego.NSRouter("/item/list", &controllers.RankController{}, "post:RankItemList"),
beego.NSRouter("/item/edit", &controllers.RankController{}, "post:RankItemEdit"),
),
beego.NSNamespace("/achievement",
beego.NSRouter("/list", &controllers.AchievementController{}, "post:AchievementList"),
beego.NSRouter("/add", &controllers.AchievementController{}, "post:AddAchievement"),
beego.NSRouter("/edit", &controllers.AchievementController{}, "post:EditAchievement"),
beego.NSRouter("/info", &controllers.AchievementController{}, "post:AchievementInfo"),
beego.NSRouter("/delete", &controllers.AchievementController{}, "post:DeleteAchievement"),
beego.NSRouter("/forbid_allow", &controllers.AchievementController{}, "post:ForbidAllowAchievement"),
beego.NSRouter("/remain/score", &controllers.AchievementController{}, "post:AchievementScoreRemain"),
),
)
nsAuth := beego.NewNamespace("/auth",
beego.NSBefore(middleware.AllowOption),
beego.NSBefore(middleware.LogRequestData),
beego.NSRouter("/login_account", &controllers.AuthController{}, "post:Login"),
beego.NSRouter("/login", &controllers.AuthController{}, "post:LoginSecretKey"),
beego.NSRouter("/startCaptcha", &controllers.AuthController{}, "post:RegisterGeetest"),
beego.NSRouter("/verifyCaptcha", &controllers.AuthController{}, "post:ValidateGeetest"),
//beego.NSRouter("/login_sms", &controllers.AuthController{}, "post:LoginSms"),
//beego.NSRouter("/sms_code", &controllers.AuthController{}, "post:SmsCode"),
//beego.NSRouter("/sms_code/check", &controllers.AuthController{}, "post:SmsCodeCheck"),
//beego.NSRouter("/my/reset_password", &controllers.MyController{}, "post:ResetPassword"),
)
nsUcenter := beego.NewNamespace("/ucenter",
beego.NSBefore(middleware.LogRequestData),
//beego.NSRouter("/company", &controllers.CompanyController{}, "post:InitCompany"),(废弃)
beego.NSRouter("/company/info", &controllers.CompanyController{}, "post:GetCompanyForUCenter"),
//beego.NSRouter("/company/edit", &controllers.CompanyController{}, "post:EditCompanyForUCenter"),(废弃)
beego.NSRouter("/user/revoke", &controllers.CompanyController{}, "post:UserRevoke"),
beego.NSRouter("/user/changePhone", &controllers.CompanyController{}, "post:UserChangePhone"),
beego.NSRouter("/company/allow_forbid", &controllers.CompanyController{}, "post:AllowForidCompanyForUCenter"),
)
beego.AddNamespace(nsV1)
beego.AddNamespace(nsAuth)
beego.AddNamespace(nsUcenter)
beego.SetStaticPath("/log", beego.AppConfig.String("log_filename"))
beego.SetStaticPath("/file/opp", beego.AppConfig.String("file_save_path"))
beego.SetStaticPath("/static", "./static")
}