rustdesk.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package admin
  2. import (
  3. "Gwen/global"
  4. "Gwen/http/response"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type Rustdesk struct {
  8. }
  9. // ServerConfig RUSTDESK服务配置
  10. // @Tags ADMIN
  11. // @Summary RUSTDESK服务配置
  12. // @Description 服务配置,给webclient提供api-server
  13. // @Accept json
  14. // @Produce json
  15. // @Success 200 {object} response.Response
  16. // @Failure 500 {object} response.Response
  17. // @Router /admin/server-config [get]
  18. // @Security token
  19. func (r *Rustdesk) ServerConfig(c *gin.Context) {
  20. cf := &response.ServerConfigResponse{
  21. IdServer: global.Config.Rustdesk.IdServer,
  22. Key: global.Config.Rustdesk.Key,
  23. RelayServer: global.Config.Rustdesk.RelayServer,
  24. ApiServer: global.Config.Rustdesk.ApiServer,
  25. }
  26. response.Success(c, cf)
  27. }
  28. // AppConfig APP服务配置
  29. // @Tags ADMIN
  30. // @Summary APP服务配置
  31. // @Description APP服务配置
  32. // @Accept json
  33. // @Produce json
  34. // @Success 200 {object} response.Response
  35. // @Failure 500 {object} response.Response
  36. // @Router /admin/app-config [get]
  37. // @Security token
  38. func (r *Rustdesk) AppConfig(c *gin.Context) {
  39. response.Success(c, &gin.H{
  40. "web_client": global.Config.App.WebClient,
  41. })
  42. }