测试用户
2023-04-13 43393f2bb11cbf9e6af40077bbc5284660e8a754
1
/**  * $Id: JfinalProperties.java,v 1.0 2019-07-14 00:46 chenmin Exp $  */ package com.common.configure; import com.jfinal.plugin.activerecord.dialect.Dialect; import lombok.Data; import lombok.experimental.Accessors; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import java.util.ArrayList; import java.util.List; /**  * @author 廖振钦  * @date 2019-01-11  */ @Slf4j @Component @Data @Validated @Accessors(chain = true) @ConfigurationProperties(prefix = "jfinal") public class JfinalProperties {     /**      * SQL模板路径      */ //    private List<String> sqlTemplates = Lists.newArrayList();     private List<String> sqlTemplates = new ArrayList<>();     /**      * kit类全路径      */ //    private List<String> kitClasses = Lists.newArrayList();     private List<String> kitClasses = new ArrayList<>();     /**      * 是否打开开发模式      */     private Boolean devMode = false;     /**      * 是否显示查询SQL      */     private Boolean showSql;     /**      * 数据库方言:默认支持MYSQL,ORACLE,SQLSERVER,SQLITE,POSTGRESQL      */     private Class<? extends Dialect> dialect;     private Boolean injectDependency = false;     private String baseUploadPath;     private String baseDownloadPath;     private Integer maxPostSize;     private Integer delayInSeconds;     private String defaultBaseName;     private String defaultLocale;     private Boolean injectSuperClass;     private Boolean reportAfterInvocation;     private String datePattern;     private String urlParaSeparator;     private String viewExtension;     private Boolean clearAfterMapping;     private Boolean mappingSuperClass;     private Boolean createSession;     private String baseTemplatePath;     private Boolean sessionInView;     /**      * 是否允许覆盖Request      */     private Boolean allowRequestOverride;     /**      * 是否允许覆盖Session      */     private Boolean allowSessionOverride;     /**      * 事务级别      */     private Integer transactionLevel;     /**      * 插件加载顺序      */     private Integer configPluginOrder;     @Data     @Accessors(chain = true)     public static class TaskInfo {         private String cron;         private String task;         /**          * 是否开启守护进程          */         private Boolean daemon;         /**          * 是否开启任务,默认开启          */         private Boolean enable = true;         public TaskInfo() {         }         public TaskInfo(String cron, String task, boolean daemon, boolean enable) {             if (ObjectUtils.isEmpty(cron)) {                 throw new IllegalArgumentException("cron 不能为空.");             }             if (ObjectUtils.isEmpty(task)) {                 throw new IllegalArgumentException("task 不能为 null.");             }             this.cron = cron.trim();             this.task = task;             this.daemon = daemon;             this.enable = enable;         }     } }