package cn.estsh.i3plus.pojo.platform.platbean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;

/**
 * @Description : 系统日志表
 * @Reference   :
 * @Author      : wei.peng
 * @Date        : 2018-10-22 16:58:42.784
 * @Modify      :
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Api(value="系统日志表",description = "系统日志表")
public class SysLogSystem extends BaseBean {

    private static final long serialVersionUID = -2209777442410263684L;
    @ApiParam(value ="日志级别" , example ="1")
    @AnnoOutputColumn(refClass = ImppEnumUtil.LOG_LEVEL.class,refForeignKey = "value",value = "name")
    private Integer logLevel;
    public String getLogLevelTxt() {
        return logLevel == null ? null : ImppEnumUtil.LOG_LEVEL.valueOfDescription(logLevel);
    }

    @ApiParam(value ="系统模块（枚举）", example = "1")
    @AnnoOutputColumn(refClass = CommonEnumUtil.SOFT_TYPE.class,refForeignKey = "value",value = "description")
    private Integer softType;
    public String getSoftTypeTxt() {
        return softType == null ? null : CommonEnumUtil.SOFT_TYPE.valueOfDescription(softType);
    }

    @ApiParam(value ="系统模块（枚举）", example = "1")
    @AnnoOutputColumn(refClass = CommonEnumUtil.SOFT_TYPE.class,refForeignKey = "value",value = "description")
    private Integer logModuleId;
    public String getLogModuleId() {
        return logModuleId == null ? null : CommonEnumUtil.SOFT_TYPE.valueOfDescription(logModuleId);
    }

    @ApiParam(value ="请求IP" , access ="请求IP")
    private String remoteIp;


    @ApiParam(value ="请求路径" , access ="请求路径")
    private String requestUrl;

    @ApiParam(value ="http请求方法" , access ="http请求方法")
    private String httpMethod;

    @ApiParam(value ="触发类路径" , access ="触发类路径")
    private String logClass;

    @ApiParam(value ="触发方法" , access ="触发方法")
    private String logMethod;

    @ApiParam(value ="入参数量" , access ="入参数量", example = "0")
    private Integer argsCount;

    @ApiParam(value ="方法入参" , access ="方法入参")
    private String logArgs;

    @ApiParam(value ="日志标题")
    private String logTitle;

    @ApiParam(value ="日志详情")
    private String logDetail;

    @ApiParam(value ="服务器")
    private String serverHost;

    @ApiParam(value ="执行耗时")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long executeTime;

}
