You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.3 KiB
83 lines
2.3 KiB
package route
|
|
|
|
import (
|
|
"hr_server/apirouter"
|
|
"hr_server/identification"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// 初始化主路由
|
|
func InitialRouter() *gin.Engine {
|
|
var router = gin.Default()
|
|
|
|
// 跨域设置
|
|
// router.Use(middleware.CrossDomainRequest()) // 如需跨域可以打开
|
|
|
|
//app默认相应
|
|
appLoadRouterGroup := router.Group("")
|
|
{
|
|
appLoadRouterGroup.GET("/", func(c *gin.Context) {
|
|
c.JSON(0, "通讯成功!")
|
|
})
|
|
appLoadRouterGroup.POST("/test", func(c *gin.Context) {
|
|
c.JSON(0, "通讯成功!")
|
|
})
|
|
}
|
|
|
|
//定义路由实例
|
|
|
|
//获取验证信息
|
|
empowerApi := apirouter.RouterGroupInlet.EmpowerApiRouter
|
|
|
|
//实验
|
|
shhiyanApi := apirouter.RouterGroupInlet.ShiyanApiRRouter
|
|
//组织架构
|
|
organizationApi := apirouter.RouterGroupInlet.OrganizationApi //组织架构
|
|
//权限相关操作
|
|
permitPowerApi := apirouter.RouterGroupInlet.PermitPowerApi
|
|
//人员档案
|
|
staffApi := apirouter.RouterGroupInlet.PersonnelRoute
|
|
staffApiFuben := apirouter.RouterGroupInlet.PersonnelRouteKingdee
|
|
|
|
//排班相关操作
|
|
rosteringApi := apirouter.RouterGroupInlet.RosteringApiRouter
|
|
|
|
//角色相关
|
|
roleApi := apirouter.RouterGroupInlet.RoleApiRouter
|
|
|
|
//金蝶对接接口
|
|
jinDieDockingApi := apirouter.RouterGroupInlet.KingdeeApiRouter //人员
|
|
organizationApiKingdee := apirouter.RouterGroupInlet.OrganizationApiOpen //组织架构
|
|
//微信相关内容
|
|
wechatApiRouter := apirouter.RouterGroupInlet.WorkWechatRouter
|
|
{
|
|
shhiyanApi.InitRouterGroup(appLoadRouterGroup) //实验
|
|
|
|
empowerApi.InitRouterGroup(appLoadRouterGroup) //获取token
|
|
organizationApi.InitRouterGroup(appLoadRouterGroup) //组织架构
|
|
jinDieDockingApi.InitRouterGroup(appLoadRouterGroup) //金蝶对接接口
|
|
|
|
staffApi.InitRouterGroup(appLoadRouterGroup) //人员档案
|
|
|
|
rosteringApi.InitRouterGroup(appLoadRouterGroup) //排班相关操作
|
|
|
|
roleApi.InitRouterGroup(appLoadRouterGroup) //角色相关
|
|
|
|
wechatApiRouter.RouterGroupPc(appLoadRouterGroup)
|
|
|
|
}
|
|
|
|
//身份验证
|
|
Authentication := router.Group("")
|
|
Authentication.Use(identification.Validator()).Use(identification.Interceptor())
|
|
{
|
|
|
|
permitPowerApi.InitRouterGroup(Authentication) //权限相关操作
|
|
staffApiFuben.InitRouterGroup(Authentication) //人员档案
|
|
organizationApiKingdee.InitRouterGroup(Authentication) //人员档案
|
|
|
|
}
|
|
|
|
return router
|
|
}
|
|
|