package org.jeecg.modules.adweb.enterprise.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/** 子用户权限表 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AdwebSysUserPermission implements Serializable {

  private static final long serialVersionUID = 1L;

  /** id */
  @TableId(type = IdType.AUTO)
  private Integer id;

  /** 用户id */
  private String userId;

  /** 权限id */
  private String permissionId;

  /** 操作时间 */
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  public AdwebSysUserPermission() {}

  public AdwebSysUserPermission(String userId, String permissionId) {
    this.userId = userId;
    this.permissionId = permissionId;
    this.createTime = new Date();
  }
}
