feat:added auto job
This commit is contained in:
1 parent
328f7d4f4f
commit
54f48377f0
20 files changed
+671
-123
No files matched your search
+12
-10
@@ -1,20 +1,22 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/apis/sysjob"
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/apis/sysjob"
|
||||
)
|
||||
|
||||
// 无需认证的路由代码
|
||||
func registerSysJobRouter(v1 *gin.RouterGroup) {
|
||||
|
||||
v1.GET("/sysjobList",sysjob.GetSysJobList)
|
||||
r := v1.Group("/sysjob")
|
||||
{
|
||||
r.GET("", sysjob.GetSysJobList)
|
||||
r.GET("/:jobId", sysjob.GetSysJob)
|
||||
r.POST("", sysjob.InsertSysJob)
|
||||
r.PUT("", sysjob.UpdateSysJob)
|
||||
r.DELETE("/:jobId", sysjob.DeleteSysJob)
|
||||
}
|
||||
|
||||
r := v1.Group("/sysjob")
|
||||
{
|
||||
r.GET("/:jobId", sysjob.GetSysJob)
|
||||
r.POST("", sysjob.InsertSysJob)
|
||||
r.PUT("", sysjob.UpdateSysJob)
|
||||
r.DELETE("/:jobId", sysjob.DeleteSysJob)
|
||||
}
|
||||
v1.GET("/job/remove/:jobId",sysjob.RemoveJob)
|
||||
v1.GET("/job/start/:jobId",sysjob.StartJob)
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"go-admin/handler"
|
||||
"go-admin/middleware"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
"go-admin/pkg/ws"
|
||||
)
|
||||
|
||||
func InitSysRouter(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware) *gin.RouterGroup {
|
||||
@@ -33,7 +34,16 @@ func InitSysRouter(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware) *gin.Rou
|
||||
}
|
||||
|
||||
func sysBaseRouter(r *gin.RouterGroup) {
|
||||
|
||||
go ws.WebsocketManager.Start()
|
||||
go ws.WebsocketManager.SendService()
|
||||
go ws.WebsocketManager.SendAllService()
|
||||
|
||||
r.GET("/", system.HelloWorld)
|
||||
|
||||
r.GET("/ws", ws.WebsocketManager.WsClient)
|
||||
|
||||
|
||||
r.GET("/info", handler.Ping)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user