mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-10 10:21:51 +00:00
add func to setting service
This commit is contained in:
parent
846efe8eb4
commit
dfdb77c491
1 changed files with 10 additions and 0 deletions
|
@ -2,6 +2,7 @@ package service
|
|||
|
||||
import (
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
@ -42,6 +43,15 @@ var defaultValueMap = map[string]string{
|
|||
type SettingService struct {
|
||||
}
|
||||
|
||||
func (s *SettingService) GetDefaultJsonConfig() (interface{}, error) {
|
||||
var jsonData interface{}
|
||||
err := json.Unmarshal([]byte(xrayTemplateConfig), &jsonData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return jsonData, nil
|
||||
}
|
||||
|
||||
func (s *SettingService) GetAllSetting() (*entity.AllSetting, error) {
|
||||
db := database.GetDB()
|
||||
settings := make([]*model.Setting, 0)
|
||||
|
|
Loading…
Reference in a new issue