package routers import ( "eta/eta_bridge/controller/xiangyu" "eta/eta_bridge/middleware" "github.com/gin-gonic/gin" ) // InitXiangyu 获取象屿 func InitXiangyu(r *gin.RouterGroup) { control := new(xiangyu.XiangyuController) group := r.Group("xy/") group.GET("user/sync", control.SyncUser) group.GET("user/pull", control.PullUser) // 需要内部鉴权的接口 initAuthXiangyu(r) // 指标接口 initIndexXiangyu(r) // crm数据接口 initCrmXiangyu(r) } func initAuthXiangyu(r *gin.RouterGroup) { control := new(xiangyu.XiangyuController) group := r.Group("xy/").Use(middleware.InternalToken()) group.POST("auth/getToken", control.GetToken) group.GET("auth/refreshToken", control.RefreshToken) group.POST("auth/revokeToken", control.RevokeToken) } func initIndexXiangyu(r *gin.RouterGroup) { control := new(xiangyu.XiangyuController) group := r.Group("xy/").Use(middleware.InternalToken()) group.POST("index/pushIndexData", control.PushIndexDataResp) group.POST("index/pushIndexValue", control.PushIndexValueDataResp) group.POST("index/pushClassify", control.PushClassifyDataResp) group.POST("index/pushEdbClassify", control.PushEdbClassifyDataResp) } // initCrmXiangyu // @Description: Crm数据接口 // @author: Roc // @datetime 2024-05-14 17:21:22 // @param r *gin.RouterGroup func initCrmXiangyu(r *gin.RouterGroup) { control := new(xiangyu.XiangyuController) group := r.Group("xy/index/").Use(middleware.InternalToken()) group.GET("crm/getCrmData", control.GetCrmData) }