mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 21:22:16 +08:00
29 lines
534 B
Go
29 lines
534 B
Go
package api
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
|
"github.com/openimsdk/tools/apiresp"
|
|
)
|
|
|
|
type ConfigManager struct {
|
|
config *config.AllConfig
|
|
}
|
|
|
|
func NewConfigManager(cfg *config.AllConfig) *ConfigManager {
|
|
return &ConfigManager{
|
|
config: cfg,
|
|
}
|
|
}
|
|
|
|
func (cm *ConfigManager) GetConfig(c *gin.Context) {
|
|
b, err := json.Marshal(cm.config)
|
|
if err != nil {
|
|
apiresp.GinError(c, err) // args option error
|
|
return
|
|
}
|
|
apiresp.GinSuccess(c, string(b))
|
|
}
|