|
@@ -12,9 +12,9 @@ import (
|
|
type CcIpListService interface {
|
|
type CcIpListService interface {
|
|
GetCcIpList(ctx context.Context, webId int64) ([]string, error)
|
|
GetCcIpList(ctx context.Context, webId int64) ([]string, error)
|
|
AddCcIpListPolicy(ctx context.Context, serverId int64,serverGroupId int64) error
|
|
AddCcIpListPolicy(ctx context.Context, serverId int64,serverGroupId int64) error
|
|
- AddCcWhiteIp(ctx context.Context, webId int64,ip string,reason string) error
|
|
|
|
|
|
+ AddCcWhiteIp(ctx context.Context, webId int64,ip string,comment string) error
|
|
DelCcWhiteIp(ctx context.Context, webId int64,ips []string) error
|
|
DelCcWhiteIp(ctx context.Context, webId int64,ips []string) error
|
|
- EditCcWhiteIp(ctx context.Context, webId int64,oldIp string,newIp string,reason string) error
|
|
|
|
|
|
+ EditCcWhiteIp(ctx context.Context, webId int64,oldIp string,newIp string,comment string) error
|
|
|
|
|
|
}
|
|
}
|
|
func NewCcIpListService(
|
|
func NewCcIpListService(
|
|
@@ -94,7 +94,7 @@ func (s *ccIpListService) AddCcIpListPolicy(ctx context.Context, serverId int64,
|
|
|
|
|
|
|
|
|
|
// 添加白名单
|
|
// 添加白名单
|
|
-func (s *ccIpListService) AddCcWhiteIp(ctx context.Context, webId int64,ip string,reason string) error {
|
|
|
|
|
|
+func (s *ccIpListService) AddCcWhiteIp(ctx context.Context, webId int64,ip string,comment string) error {
|
|
serverId, err := s.GetServerId(ctx, webId)
|
|
serverId, err := s.GetServerId(ctx, webId)
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
@@ -107,7 +107,7 @@ func (s *ccIpListService) AddCcWhiteIp(ctx context.Context, webId int64,ip strin
|
|
err = s.cdn.AddIpItem(ctx,v1.AddIpItem{
|
|
err = s.cdn.AddIpItem(ctx,v1.AddIpItem{
|
|
IpListId: ipListId,
|
|
IpListId: ipListId,
|
|
Value: ip,
|
|
Value: ip,
|
|
- Reason: reason,
|
|
|
|
|
|
+ Reason: comment,
|
|
EventLevel: "notice",
|
|
EventLevel: "notice",
|
|
SourceCategory: "cc",
|
|
SourceCategory: "cc",
|
|
})
|
|
})
|
|
@@ -117,7 +117,7 @@ func (s *ccIpListService) AddCcWhiteIp(ctx context.Context, webId int64,ip strin
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
-func (s *ccIpListService) EditCcWhiteIp(ctx context.Context, webId int64,oldIp string,newIp string,reason string) error {
|
|
|
|
|
|
+func (s *ccIpListService) EditCcWhiteIp(ctx context.Context, webId int64,oldIp string,newIp string,comment string) error {
|
|
serverId, err := s.GetServerId(ctx, webId)
|
|
serverId, err := s.GetServerId(ctx, webId)
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
@@ -134,7 +134,7 @@ func (s *ccIpListService) EditCcWhiteIp(ctx context.Context, webId int64,oldIp s
|
|
err = s.cdn.EditIpItem(ctx,v1.AddIpItem{
|
|
err = s.cdn.EditIpItem(ctx,v1.AddIpItem{
|
|
IpItemId: ipItemId,
|
|
IpItemId: ipItemId,
|
|
Value: newIp,
|
|
Value: newIp,
|
|
- Reason: reason,
|
|
|
|
|
|
+ Reason: comment,
|
|
EventLevel: "notice",
|
|
EventLevel: "notice",
|
|
SourceCategory: "cc",
|
|
SourceCategory: "cc",
|
|
})
|
|
})
|