load from database

This commit is contained in:
Alireza Ahmadi
2024-12-25 10:57:17 +01:00
parent 7a047daf6f
commit ed48cdca33
13 changed files with 290 additions and 130 deletions
-1
View File
@@ -35,7 +35,6 @@ func (o *Endpoint) UnmarshalJSON(data []byte) error {
func (o Endpoint) MarshalJSON() ([]byte, error) {
// Combine fixed fields and dynamic fields into one map
combined := make(map[string]interface{})
combined["id"] = o.Id
combined["type"] = o.Type
combined["tag"] = o.Tag
+3 -2
View File
@@ -1,6 +1,8 @@
package model
import "encoding/json"
import (
"encoding/json"
)
type Inbound struct {
Id uint `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
@@ -58,7 +60,6 @@ func (i *Inbound) UnmarshalJSON(data []byte) error {
func (i Inbound) MarshalJSON() ([]byte, error) {
// Combine fixed fields and dynamic fields into one map
combined := make(map[string]interface{})
combined["id"] = i.Id
combined["type"] = i.Type
combined["tag"] = i.Tag
if i.Tls != nil {
-1
View File
@@ -35,7 +35,6 @@ func (o *Outbound) UnmarshalJSON(data []byte) error {
func (o Outbound) MarshalJSON() ([]byte, error) {
// Combine fixed fields and dynamic fields into one map
combined := make(map[string]interface{})
combined["id"] = o.Id
combined["type"] = o.Type
combined["tag"] = o.Tag