mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-17 02:20:26 +08:00
实现防火墙配置
This commit is contained in:
@@ -207,3 +207,20 @@ func (this *HTTPWebService) UpdateHTTPCache(ctx context.Context, req *pb.UpdateH
|
||||
|
||||
return rpcutils.RPCUpdateSuccess()
|
||||
}
|
||||
|
||||
|
||||
// 更改防火墙设置
|
||||
func (this *HTTPWebService) UpdateHTTPFirewall(ctx context.Context, req *pb.UpdateHTTPFirewallRequest) (*pb.RPCUpdateSuccess, error) {
|
||||
// 校验请求
|
||||
_, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = models.SharedHTTPWebDAO.UpdateWebFirewall(req.WebId, req.FirewallJSON)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return rpcutils.RPCUpdateSuccess()
|
||||
}
|
||||
Reference in New Issue
Block a user