提交 fe450179 编写于 作者: H Henry He

feat: first run

上级 dd45d11f
...@@ -2,11 +2,93 @@ ...@@ -2,11 +2,93 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.enthusa.askdata</groupId> <groupId>org.enthusa.askdata</groupId>
<artifactId>askdata-backend</artifactId> <artifactId>askdata-backend</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<properties>
<lombok.version>1.18.24</lombok.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>*.jar</include>
</includes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.enthusa.avatar</groupId>
<artifactId>avatar-interface</artifactId>
<version>master-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/avatar-interface-master-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.enthusa.avatar</groupId>
<artifactId>avatar-mybatis</artifactId>
<version>master-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/avatar-mybatis-master-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.enthusa.avatar</groupId>
<artifactId>avatar-core</artifactId>
<version>master-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/avatar-core-master-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project> </project>
package org.enthusa.askdata;
import org.enthusa.askdata.config.GlobalSetting;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
/**
* @author henry
* @date 2023/6/22
*/
@Controller
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Resource
private GlobalSetting globalSetting;
@GetMapping("/")
public ModelAndView home(ModelAndView model) {
model.addObject("env", globalSetting.getEnv());
model.setViewName("main");
return model;
}
}
package org.enthusa.askdata.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
/**
* @author henry
* @date 2023/6/24
*/
@Data
@Component
@Configuration
public class GlobalSetting {
@Value("${settings.env}")
private String env;
}
settings:
env: dev
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/askdata_dev?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
username: askdata_user
password: askdata624@MySQL
schema: classpath:import.sql
initialization-mode: never
settings:
env: prod
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://mysql.inscode.run:3306/askdata_prod?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
username: root
password: inscode
spring:
profiles:
active: dev
freemarker:
suffix: .ftl
server:
port: 8080
context-path: /
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<meta name='viewport' content='width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0'>
<meta name='apple-mobile-web-app-status-bar-style' content='black'>
<meta name='format-detection' content='telephone=no'>
<meta name='format-detection' content='email=no'>
<meta name='apple-mobile-web-app-capable' content='yes'>
<link href='//kysw-static.oss-cn-qingdao.aliyuncs.com/david.ico' rel='shortcut icon'>
<link href='//kysw-static.oss-cn-qingdao.aliyuncs.com/david.ico' rel='apple-touch-icon'>
<link href='https://kysw-static.oss-cn-qingdao.aliyuncs.com/askdata-${(env)!}.css' rel='stylesheet'>
<title>问数</title>
</head>
<body ontouchstart>
<div id='app'></div>
<script type='text/javascript' src='https://kysw-static.oss-cn-qingdao.aliyuncs.com/askdata-${(env)!}.js'></script>
</body>
</html>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册