package com.bonus.canteen.core.notice.hawkeye.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.bonus.canteen.core.common.encrypt.LeNiuDecryptDataProcess;
import com.bonus.canteen.core.common.encrypt.LeNiuDecryptField;
import com.bonus.canteen.core.common.encrypt.SM4EncDecHandler;
import com.bonus.canteen.core.notice.hawkeye.util.LocalDateTimeConverter;

import java.time.LocalDateTime;

@TableName(
   value = "alloc_log_record",
   autoResultMap = true
)
@ApiModel("系统日志统计表")
@LeNiuDecryptDataProcess
public class AllocLogRecord extends Model<AllocLogRecord> {
   @TableId
   @ApiModelProperty("主键id")
   @ExcelIgnore
   private Long id;
   @ApiModelProperty("日志统计id")
   @ExcelIgnore
   private Long logRecordId;
   @ApiModelProperty("登录人员名称")
   @ExcelProperty(
      value = {"登录人员名称"},
      index = 0
   )
   private String loginUserName;
   @ApiModelProperty("登录人员手机号")
   @ExcelProperty(
      value = {"登录人员手机号"},
      index = 1
   )
   @TableField(
      value = "login_user_phone",
      typeHandler = SM4EncDecHandler.class
   )
   @LeNiuDecryptField
   private String loginUserPhone;
   @ApiModelProperty("登录人员手机号后缀")
   @TableField(
      value = "login_user_phone_suffix",
      typeHandler = SM4EncDecHandler.class
   )
   @LeNiuDecryptField
   @ExcelIgnore
   private String loginUserPhoneSuffix;
   @ApiModelProperty("登录ip地址")
   @ExcelProperty(
      value = {"登录ip地址"},
      index = 2
   )
   private String loginIp;
   @ApiModelProperty("请求uri")
   @ExcelProperty(
      value = {"请求URI"},
      index = 3
   )
   private String requestUri;
   @ApiModelProperty("访问功能")
   @ExcelProperty(
      value = {"操作类型"},
      index = 4
   )
   private String operateFunc;
   @ApiModelProperty("操作类型")
   @ExcelIgnore
   private Integer operateType;
   @ApiModelProperty("执行时间")
   @ExcelIgnore
   private Long executionTime;
   @ApiModelProperty("创建人")
   @ExcelIgnore
   private String crby;
   @ApiModelProperty("创建时间")
   @ExcelProperty(
      value = {"操作时间"},
      index = 5,
      converter = LocalDateTimeConverter.class
   )
   private LocalDateTime crtime;

   public AllocLogRecord(Long logRecordId, String loginUserName, String requestUri, String operateFunc, Integer operateType) {
      this.logRecordId = logRecordId;
      this.loginUserName = loginUserName;
      this.requestUri = requestUri;
      this.operateFunc = operateFunc;
      this.operateType = operateType;
   }

   public Long getId() {
      return this.id;
   }

   public Long getLogRecordId() {
      return this.logRecordId;
   }

   public String getLoginUserName() {
      return this.loginUserName;
   }

   public String getLoginUserPhone() {
      return this.loginUserPhone;
   }

   public String getLoginUserPhoneSuffix() {
      return this.loginUserPhoneSuffix;
   }

   public String getLoginIp() {
      return this.loginIp;
   }

   public String getRequestUri() {
      return this.requestUri;
   }

   public String getOperateFunc() {
      return this.operateFunc;
   }

   public Integer getOperateType() {
      return this.operateType;
   }

   public Long getExecutionTime() {
      return this.executionTime;
   }

   public String getCrby() {
      return this.crby;
   }

   public LocalDateTime getCrtime() {
      return this.crtime;
   }

   public void setId(final Long id) {
      this.id = id;
   }

   public void setLogRecordId(final Long logRecordId) {
      this.logRecordId = logRecordId;
   }

   public void setLoginUserName(final String loginUserName) {
      this.loginUserName = loginUserName;
   }

   public void setLoginUserPhone(final String loginUserPhone) {
      this.loginUserPhone = loginUserPhone;
   }

   public void setLoginUserPhoneSuffix(final String loginUserPhoneSuffix) {
      this.loginUserPhoneSuffix = loginUserPhoneSuffix;
   }

   public void setLoginIp(final String loginIp) {
      this.loginIp = loginIp;
   }

   public void setRequestUri(final String requestUri) {
      this.requestUri = requestUri;
   }

   public void setOperateFunc(final String operateFunc) {
      this.operateFunc = operateFunc;
   }

   public void setOperateType(final Integer operateType) {
      this.operateType = operateType;
   }

   public void setExecutionTime(final Long executionTime) {
      this.executionTime = executionTime;
   }

   public void setCrby(final String crby) {
      this.crby = crby;
   }

   public void setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
   }

   public String toString() {
      Long var10000 = this.getId();
      return "AllocLogRecord(id=" + var10000 + ", logRecordId=" + this.getLogRecordId() + ", loginUserName=" + this.getLoginUserName() + ", loginUserPhone=" + this.getLoginUserPhone() + ", loginUserPhoneSuffix=" + this.getLoginUserPhoneSuffix() + ", loginIp=" + this.getLoginIp() + ", requestUri=" + this.getRequestUri() + ", operateFunc=" + this.getOperateFunc() + ", operateType=" + this.getOperateType() + ", executionTime=" + this.getExecutionTime() + ", crby=" + this.getCrby() + ", crtime=" + String.valueOf(this.getCrtime()) + ")";
   }

   public AllocLogRecord() {
   }
}
