add admin conf

This commit is contained in:
ljw
2024-11-11 22:26:15 +08:00
parent 15a518c1ac
commit 7bb2ce0a43
5 changed files with 102 additions and 1 deletions

View File

@@ -31,9 +31,14 @@ func Init(g *gin.Engine) {
AddressBookCollectionBind(adg)
AddressBookCollectionRuleBind(adg)
UserTokenBind(adg)
ConfigBind(adg)
//deprecated by ConfigBind
rs := &admin.Rustdesk{}
adg.GET("/server-config", rs.ServerConfig)
adg.GET("/app-config", rs.AppConfig)
//deprecated end
//访问静态文件
//g.StaticFS("/upload", http.Dir(global.Config.Gin.ResourcesPath+"/upload"))
}
@@ -188,6 +193,13 @@ func UserTokenBind(rg *gin.RouterGroup) {
aR.GET("/list", cont.List)
aR.POST("/delete", cont.Delete)
}
func ConfigBind(rg *gin.RouterGroup) {
aR := rg.Group("/config")
rs := &admin.Config{}
aR.GET("/server", rs.ServerConfig)
aR.GET("/app", rs.AppConfig)
aR.GET("/admin", rs.AdminConfig)
}
/*
func FileBind(rg *gin.RouterGroup) {