All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.itxiaoer.commons.jwt.JwtToken Maven / Gradle / Ivy

There is a newer version: 2.3.4
Show newest version
package com.itxiaoer.commons.jwt;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;

/**
 * @author : liuyk
 */
@Data
@SuppressWarnings({"unused", "WeakerAccess"})
public class JwtToken implements Serializable {

    static final long serialVersionUID = 6739574768237935126L;

    private String token;
    private Long expireTime;
    @JsonIgnore
    private Long refreshTime;

    @JsonIgnore
    private int type;

    public JwtToken() {

    }

    public JwtToken(String token, Long expireTime) {
        this(token, expireTime, null);
    }

    public JwtToken(String token, Long expireTime, Long refreshTime) {
        this.expireTime = expireTime;
        this.token = token;
        this.refreshTime = refreshTime;
    }

    public JwtToken(String token, Long expireTime, Long refreshTime, int type) {
        this.expireTime = expireTime;
        this.token = token;
        this.refreshTime = refreshTime;
        this.type = type;
    }

    /**
     * @author : liuyk
     */
    public enum Operation {
        /**
         * 创建
         */
        create(0),
        /**
         * 刷新
         */
        refresh(1),
        /**
         * 销毁
         */
        destroy(-1);

        private int value;

        Operation(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy