package com.common.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

public class SyslogRequest {

    @NotBlank(message = "IP地址不能为空")
    private String ip;

    @NotNull(message = "端口号不能为空")
    private Integer port;

    @NotBlank(message = "日志内容不能为空")
    private String logContent;

    private String protocol = "UDP"; // 默认UDP协议
    private String facility = "USER"; // 设施
    private String severity = "INFO"; // 严重级别

    // 构造函数
    public SyslogRequest() {}

    public SyslogRequest(String ip, Integer port, String logContent) {
        this.ip = ip;
        this.port = port;
        this.logContent = logContent;
    }

    // Getter和Setter方法
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getLogContent() {
        return logContent;
    }

    public void setLogContent(String logContent) {
        this.logContent = logContent;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public String getFacility() {
        return facility;
    }

    public void setFacility(String facility) {
        this.facility = facility;
    }

    public String getSeverity() {
        return severity;
    }

    public void setSeverity(String severity) {
        this.severity = severity;
    }

    @Override
    public String toString() {
        return "SyslogRequest{" +
                "ip='" + ip + '\'' +
                ", port=" + port +
                ", logContent='" + logContent + '\'' +
                ", protocol='" + protocol + '\'' +
                ", facility='" + facility + '\'' +
                ", severity='" + severity + '\'' +
                '}';
    }
}