2023-03-27 19:02:36 +08:00
|
|
|
package dto
|
|
|
|
|
2023-03-30 16:07:28 +08:00
|
|
|
type FirewallBaseInfo struct {
|
2023-03-30 18:03:21 +08:00
|
|
|
Name string `json:"name"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
PingStatus string `json:"pingStatus"`
|
2023-03-30 16:07:28 +08:00
|
|
|
}
|
|
|
|
|
2023-03-27 19:02:36 +08:00
|
|
|
type RuleSearch struct {
|
|
|
|
PageInfo
|
2023-08-30 14:56:11 +08:00
|
|
|
Info string `json:"info"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Strategy string `json:"strategy"`
|
|
|
|
Type string `json:"type" validate:"required"`
|
2023-03-27 19:02:36 +08:00
|
|
|
}
|
|
|
|
|
2023-03-30 16:07:28 +08:00
|
|
|
type FirewallOperation struct {
|
2023-12-18 11:42:13 +08:00
|
|
|
Operation string `json:"operation" validate:"required,oneof=start stop restart disablePing enablePing"`
|
2023-03-30 16:07:28 +08:00
|
|
|
}
|
|
|
|
|
2023-03-27 19:02:36 +08:00
|
|
|
type PortRuleOperate struct {
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
|
|
|
Address string `json:"address"`
|
|
|
|
Port string `json:"port" validate:"required"`
|
2023-03-27 23:29:46 +08:00
|
|
|
Protocol string `json:"protocol" validate:"required,oneof=tcp udp tcp/udp"`
|
2023-03-27 19:02:36 +08:00
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
2023-08-15 22:48:11 +08:00
|
|
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
}
|
|
|
|
|
2024-06-15 22:28:03 +08:00
|
|
|
type ForwardRuleOperate struct {
|
|
|
|
Rules []struct {
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
|
|
|
Num string `json:"num"`
|
|
|
|
Protocol string `json:"protocol" validate:"required,oneof=tcp udp tcp/udp"`
|
|
|
|
Port string `json:"port" validate:"required"`
|
|
|
|
TargetIP string `json:"targetIP"`
|
|
|
|
TargetPort string `json:"targetPort" validate:"required"`
|
|
|
|
} `json:"rules"`
|
|
|
|
}
|
|
|
|
|
2023-08-15 22:48:11 +08:00
|
|
|
type UpdateFirewallDescription struct {
|
2023-08-30 14:56:11 +08:00
|
|
|
Type string `json:"type"`
|
2023-08-15 22:48:11 +08:00
|
|
|
Address string `json:"address"`
|
|
|
|
Port string `json:"port"`
|
|
|
|
Protocol string `json:"protocol"`
|
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
|
|
|
|
|
|
|
Description string `json:"description"`
|
2023-03-27 19:02:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type AddrRuleOperate struct {
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
|
|
|
Address string `json:"address" validate:"required"`
|
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
2023-08-15 22:48:11 +08:00
|
|
|
|
|
|
|
Description string `json:"description"`
|
2023-03-27 19:02:36 +08:00
|
|
|
}
|
2023-03-28 15:17:13 +08:00
|
|
|
|
|
|
|
type PortRuleUpdate struct {
|
|
|
|
OldRule PortRuleOperate `json:"oldRule"`
|
|
|
|
NewRule PortRuleOperate `json:"newRule"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddrRuleUpdate struct {
|
|
|
|
OldRule AddrRuleOperate `json:"oldRule"`
|
|
|
|
NewRule AddrRuleOperate `json:"newRule"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type BatchRuleOperate struct {
|
|
|
|
Type string `json:"type" validate:"required"`
|
|
|
|
Rules []PortRuleOperate `json:"rules"`
|
|
|
|
}
|