package com.zhangmeng.admin.manager.config.verificationCode;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhangmeng
 * @version 1.0
 * @date 2020年11月16日16:34:08
 */
@Configuration
@ConfigurationProperties(prefix = "verification-code")
public class VerificationCodeConfig {

    private String redisKey;

    private Long expirationTime;

    @NestedConfigurationProperty
    private Type type;

    public enum Type {

        RAM("内存"),
        MYSQL("mysql"),
        REDIS("redis");

        private String description;

        Type(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public Long getExpirationTime() {
        return expirationTime;
    }

    public void setExpirationTime(Long expirationTime) {
        this.expirationTime = expirationTime;
    }

    public String getRedisKey() {
        return redisKey;
    }

    public void setRedisKey(String redisKey) {
        this.redisKey = redisKey;
    }
}
