parent
a75602d694
commit
7133727f7c
@ -0,0 +1,85 @@
|
|||||||
|
package com.dsideal.gw;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import com.jfinal.config.*;
|
||||||
|
import com.jfinal.kit.PropKit;
|
||||||
|
import com.jfinal.plugin.redis.RedisPlugin;
|
||||||
|
import com.jfinal.server.undertow.UndertowServer;
|
||||||
|
import com.jfinal.template.Engine;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class GwApplication extends JFinalConfig {
|
||||||
|
|
||||||
|
public static String getEnvPrefix() {
|
||||||
|
String myEnvVar = System.getenv("WORKING_ENV");
|
||||||
|
return myEnvVar == null ? "dev" : "pro";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("当前环境: " + getEnvPrefix());
|
||||||
|
String configFile = "undertow_{?}.properties".replace("{?}", getEnvPrefix());
|
||||||
|
UndertowServer.create(GwApplication.class, configFile).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置常量
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void configConstant(Constants me) {
|
||||||
|
//加载配置文件
|
||||||
|
String configFile = "application_{?}.properties".replace("{?}", getEnvPrefix());
|
||||||
|
PropKit.use(configFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置路由
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void configRoute(Routes me) {
|
||||||
|
//默认页面
|
||||||
|
//me.add("/", IndexController.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configEngine(Engine engine) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configPlugin(Plugins me) {
|
||||||
|
// 用于缓存模块的redis服务
|
||||||
|
//RedisPlugin redis = new RedisPlugin("Redis", PropKit.get("redis_ip"), PropKit.getInt("redis_port"), 10 * 1000);
|
||||||
|
//启动redis组件
|
||||||
|
//me.add(redis);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置全局拦截器
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void configInterceptor(Interceptors me) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置处理器
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void configHandler(Handlers me) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在jfinal启动完成后马上执行
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
//打印 启动Logo
|
||||||
|
String path = GwApplication.class.getClassLoader().getResource("logo.txt").getPath();
|
||||||
|
File file = new File(path);
|
||||||
|
System.out.println(FileUtil.readUtf8String(file));
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +0,0 @@
|
|||||||
<archetype>
|
|
||||||
<id>ds-gw</id>
|
|
||||||
<sources>
|
|
||||||
<source>src/main/java/App.java</source>
|
|
||||||
</sources>
|
|
||||||
<testSources>
|
|
||||||
<source>src/test/java/AppTest.java</source>
|
|
||||||
</testSources>
|
|
||||||
</archetype>
|
|
@ -0,0 +1,17 @@
|
|||||||
|
# 数据库信息
|
||||||
|
driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
user=root
|
||||||
|
password=DsideaL147258369
|
||||||
|
jdbcUrl=jdbc:mysql://10.10.14.210:22066/ds_db?rewriteBatchedStatements=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||||
|
# redis
|
||||||
|
redis_ip=10.10.14.210
|
||||||
|
redis_port=18890
|
||||||
|
redis_password=
|
||||||
|
# ==============================================================
|
||||||
|
# 生成Token的密码
|
||||||
|
CookieMd5SingPwd=DsideaL4r5t6y7u
|
||||||
|
# 导出excel 的模板配置路径
|
||||||
|
excelExportTemplatePathSuffix=/ExcelExportTemplate/
|
||||||
|
# 导入excel 的模板配置路径
|
||||||
|
ExcelImportTemplatePathSuffix=/ExcelImportTemplate/
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
# 数据库信息
|
||||||
|
driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
user=ylt
|
||||||
|
password=Ycharge666
|
||||||
|
jdbcUrl=jdbc:mysql://rm-bp1ux6tuk49er80t9.mysql.rds.aliyuncs.com:3306/ds_db?useUnicode=true&characterEncoding=UTF-8
|
||||||
|
# redis
|
||||||
|
redis_ip=r-bp14c1p5j5lkpw1jc2.redis.rds.aliyuncs.com
|
||||||
|
redis_port=6379
|
||||||
|
redis_password=Ycharge666
|
||||||
|
# ==============================================================
|
||||||
|
# 生成Token的密码
|
||||||
|
CookieMd5SingPwd=DsideaL4r5t6y7u
|
||||||
|
# 导出excel 的模板配置路径
|
||||||
|
excelExportTemplatePathSuffix=/ExcelExportTemplate/
|
||||||
|
# 导入excel 的模板配置路径
|
||||||
|
ExcelImportTemplatePathSuffix=/ExcelImportTemplate/
|
@ -1,15 +0,0 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<groupId>$dsideal</groupId>
|
|
||||||
<artifactId>$ds-gw</artifactId>
|
|
||||||
<version>$1.0</version>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>3.8.1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
@ -1,13 +0,0 @@
|
|||||||
package $dsideal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class App
|
|
||||||
{
|
|
||||||
public static void main( String[] args )
|
|
||||||
{
|
|
||||||
System.out.println( "Hello World!" );
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
package $dsideal;
|
|
||||||
|
|
||||||
import junit.framework.Test;
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
import junit.framework.TestSuite;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unit test for simple App.
|
|
||||||
*/
|
|
||||||
public class AppTest
|
|
||||||
extends TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Create the test case
|
|
||||||
*
|
|
||||||
* @param testName name of the test case
|
|
||||||
*/
|
|
||||||
public AppTest( String testName )
|
|
||||||
{
|
|
||||||
super( testName );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the suite of tests being tested
|
|
||||||
*/
|
|
||||||
public static Test suite()
|
|
||||||
{
|
|
||||||
return new TestSuite( AppTest.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rigourous Test :-)
|
|
||||||
*/
|
|
||||||
public void testApp()
|
|
||||||
{
|
|
||||||
assertTrue( true );
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
_______ ______ __ __
|
||||||
|
/ \ / \ / | _ / |
|
||||||
|
$$$$$$$ | _______ /$$$$$$ |$$ | / \ $$ |
|
||||||
|
$$ | $$ | / |$$ | _$$/ $$ |/$ \$$ |
|
||||||
|
$$ | $$ |/$$$$$$$/ $$ |/ |$$ /$$$ $$ |
|
||||||
|
$$ | $$ |$$ \ $$ |$$$$ |$$ $$/$$ $$ |
|
||||||
|
$$ |__$$ | $$$$$$ |$$ \__$$ |$$$$/ $$$$ |
|
||||||
|
$$ $$/ / $$/ $$ $$/ $$$/ $$$ |
|
||||||
|
$$$$$$$/ $$$$$$$/ $$$$$$/ $$/ $$/
|
||||||
|
|
||||||
|
power by http://patorjk.com/software/taag/
|
@ -0,0 +1,17 @@
|
|||||||
|
# 数据库信息
|
||||||
|
driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
user=root
|
||||||
|
password=DsideaL147258369
|
||||||
|
jdbcUrl=jdbc:mysql://10.10.14.210:22066/ds_db?rewriteBatchedStatements=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||||
|
# redis
|
||||||
|
redis_ip=10.10.14.210
|
||||||
|
redis_port=18890
|
||||||
|
redis_password=
|
||||||
|
# ==============================================================
|
||||||
|
# 生成Token的密码
|
||||||
|
CookieMd5SingPwd=DsideaL4r5t6y7u
|
||||||
|
# 导出excel 的模板配置路径
|
||||||
|
excelExportTemplatePathSuffix=/ExcelExportTemplate/
|
||||||
|
# 导入excel 的模板配置路径
|
||||||
|
ExcelImportTemplatePathSuffix=/ExcelImportTemplate/
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
# 数据库信息
|
||||||
|
driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
|
user=ylt
|
||||||
|
password=Ycharge666
|
||||||
|
jdbcUrl=jdbc:mysql://rm-bp1ux6tuk49er80t9.mysql.rds.aliyuncs.com:3306/ds_db?useUnicode=true&characterEncoding=UTF-8
|
||||||
|
# redis
|
||||||
|
redis_ip=r-bp14c1p5j5lkpw1jc2.redis.rds.aliyuncs.com
|
||||||
|
redis_port=6379
|
||||||
|
redis_password=Ycharge666
|
||||||
|
# ==============================================================
|
||||||
|
# 生成Token的密码
|
||||||
|
CookieMd5SingPwd=DsideaL4r5t6y7u
|
||||||
|
# 导出excel 的模板配置路径
|
||||||
|
excelExportTemplatePathSuffix=/ExcelExportTemplate/
|
||||||
|
# 导入excel 的模板配置路径
|
||||||
|
ExcelImportTemplatePathSuffix=/ExcelImportTemplate/
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
_______ ______ __ __
|
||||||
|
/ \ / \ / | _ / |
|
||||||
|
$$$$$$$ | _______ /$$$$$$ |$$ | / \ $$ |
|
||||||
|
$$ | $$ | / |$$ | _$$/ $$ |/$ \$$ |
|
||||||
|
$$ | $$ |/$$$$$$$/ $$ |/ |$$ /$$$ $$ |
|
||||||
|
$$ | $$ |$$ \ $$ |$$$$ |$$ $$/$$ $$ |
|
||||||
|
$$ |__$$ | $$$$$$ |$$ \__$$ |$$$$/ $$$$ |
|
||||||
|
$$ $$/ / $$/ $$ $$/ $$$/ $$$ |
|
||||||
|
$$$$$$$/ $$$$$$$/ $$$$$$/ $$/ $$/
|
||||||
|
|
||||||
|
power by http://patorjk.com/software/taag/
|
Loading…
Reference in new issue