Commit f8f6b0d9 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

commit

parent c5861eb6
...@@ -4,8 +4,8 @@ import "context" ...@@ -4,8 +4,8 @@ import "context"
type Service interface { type Service interface {
// QueryIP(ip string) (*model.IPInfo, error) // QueryIP(ip string) (*model.IPInfo, error)
GetWaf(ctx context.Context, gatewayName string) (*Waf, error) GetWaf(ctx context.Context, gatewayName string) (*WafService, error)
CreateWaf(ctx context.Context, req *CreateWafReq) (*Waf, error) CreateWaf(ctx context.Context, req *CreateWafReq) (*WafService, error)
UpdateMode(ctx context.Context, req *UpdateModeReq) (*Waf, error) UpdateMode(ctx context.Context, req *UpdateModeReq) (*WafService, error)
SaveRuleCategoryToDB(ctx context.Context) error SaveRuleCategoryToDB(ctx context.Context) error
} }
...@@ -48,7 +48,7 @@ func (s *wafService) GetWaf(ctx context.Context, gatewayName string) (*WafServic ...@@ -48,7 +48,7 @@ func (s *wafService) GetWaf(ctx context.Context, gatewayName string) (*WafServic
}, nil }, nil
} }
func (s *wafService) CreateWaf(ctx context.Context, req *CreateWafReq) (*Waf, error) { func (s *wafService) CreateWaf(ctx context.Context, req *CreateWafReq) (*WafService, error) {
// Create the WAF service resource // Create the WAF service resource
service := &v1alpha1.Service{ service := &v1alpha1.Service{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
...@@ -137,7 +137,7 @@ func (s *wafService) CreateWaf(ctx context.Context, req *CreateWafReq) (*Waf, er ...@@ -137,7 +137,7 @@ func (s *wafService) CreateWaf(ctx context.Context, req *CreateWafReq) (*Waf, er
return nil, nil return nil, nil
} }
func (s *wafService) UpdateMode(ctx context.Context, req *UpdateModeReq) (*Waf, error) { func (s *wafService) UpdateMode(ctx context.Context, req *UpdateModeReq) (*WafService, error) {
// Check if WAF service exists // Check if WAF service exists
wafService := &model.WafService{} wafService := &model.WafService{}
err := s.db.Model(&model.WafService{}).Where("gateway_name = ?", req.GatewayName).First(wafService).Error err := s.db.Model(&model.WafService{}).Where("gateway_name = ?", req.GatewayName).First(wafService).Error
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment