[feature] bottom for reset xray config to default

This commit is contained in:
Alireza Ahmadi
2023-05-01 12:13:06 +02:00
parent 427d008bd1
commit a371bec2aa
6 changed files with 36 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package service
import (
_ "embed"
"encoding/json"
"errors"
"fmt"
"reflect"
@@ -326,3 +327,12 @@ func (s *SettingService) UpdateAllSetting(allSetting *entity.AllSetting) error {
}
return common.Combine(errs...)
}
func (s *SettingService) GetDefaultXrayConfig() (interface{}, error) {
var jsonData interface{}
err := json.Unmarshal([]byte(xrayTemplateConfig), &jsonData)
if err != nil {
return nil, err
}
return jsonData, nil
}