Kaynağa Gözat

feat(webforwarding): 添加 CC防护配置

- 在 WebForwarding 模型中添加 CC 防护相关字段
- 在创建 WebForwarding 时处理 CC 防护配置
fusu 1 ay önce
ebeveyn
işleme
afacdaf4a0

+ 6 - 0
internal/model/webforwarding.go

@@ -18,6 +18,12 @@ type WebForwarding struct {
 	HttpsKey             string `gorm:"null"`
 	SslCertId 		int `gorm:"null"`
 	Proxy 				bool `gorm:"null"`
+	Cc                   bool
+	ThresholdMethod      string
+	Level                string
+	Limit5s              int
+	Limit60s             int
+	Limit300s            int
 	CreatedAt            time.Time
 	UpdatedAt            time.Time
 }

+ 6 - 0
internal/service/webforwarding.go

@@ -160,6 +160,12 @@ func (s *webForwardingService) buildWebForwardingModel(req *v1.WebForwardingData
 		HttpsCert: req.HttpsCert,
 		HttpsKey:  req.HttpsKey,
 		SslCertId: int(require.SslPolicyId),
+			Cc:        req.CcConfig.IsOn,
+		ThresholdMethod: req.CcConfig.ThresholdMethod,
+		Level:           req.CcConfig.Level,
+		Limit5s:         req.CcConfig.Limit5s,
+		Limit60s:        req.CcConfig.Limit60s,
+		Limit300s:       req.CcConfig.Limit300s,
 		Proxy:     req.Proxy,
 	}
 }