package com.changhu.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.changhu.common.db.enums.IsEnable;
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;


/**
 * 开放接口的授权 实体类
 * author: luozhun
 * desc 由groovy脚本自动生成
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@TableName(autoResultMap = true)
public class AccessKeys extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 调用方
     */
    private String name;

    /**
     * 有效时间
     */
    private Integer effectiveTime;

    /**
     * AccessKey
     */
    private String accessKey;

    /**
     * SecretKey
     */
    private String secretKey;

    /**
     * 允许访问的资源
     */
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<String> allowedResources;

    /**
     * 是否启用
     */
    private IsEnable isEnable;

    /**
     * 备注
     */
    private String remark;


}
