2022-09-22 16:16:04 +08:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
2022-10-17 16:32:31 +08:00
|
|
|
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/middleware"
|
2022-09-22 16:16:04 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type AppRouter struct {
|
|
|
|
}
|
|
|
|
|
2023-12-20 22:44:09 +08:00
|
|
|
func (a *AppRouter) InitRouter(Router *gin.RouterGroup) {
|
2022-09-22 16:16:04 +08:00
|
|
|
appRouter := Router.Group("apps")
|
2023-03-11 17:51:42 +08:00
|
|
|
appRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).Use(middleware.PasswordExpired())
|
2022-09-22 16:16:04 +08:00
|
|
|
|
|
|
|
baseApi := v1.ApiGroupApp.BaseApi
|
|
|
|
{
|
2022-10-11 16:27:58 +08:00
|
|
|
appRouter.POST("/sync", baseApi.SyncApp)
|
2023-03-14 15:03:46 +08:00
|
|
|
appRouter.GET("/checkupdate", baseApi.GetAppListUpdate)
|
2022-10-11 16:27:58 +08:00
|
|
|
appRouter.POST("/search", baseApi.SearchApp)
|
2023-02-08 17:09:21 +08:00
|
|
|
appRouter.GET("/:key", baseApi.GetApp)
|
2023-03-30 16:47:47 +08:00
|
|
|
appRouter.GET("/detail/:appId/:version/:type", baseApi.GetAppDetail)
|
2023-04-03 17:47:23 +08:00
|
|
|
appRouter.GET("/details/:id", baseApi.GetAppDetailByID)
|
2022-09-26 16:32:40 +08:00
|
|
|
appRouter.POST("/install", baseApi.InstallApp)
|
2023-01-16 15:30:24 +08:00
|
|
|
appRouter.GET("/tags", baseApi.GetAppTags)
|
2023-08-29 10:50:15 +08:00
|
|
|
appRouter.POST("/installed/check", baseApi.CheckAppInstalled)
|
|
|
|
appRouter.POST("/installed/loadport", baseApi.LoadPort)
|
|
|
|
appRouter.POST("/installed/conninfo", baseApi.LoadConnInfo)
|
2022-12-01 19:25:02 +08:00
|
|
|
appRouter.GET("/installed/delete/check/:appInstallId", baseApi.DeleteCheck)
|
2023-02-21 15:19:12 +08:00
|
|
|
appRouter.POST("/installed/search", baseApi.SearchAppInstalled)
|
2023-08-23 22:44:14 +08:00
|
|
|
appRouter.GET("/installed/list", baseApi.ListAppInstalled)
|
2022-10-11 16:27:58 +08:00
|
|
|
appRouter.POST("/installed/op", baseApi.OperateInstalled)
|
|
|
|
appRouter.POST("/installed/sync", baseApi.SyncInstalled)
|
2022-11-08 14:34:41 +08:00
|
|
|
appRouter.POST("/installed/port/change", baseApi.ChangeAppPort)
|
2022-10-07 15:49:39 +08:00
|
|
|
appRouter.GET("/services/:key", baseApi.GetServices)
|
2023-09-06 21:22:12 +08:00
|
|
|
appRouter.POST("/installed/conf", baseApi.GetDefaultConfig)
|
2023-01-03 14:57:13 +08:00
|
|
|
appRouter.GET("/installed/params/:appInstallId", baseApi.GetParams)
|
2023-03-08 11:04:22 +08:00
|
|
|
appRouter.POST("/installed/params/update", baseApi.UpdateInstalled)
|
2023-07-03 16:36:18 +08:00
|
|
|
appRouter.POST("/installed/ignore", baseApi.IgnoreUpgrade)
|
2023-07-06 18:48:22 +08:00
|
|
|
appRouter.GET("/ignored/detail", baseApi.GetIgnoredApp)
|
2024-06-04 16:50:31 +08:00
|
|
|
appRouter.POST("/installed/update/versions", baseApi.GetUpdateVersions)
|
2022-09-22 16:16:04 +08:00
|
|
|
}
|
|
|
|
}
|