diff --git a/web-mini/README.md b/web-mini/README.md new file mode 100644 index 00000000..4f638034 --- /dev/null +++ b/web-mini/README.md @@ -0,0 +1,15 @@ +## 介绍 + +jeesite-web-mini 是一个 JeeSite 极小的内核服务,1秒启动项目。 + +一般可用于后台内部数据处理服务,该项目不会初始化界面和权限。 + +甚至可以不初始化数据源,是一个非常快的小微服务。 + +## 文档 + +部署文档:http://jeesite.com/docs/install-deploy/ + +常见问题:http://jeesite.com/docs/faq/ + +更多文档:http://jeesite.com/docs diff --git a/web-mini/bin/docker-build.bat b/web-mini/bin/docker-build.bat new file mode 100644 index 00000000..a70a6f87 --- /dev/null +++ b/web-mini/bin/docker-build.bat @@ -0,0 +1,19 @@ +@echo off +rem /** +rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +rem * No deletion without permission, or be held responsible to law. +rem * +rem * Author: ThinkGem@163.com +rem */ +echo. +echo [Ϣ] WeḅDocker +echo. + +%~d0 +cd %~dp0 + +cd .. +call mvn clean package docker:remove docker:build -Dmaven.test.skip=true -U + +cd bin +pause \ No newline at end of file diff --git a/web-mini/bin/docker-build.sh b/web-mini/bin/docker-build.sh new file mode 100644 index 00000000..ab475930 --- /dev/null +++ b/web-mini/bin/docker-build.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# /** +# * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +# * No deletion without permission, or be held responsible to law. +# * +# * Author: ThinkGem@163.com +# * +# */ +echo "" +echo "[信息] 打包Web工程,编译Docker镜像。" +echo "" + +cd .. +mvn clean package docker:remove docker:build -Dmaven.test.skip=true -U + +cd bin \ No newline at end of file diff --git a/web-mini/bin/docker/Dockerfile b/web-mini/bin/docker/Dockerfile new file mode 100644 index 00000000..457af7ea --- /dev/null +++ b/web-mini/bin/docker/Dockerfile @@ -0,0 +1,21 @@ +FROM openjdk:8-slim +LABEL maintainer="ThinkGem@163.com" +ENV TZ "Asia/Shanghai" +ENV LANG C.UTF-8 +VOLUME /tmp +VOLUME /data + +WORKDIR /app + +#RUN mkdir WEB-INF +#ADD jeesite.lic ./WEB-INF +ADD ./maven/web.war ./app.war + +#ENV JAVA_OPTS "$JAVA_OPTS -Xms256m -Xmx1024m" +ENV JAVA_OPTS "$JAVA_OPTS -Dspring.profiles.active=prod" + +ENTRYPOINT jar -xvf app.war && rm app.war && cd WEB-INF && sh startup.sh + +EXPOSE 8980 + +#docker run -p 8980:8980 thinkgem/jeesite-web:5.3 diff --git a/web-mini/bin/init-data.bat b/web-mini/bin/init-data.bat new file mode 100644 index 00000000..b2052c03 --- /dev/null +++ b/web-mini/bin/init-data.bat @@ -0,0 +1,34 @@ +@echo off +rem /** +rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +rem * No deletion without permission, or be held responsible to law. +rem * +rem * Author: ThinkGem@163.com +rem */ +echo. +echo [Ϣ] ʼݿ⡣ +echo. +echo [Ϣ] Ҫ״ΰװ JeeSite װ Module ݱʼģѰװԶԡ +echo. +echo [Ϣ] v4.2 汾Ժ󣬹ٷʼݿDZȽϰȫģٷвκɾݱݵĽű +echo. +echo [Ϣ] ð汾ųǷΪȫȱݿٲ +echo. +pause + +%~d0 +cd %~dp0 + +cd .. + +call mvn clean compile -Dmaven.test.skip=true -U +echo. +echo [Ϣ] ɣ濪ʼʼݿ⡣ +echo. +pause + +set "MAVEN_OPTS=%MAVEN_OPTS% -Xms512m -Xmx1024m" +call mvn test -Dmaven.test.skip=false -Dtest=com.jeesite.test.InitData + +cd bin +pause \ No newline at end of file diff --git a/web-mini/bin/init-data.sh b/web-mini/bin/init-data.sh new file mode 100644 index 00000000..50132ce4 --- /dev/null +++ b/web-mini/bin/init-data.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# /** +# * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +# * No deletion without permission, or be held responsible to law. +# * +# * Author: ThinkGem@163.com +# * +# */ +echo "" +echo "[信息] 初始化数据库。" +echo "" +echo "[信息] 本操作主要用于首次安装 JeeSite 或后安装 Module 的数据表初始化,若模块已安装会自动忽略。" +echo "" +echo "[信息] 在 v4.2 版本以后,官方初始化数据库是比较安全的,官方代码中不会包含任何删除数据表及数据的脚本。" +echo "" +echo "[信息] 如果你是升级到该版本,不排除你是否升级完整,为安全起见,建议先备份数据库后再操作。" +echo "" +echo "请按回车键继续 ... " +read text + +cd .. + +mvn clean compile -Dmaven.test.skip=true -U +echo "" +echo "[信息] 依赖下载完成,下面开始初始化数据库。" +echo "" +echo "请按回车键继续 ... " +read text + +MAVEN_OPTS="$MAVEN_OPTS -Xms512m -Xmx1024m" +mvn test -Dmaven.test.skip=false -Dtest=com.jeesite.test.InitData + +cd bin +echo "请按回车键完成 ... " +read text \ No newline at end of file diff --git a/web-mini/bin/package.bat b/web-mini/bin/package.bat new file mode 100644 index 00000000..7613a836 --- /dev/null +++ b/web-mini/bin/package.bat @@ -0,0 +1,22 @@ +@echo off +rem /** +rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +rem * No deletion without permission, or be held responsible to law. +rem * +rem * Author: ThinkGem@163.com +rem */ +echo. +echo [Ϣ] Weḅwar/jarļ +echo. + +%~d0 +cd %~dp0 + +call mvn -v +echo. + +cd .. +call mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U + +cd bin +pause \ No newline at end of file diff --git a/web-mini/bin/package.sh b/web-mini/bin/package.sh new file mode 100644 index 00000000..b066d9f3 --- /dev/null +++ b/web-mini/bin/package.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# /** +# * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +# * No deletion without permission, or be held responsible to law. +# * +# * Author: ThinkGem@163.com +# */ +echo "" +echo "[信息] 打包Web工程,生成war/jar包文件。" +echo "" + +mvn -v +echo "" + +cd .. +mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U + +cd bin \ No newline at end of file diff --git a/web-mini/bin/run-tomcat.bat b/web-mini/bin/run-tomcat.bat new file mode 100644 index 00000000..1d090eea --- /dev/null +++ b/web-mini/bin/run-tomcat.bat @@ -0,0 +1,20 @@ +@echo off +rem /** +rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +rem * No deletion without permission, or be held responsible to law. +rem * +rem * Author: ThinkGem@163.com +rem */ +echo. +echo [Ϣ] ʹ Spring Boot Tomcat Web ̡ +echo. + +%~d0 +cd %~dp0 + +cd .. +title %cd% +set "MAVEN_OPTS=%MAVEN_OPTS% -Xms512m -Xmx1024m" +call mvn clean spring-boot:run -Dmaven.test.skip=true + +pause \ No newline at end of file diff --git a/web-mini/bin/run-tomcat.sh b/web-mini/bin/run-tomcat.sh new file mode 100644 index 00000000..982b7958 --- /dev/null +++ b/web-mini/bin/run-tomcat.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# /** +# * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +# * No deletion without permission, or be held responsible to law. +# * +# * Author: ThinkGem@163.com +# * +# */ +echo "" +echo "[信息] 使用 Spring Boot Tomcat 运行 Web 工程。" +echo "" + +cd .. +MAVEN_OPTS="$MAVEN_OPTS -Xms512m -Xmx1024m" +mvn clean spring-boot:run -Dmaven.test.skip=true \ No newline at end of file diff --git a/web-mini/bin/run-web.bat b/web-mini/bin/run-web.bat new file mode 100644 index 00000000..e03845ac --- /dev/null +++ b/web-mini/bin/run-web.bat @@ -0,0 +1,31 @@ +@echo off +rem /** +rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +rem * No deletion without permission, or be held responsible to law. +rem * +rem * Author: ThinkGem@163.com +rem */ +echo. +echo [Ϣ] WeḅWeb̡ +echo. + +%~d0 +cd %~dp0 + +rem Weḅʼ +cd .. +call mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U +cd target +rem Weḅ + + +rem ޸ web.jar Ϊ jar +mkdir app +copy web.war app +cd app +jar -xvf web.war +del web.war +cd WEB-INF +call startup.bat + +pause \ No newline at end of file diff --git a/web-mini/bin/run-web.sh b/web-mini/bin/run-web.sh new file mode 100644 index 00000000..6cb3043f --- /dev/null +++ b/web-mini/bin/run-web.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# /** +# * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +# * No deletion without permission, or be held responsible to law. +# * +# * Author: ThinkGem@163.com +# * +# */ +echo "" +echo "[信息] 打包Web工程,并运行Web工程。" +echo "" + +# 打包Web工程(开始) +cd .. +mvn clean package spring-boot:repackage -Dmaven.test.skip=true -U +cd target +# 打包Web工程(结束) + + +# 根据情况修改 web.jar 为您的 jar 包名称 +mkdir app +cp web.war ./app +cd app +jar -xvf web.war +rm web.war +cd WEB-INF +sh ./startup.sh diff --git a/web-mini/pom.xml b/web-mini/pom.xml new file mode 100644 index 00000000..cf2c4729 --- /dev/null +++ b/web-mini/pom.xml @@ -0,0 +1,132 @@ + + + 4.0.0 + + + com.jeesite + jeesite-parent + 5.5.1.springboot3-SNAPSHOT + ../parent/pom.xml + + + jeesite-web-mini + war + + Web 服务,最小化加载,可以甚至关闭数据源 + + JeeSite Web + http://jeesite.com + 2013-Now + + + + web + com.jeesite.modules.MiniApplication + + + 8980:8980 + + + + + + + + com.mysql + mysql-connector-j + runtime + + + + + com.jeesite + jeesite-framework + ${project.parent.version} + + + + + + + + ${finalName} + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + org.apache.maven.plugins + maven-war-plugin + + ${finalName} + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + + ${finalName} + + + + + + + + + thinkgem + WangZhen + thinkgem at 163.com + Project lead + +8 + + + + + JeeSite + http://jeesite.com + + + + + aliyun-repos + https://maven.aliyun.com/repository/public + true + false + + + jeesite-repos + https://maven.jeesite.net/repository/maven-public + + + + + aliyun-repos + https://maven.aliyun.com/repository/public + true + false + + + jeesite-repos + https://maven.jeesite.net/repository/maven-public + + + + diff --git a/web-mini/src/main/java/com/jeesite/modules/MiniApplication.java b/web-mini/src/main/java/com/jeesite/modules/MiniApplication.java new file mode 100644 index 00000000..d3128c9d --- /dev/null +++ b/web-mini/src/main/java/com/jeesite/modules/MiniApplication.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. + */ +package com.jeesite.modules; + +import com.jeesite.common.config.Global; +import com.jeesite.common.io.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +/** + * Application + * @author ThinkGem + */ +@SpringBootApplication +public class MiniApplication extends SpringBootServletInitializer { + + private static Logger logger = LoggerFactory.getLogger(MiniApplication.class); + + public static void main(String[] args) { + SpringApplication.run(MiniApplication.class, args); + logger.info( + "\r\n\r\n==============================================================\r\n" + + "\r\n 启动完成,系统监控地址:http://127.0.0.1:" + + Global.getProperty("server.port") + FileUtils.path("/" + + Global.getProperty("server.servlet.context-path") + + Global.getAdminPath()) + "state/server/index" + + "\r\n\r\n==============================================================\r\n"); + } + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + this.setRegisterErrorPageFilter(false); // 错误页面有容器来处理,而不是SpringBoot + return builder.sources(MiniApplication.class); + } + +} \ No newline at end of file diff --git a/web-mini/src/main/resources/config/application-prod.yml b/web-mini/src/main/resources/config/application-prod.yml new file mode 100644 index 00000000..1cfccc75 --- /dev/null +++ b/web-mini/src/main/resources/config/application-prod.yml @@ -0,0 +1,45 @@ + +# 使用环境配置,只需 JVM 参数里加:-Dspring.profiles.active=prod + +#======================================# +#========== Server settings ===========# +#======================================# + +server: + + port: 8980 + servlet: + context-path: /js + +#======================================# +#========== Database sttings ==========# +#======================================# + +# 数据库连接 +jdbc: + + # Mysql 数据库配置 + type: mysql + driver: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.56.1:3306/jeesite?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai + username: jeesite + password: jeesite + testSql: SELECT 1 + + # 数据库连接池配置 + pool: + + # 初始化连接数 + init: 1 + # 最小连接数 + minIdle: 3 + # 最大连接数 + maxActive: 20 + +#======================================# +#========== Spring settings ===========# +#======================================# + +# 日志配置 +logging: + config: classpath:config/logback-spring-prod.xml \ No newline at end of file diff --git a/web-mini/src/main/resources/config/application.yml b/web-mini/src/main/resources/config/application.yml new file mode 100644 index 00000000..be386a8c --- /dev/null +++ b/web-mini/src/main/resources/config/application.yml @@ -0,0 +1,174 @@ + +#======================================# +#========== Project settings ==========# +#======================================# + +# 产品或项目名称、软件开发公司名称 +productName: JeeSite Demo +companyName: ThinkGem + +# 产品版本、版权年份 +productVersion: V5.5 +copyrightYear: 2023 + +# 是否演示模式 +demoMode: false + +# 专为分离端提供接口服务 +apiMode: false + +#======================================# +#========== Server settings ===========# +#======================================# + +server: + + port: 8980 + servlet: + context-path: /js + register-default-servlet: false +# encoding.enabled: true + tomcat: + uri-encoding: UTF-8 + # 表单请求数据的最大大小 + max-http-form-post-size: 20MB +# # 进程的最大连接数 +# max-connections: 8192 +# # 连接数满后的排队个数 +# accept-count: 100 +# # 线程数最大和最小个数 +# threads: +# max: 200 +# min-spare: 10 + + # 当 Nginx 为 https,tomcat 为 http 时,设置该选项为 true + schemeHttps: false + +#======================================# +#========== Database sttings ==========# +#======================================# + +# 数据库连接(默认关闭,如果和 web.core.enabled 同时开启可使用如下功能: +# 配置参数:http://127.0.0.1:8980/js/a/sys/config/list +# 模块管理:http://127.0.0.1:8980/js/a/sys/module/list +# 字典管理:http://127.0.0.1:8980/js/a/sys/dictType/list +jdbc: + +# # Mysql 数据库配置 +# type: mysql +# driver: com.mysql.cj.jdbc.Driver +# url: jdbc:mysql://127.0.0.1:3306/jeesite_v5?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai +# username: root +# password: 123456 +# testSql: SELECT 1 + + # 数据库连接池配置 + pool: + + # 初始化连接数 + init: 1 + # 最小连接数 + minIdle: 3 + # 最大连接数 + maxActive: 20 + +#======================================# +#========== Framework settings ========# +#======================================# + +spring: + + # 应用程序名称 + application: + name: jeesite-web + + # 环境名称(注意:不可设置为 test 它是单元测试专用的名称) + profiles: + active: default + + # 打印横幅 + main: + bannerMode: "off" + + # MVC 映射匹配策略 + mvc: + pathmatch: + matching-strategy: ANT_PATH_MATCHER + + # JTA事务 + jta: + enabled: false + + # 缓存配置 + cache: + # 缓存及会话共享(专业版) + isClusterMode: false + +# 日志配置 +logging: + config: classpath:config/logback-spring.xml + +# 管理基础路径 +adminPath: /a + +# 前端基础路径 +frontPath: /f + +# 用户权限相关 +user: + enabled: false + +# 国际化管理 +lang: + enabled: false + +# 任务调度 +job: + enabled: false + +# 代码生成 +gen: + enabled: false + +# 系统监控(默认开启,可关闭)访问地址如下: +# 服务监控:http://127.0.0.1:8980/js/a/state/server/index +# 缓存监控:http://127.0.0.1:8980/js/a/state/cache/index +state: + enabled: true + +# Web 相关 +web: + + # MVC拦截器(访问日志和手机视图) + interceptor: + log: + enabled: false + mobile: + enabled: false + + # 是否启用核心内置功能的Controller加载 + core: + enabled: false + + # 在线API文档工具 + swagger: + enabled: false + +# Mapper文件刷新线程 +mybatis: + mapper: + refresh: + enabled: false + +# 文件上传 +file: + enabled: false + isFileStreamDown: false + +# 消息提醒中心 +msg: + enabled: false + +#======================================# +#========== Project settings ==========# +#======================================# diff --git a/web-mini/src/main/resources/config/beetl-core.properties b/web-mini/src/main/resources/config/beetl-core.properties new file mode 100644 index 00000000..405f5702 --- /dev/null +++ b/web-mini/src/main/resources/config/beetl-core.properties @@ -0,0 +1,158 @@ +#######默认配置(/org/beetl/core/beetl-default.properties) +ENGINE=org.beetl.core.engine.FastRuntimeEngine +DELIMITER_PLACEHOLDER_START=${ +DELIMITER_PLACEHOLDER_END=} +DELIMITER_PLACEHOLDER_START2="#{ +DELIMITER_PLACEHOLDER_END2=}" +DELIMITER_STATEMENT_START=<% +DELIMITER_STATEMENT_END=%> +DELIMITER_STATEMENT_START2=//# +DELIMITER_STATEMENT_END2= +DIRECT_BYTE_OUTPUT = FALSE +HTML_TAG_SUPPORT = true +HTML_TAG_FLAG = # +HTML_TAG_BINDING_ATTRIBUTE = var,export +HTML_TAG_ATTR_CONVERT=com.jeesite.common.beetl.text.BlankAttributeNameConvert +NATIVE_CALL = TRUE +TEMPLATE_CHARSET = UTF-8 +ERROR_HANDLER = com.jeesite.common.beetl.handler.LoggerErrorHandler +NATIVE_SECUARTY_MANAGER = org.beetl.core.DefaultNativeSecurityManager +RESOURCE_LOADER = org.beetl.core.resource.ClasspathResourceLoader +MVC_STRICT = FALSE + +#导入调用静态方法类 +IMPORT_PACKAGE= + +##导入JeeSite调用静态方法类(自动合并IMPORT_PACKAGE设置) +IMPORT_PACKAGE_core=\ + com.jeesite.common.config.;\ + com.jeesite.common.codec.;\ + com.jeesite.common.collect.;\ + com.jeesite.common.idgen.;\ + com.jeesite.common.lang.;\ + com.jeesite.common.mapper.;\ + com.jeesite.common.reflect.;\ + com.jeesite.common.security.;\ + com.jeesite.common.web.http.;\ + com.jeesite.modules.sys.utils.;\ + com.jeesite.common.entity.;\ + com.jeesite.common.service.;\ + com.jeesite.common.utils.;\ + +### 资源配置,resource后的属性只限于特定ResourceLoader #### +#classpath 跟路径,与框架集成的时候,此配置会被框架代码覆盖而不能生效 +RESOURCE.root = views +#是否检测文件变化 +RESOURCE.autoCheck = TRUE +#自定义脚本方法文件位置 +RESOURCE.functionRoot = functions +#自定义脚本方法文件的后缀 +RESOURCE.functionSuffix = html +#自定义标签文件位置 +RESOURCE.tagRoot = htmltags +#自定义标签文件后缀 +RESOURCE.tagSuffix = html + +#如果采用beetl集成的web应用,可以在渲染模板前调用如下类,此类必须实现WebRenderExt接口 +WEBAPP_EXT = + +#允许html function or Tag 使用特殊的定界符,因为function或者tag通常有大量beetl语句 +FUNCTION_TAG_LIMITER= + +##### 扩展,也可以通过特定框架注册############## +## 内置的方法 +FN.date = org.beetl.ext.fn.DateFunction +FN.nvl = org.beetl.ext.fn.NVLFunction +FN.debug = org.beetl.ext.fn.DebugFunction +#兼容以前版本,用has代替 +FN.exist = org.beetl.ext.fn.CheckExistFunction +FN.has = org.beetl.ext.fn.CheckExistFunction +FN.printf = org.beetl.ext.fn.Printf +FN.decode = org.beetl.ext.fn.DecodeFunction +FN.assert = org.beetl.ext.fn.AssertFunction +FN.print = org.beetl.ext.fn.Print +FN.println = org.beetl.ext.fn.Println +FN.printFile = org.beetl.ext.fn.PrintFile +FN.trunc = org.beetl.ext.fn.TruncFunction +FN.trim = org.beetl.ext.fn.TruncFunction2 +#兼容以前版本 empty,用isEmpty代替 +FN.empty = org.beetl.ext.fn.EmptyFunction +FN.qmark = org.beetl.ext.fn.QuestionMark +FN.isEmpty = org.beetl.ext.fn.EmptyExpressionFunction +FN.isNotEmpty = org.beetl.ext.fn.IsNotEmptyExpressionFunction +FN.parseInt = org.beetl.ext.fn.ParseInt +FN.parseLong = org.beetl.ext.fn.ParseLong +FN.parseDouble= org.beetl.ext.fn.ParseDouble +FN.range = org.beetl.ext.fn.Range +FN.flush = org.beetl.ext.fn.Flush +FN.json = org.beetl.ext.fn.Json +FN.pageCtx = org.beetl.ext.fn.PageContextFunction +FN.type.new=org.beetl.ext.fn.TypeNewFunction +FN.type.name=org.beetl.ext.fn.TypeNameFunction +FN.type.fullName=com.jeesite.common.beetl.ext.fn.TypeFullNameFunction +FN.global=org.beetl.ext.fn.DynamicGlobalValueFunction +FN.allGlobal=org.beetl.ext.fn.AllGlobaAsJsonlFunction +FN.hasAttribute=org.beetl.ext.fn.HasAttributeFunction +FN.env=org.beetl.ext.fn.EnvFunction +FN.parentTag=org.beetl.ext.fn.ParentTagFunction + +##JeeSite自定义函数 +FN.isBlank = com.jeesite.common.beetl.ext.fn.IsBlank +FN.isNotBlank = com.jeesite.common.beetl.ext.fn.IsNotBlank +FN.toBoolean = com.jeesite.common.beetl.ext.fn.ToBoolean +FN.toInteger = com.jeesite.common.beetl.ext.fn.ToInteger +FN.toJson = com.jeesite.common.beetl.ext.fn.ToJson +FN.fromJson = com.jeesite.common.beetl.ext.fn.FromJson +FN.hasPermi = com.jeesite.common.beetl.ext.fn.HasPermi +FN.hasRole = com.jeesite.common.beetl.ext.fn.HasRole +FN.cookie = com.jeesite.common.beetl.ext.fn.Cookie +FN.lang = com.jeesite.common.beetl.ext.fn.Lang +FN.text = com.jeesite.common.beetl.ext.fn.Text +FN.user = com.jeesite.common.beetl.ext.fn.User + +##内置的功能包 +FNP.strutil = org.beetl.ext.fn.StringUtil +FNP.reg = org.beetl.ext.fn.RegxFunctionUtil +FNP.array = org.beetl.ext.fn.ArrayUtil +FNP.dict = com.jeesite.common.beetl.ext.fn.DictUtil + +##内置的格式化函数 +FT.dateFormat = org.beetl.ext.format.DateFormat +FT.numberFormat = com.jeesite.common.beetl.ext.format.NumberFormat +FT.xss = com.jeesite.common.beetl.ext.format.XssFormat + +##内置的默认格式化函数 +FTC.java.util.Date = org.beetl.ext.format.DateFormat +FTC.java.sql.Date = org.beetl.ext.format.DateFormat +FTC.java.sql.Time = org.beetl.ext.format.DateFormat +FTC.java.sql.Timestamp = org.beetl.ext.format.DateFormat +FTC.java.lang.Short = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.lang.Long = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.lang.Integer = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.lang.Float = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.lang.Double = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.math.BigInteger = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.math.BigDecimal = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.util.concurrent.atomic.AtomicLong = com.jeesite.common.beetl.ext.format.NumberFormat +FTC.java.util.concurrent.atomic.AtomicInteger = com.jeesite.common.beetl.ext.format.NumberFormat + +##虚拟属性 无 +## 标签类 +TAG.include= org.beetl.ext.tag.IncludeTag +TAG.includeFileTemplate= org.beetl.ext.tag.IncludeTag +TAG.incdlueJSP= org.beetl.ext.jsp.IncludeJSPTag +TAG.layout= org.beetl.ext.tag.LayoutTag +TAG.delete= org.beetl.ext.tag.DeleteTag +#TAG.htmltag= org.beetl.ext.tag.HTMLTagSupportWrapper +#TAG.htmltagvar= org.beetl.ext.tag.HTMLTagVarBindingWrapper +TAG.htmltag= com.jeesite.common.beetl.ext.tag.HTMLTag +TAG.htmltagvar= com.jeesite.common.beetl.ext.tag.HTMLTagVar +TAG.htmltagexport= com.jeesite.common.beetl.ext.tag.HTMLTagVar +TAG.cache= org.beetl.ext.tag.cache.CacheTag +# 一个html风格的include和layout <#html:include file=""> +TAG.html.include= org.beetl.ext.tag.html.IncludeResourceHtmlTag +TAG.html.layout= org.beetl.ext.tag.html.LayoutResourceHtmlTag +TAG.html.set= org.beetl.ext.tag.html.SetHtmlTag +TAG.html.if= org.beetl.ext.tag.html.IfHtmlTag +TAG.html.foreach= org.beetl.ext.tag.html.ForeachHtmlTag +#TAG.includeUrl=org.beetl.ext.tag.IncludeUrlTag diff --git a/web-mini/src/main/resources/config/logback-spring-prod.xml b/web-mini/src/main/resources/config/logback-spring-prod.xml new file mode 100644 index 00000000..5a16c941 --- /dev/null +++ b/web-mini/src/main/resources/config/logback-spring-prod.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + %d{MM-dd HH:mm:ss.SSS} %clr(%-5p) %clr([%-39logger{39}]){cyan} - %m%n%wEx + + + + + + ${log.path}/debug.log + + ${log.path}/debug.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + + + + + ${log.path}/error.log + + ${log.path}/error.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + ERROR + + + + + + + + + + + \ No newline at end of file diff --git a/web-mini/src/main/resources/config/logback-spring.xml b/web-mini/src/main/resources/config/logback-spring.xml new file mode 100644 index 00000000..9bc86e57 --- /dev/null +++ b/web-mini/src/main/resources/config/logback-spring.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + %d{MM-dd HH:mm:ss.SSS} %clr(%-5p) %clr([%-39logger{39}]){cyan} - %m%n%wEx + + + + + + ${log.path}/debug.log + + ${log.path}/debug.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + + + + + ${log.path}/error.log + + ${log.path}/error.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + ERROR + + + + + + + + + + + \ No newline at end of file diff --git a/web-mini/src/main/resources/config/logger-core.xml b/web-mini/src/main/resources/config/logger-core.xml new file mode 100644 index 00000000..ee27863f --- /dev/null +++ b/web-mini/src/main/resources/config/logger-core.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web-mini/src/main/resources/mybatis/mybatis-config.xml b/web-mini/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 00000000..b1a85c8f --- /dev/null +++ b/web-mini/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web-mini/src/main/resources/static/common/common.css b/web-mini/src/main/resources/static/common/common.css new file mode 100644 index 00000000..f94b7e40 --- /dev/null +++ b/web-mini/src/main/resources/static/common/common.css @@ -0,0 +1,5 @@ +/*! + * Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. + * 项目自定义的公共CSS,可覆盖jeesite.css里的样式 + */ diff --git a/web-mini/src/main/resources/static/common/common.js b/web-mini/src/main/resources/static/common/common.js new file mode 100644 index 00000000..14bccc01 --- /dev/null +++ b/web-mini/src/main/resources/static/common/common.js @@ -0,0 +1,5 @@ +/*! + * Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. + * 项目自定义的公共JavaScript,可覆盖jeesite.js里的方法 + */ diff --git a/web-mini/src/main/resources/static/favicon.png b/web-mini/src/main/resources/static/favicon.png new file mode 100644 index 00000000..72734e51 Binary files /dev/null and b/web-mini/src/main/resources/static/favicon.png differ diff --git a/web-mini/src/main/resources/views/include/csslibs.html b/web-mini/src/main/resources/views/include/csslibs.html new file mode 100644 index 00000000..7dc9d5db --- /dev/null +++ b/web-mini/src/main/resources/views/include/csslibs.html @@ -0,0 +1,23 @@ +<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. */ %> + + + + +<% if (@ListUtils.inString('zTree', libs!)){ %> + +<% } %> +<% if (@ListUtils.inString('tabPage', libs!)){ %> + +<% } %> +<% if (@ListUtils.inString('dataGrid', libs!)){ %> + +<% } %> +<% if (@ListUtils.inString('layout', libs!)){ %> + +<% } %> +<% if (@ListUtils.inString('fileupload', libs!)){ %> + +<% } %> + + diff --git a/web-mini/src/main/resources/views/include/head.html b/web-mini/src/main/resources/views/include/head.html new file mode 100644 index 00000000..8497d414 --- /dev/null +++ b/web-mini/src/main/resources/views/include/head.html @@ -0,0 +1,11 @@ +<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. */%> + + + + +${(isNotBlank(title!) ? title! + ' - ' : '') + @Global.getConfig('productName')} + + + + diff --git a/web-mini/src/main/resources/views/include/jslibs.html b/web-mini/src/main/resources/views/include/jslibs.html new file mode 100644 index 00000000..b8a440bd --- /dev/null +++ b/web-mini/src/main/resources/views/include/jslibs.html @@ -0,0 +1,48 @@ +<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. */ %> + + + + + +<% if (@ListUtils.inString('zTree', libs!)){ %> + +<% } %> +<% if (@ListUtils.inString(['tabPage', 'dataGrid', 'fileupload'], libs!)){ %> + +<% } %> +<% if (@ListUtils.inString('tabPage', libs!)){ %> + + + +<% } %> +<% if (@ListUtils.inString('dataGrid', libs!)){ %> + + + +<% } %> +<% if (@ListUtils.inString('validate', libs!)){ %> + + + +<% } %> +<% if (@ListUtils.inString('layout', libs!)){ %> + + + +<% } %> +<% if (@ListUtils.inString('inputmask', libs!)){ %> + +<% } %> +<% if (@ListUtils.inString('fileupload', libs!)){ %> + + + +<% } %> +<% if (@ListUtils.inString('ueditor', libs!)){ %> + + + +<% } %> + + diff --git a/web-mini/src/main/resources/views/layouts/default.html b/web-mini/src/main/resources/views/layouts/default.html new file mode 100644 index 00000000..dfc14e55 --- /dev/null +++ b/web-mini/src/main/resources/views/layouts/default.html @@ -0,0 +1,12 @@ +<%/* Copyright (c) 2013-Now http://jeesite.com All rights reserved. + * No deletion without permission, or be held responsible to law. */ %> +<% print('<'+'!DOC'+'TYPE html'+'>'); %> +<% print('<'+'html'+'><'+'head'+'>'); %> +<% include('/include/head.html', {title: text(title!)}){} %> +<% include('/include/csslibs.html', {libs: libs!}){} %> + +<% if (!@ListUtils.inString('layout', libs!)){ %> +
${layoutContent}
+<% }else{ %>${layoutContent}<% } %> + +<% include('/include/jslibs.html', {libs: libs!}){} %> diff --git a/web-mini/src/main/webapp/WEB-INF/startup.bat b/web-mini/src/main/webapp/WEB-INF/startup.bat new file mode 100644 index 00000000..7d4f47a3 --- /dev/null +++ b/web-mini/src/main/webapp/WEB-INF/startup.bat @@ -0,0 +1,51 @@ +@echo off +rem /** +rem * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +rem * No deletion without permission, or be held responsible to law. +rem * +rem * Author: ThinkGem@163.com +rem */ +echo. +echo [Ϣ] Web̡ +echo. +rem pause +rem echo. + +%~d0 +cd %~dp0 + +title %cd% + +rem JDKĿ¼ +rem set "JAVA_HOME=%cd%\jdk1.8.0_x64" + +rem · +set "CLASS_PATH=%cd%/../" + +rem ŻJVM +set "JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx1024m" + +rem ʽһⲿԶļ飩 +rem set "JAVA_OPTS=%JAVA_OPTS% -Dspring.config.location=%cd%\app.yml" + +rem ʽûƣزͬļ +rem set "JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=prod" + +if "%JAVA_HOME%" == "" goto noJavaHome +if not "%JAVA_HOME%" == "" goto gotJavaHome +goto end + +:noJavaHome +set RUN_JAVA=java +goto runJava + +:gotJavaHome +set "RUN_JAVA=%JAVA_HOME%\bin\java" +goto runJava + +:runJava +call "%RUN_JAVA%" -cp %CLASS_PATH% %JAVA_OPTS% org.springframework.boot.loader.WarLauncher +goto end + +:end +pause diff --git a/web-mini/src/main/webapp/WEB-INF/startup.sh b/web-mini/src/main/webapp/WEB-INF/startup.sh new file mode 100644 index 00000000..2aeeb0a4 --- /dev/null +++ b/web-mini/src/main/webapp/WEB-INF/startup.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# /** +# * Copyright (c) 2013-Now http://jeesite.com All rights reserved. +# * No deletion without permission, or be held responsible to law. +# * +# * Author: ThinkGem@163.com +# */ +echo "" +echo "[信息] 运行Web工程。" +echo "" + +# 设置JDK目录 +# JAVA_HOME="$PWD/jdk1.8.0_x64" + +# 设置类加载路径 +CLASS_PATH="$PWD/../" + +# 优化JVM参数 +# JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx1024m" + +# 方式一、配置外部自定义的属性文件(建议) +# JAVA_OPTS="$JAVA_OPTS -Dspring.config.location=$PWD/app.yml" + +# 方式二、配置环境名称,加载不同的属性文件 +# JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=prod" + +if [ -z "$JAVA_HOME" ]; then + RUN_JAVA=java +else + RUN_JAVA="$JAVA_HOME"/bin/java +fi + +exec $RUN_JAVA -cp $CLASS_PATH $JAVA_OPTS org.springframework.boot.loader.WarLauncher \ No newline at end of file