2022-09-22 16:16:04 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
v1 "github.com/1Panel-dev/1Panel/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/middleware"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type AppRouter struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *AppRouter) InitAppRouter(Router *gin.RouterGroup) {
|
|
|
|
appRouter := Router.Group("apps")
|
|
|
|
appRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth())
|
|
|
|
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
|
|
|
appRouter.POST("/sync", baseApi.AppSync)
|
|
|
|
appRouter.POST("/search", baseApi.AppSearch)
|
2022-09-23 16:33:55 +08:00
|
|
|
appRouter.GET("/:id", baseApi.GetApp)
|
|
|
|
appRouter.GET("/detail/:appid/:version", baseApi.GetAppDetail)
|
2022-09-26 16:32:40 +08:00
|
|
|
appRouter.POST("/install", baseApi.InstallApp)
|
|
|
|
appRouter.POST("/installed", baseApi.PageInstalled)
|
2022-09-26 18:20:21 +08:00
|
|
|
appRouter.POST("/installed/op", baseApi.InstallOperate)
|
2022-09-29 18:16:56 +08:00
|
|
|
appRouter.POST("/installed/sync", baseApi.InstalledSync)
|
2022-10-07 15:49:39 +08:00
|
|
|
appRouter.GET("/services/:key", baseApi.GetServices)
|
2022-09-22 16:16:04 +08:00
|
|
|
}
|
|
|
|
}
|