package org.dromara.demo.domain;

import com.baomidou.mybatisplus.annotation.*;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.util.Base64;

/**
 * 测试单表对象 test_demo
 *
 * @author Lion Li
 * @date 2021-07-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("test_demo")
public class TestDemo extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;


    /**
     * 主键
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 部门id
     */
    private Long deptId;

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

    /**
     * 排序号
     */
    @OrderBy(asc = false, sort = 1)
    private Integer orderNum;

    /**
     * key键
     */
    private String testKey;

    /**
     * 值
     */
    private String value;

    /**
     * 版本
     */
    @Version
    private Long version;

    /**
     * 删除标志
     */
    @TableLogic
    private Long delFlag;


    public static void main(String[] args) {
//       byte[] bytes =  Base64.decode("YVd+ZNfLLowp45JTyri0nO2SHo1ooKDU/QRc9MIsk4Ih52SN+uR2vMRNZLMJ23dKXJefCi9xm2BA37ZIkkl7614iXTwnmsNiuoMmOfH+ds=");
        String encodedString = "YVd+ZNfLLowp45JTyri0nO2SHo1ooKDU/QRc9MIsk4Ih52SN++uR2vMRNZLMJ23dKXJefCi9xm2BA37ZIkkl7614iXTwnmsNiuoMmOfH+ds=";
//        if (encodedString.length() % 4 != 0) {
//            int padSize = 4 - (encodedString.length() % 4);
//            encodedString += "="; // 添加填充字符
//        }
        System.out.println(encodedString);
        byte[] bytes = Base64.getDecoder().decode(encodedString);
       System.out.println(bytes.length);
    }
}
