Commit 97fea6c1 authored by liming's avatar liming

feat(初始化项目): init 合并多个commit

parent 781740e7
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>antai-sport-http-server</artifactId>
<groupId>com.antai.sport.http.server</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>game-api</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.antai.sport.http.server</groupId>
<artifactId>profile</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.antai.sport.http.server</groupId>
<artifactId>repository</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>antai-sport-http-server-game-api</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<fork>true</fork>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.antai.sport.http.server.game.api;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author 厉明
* @date 2021/8/18 11:35
* @email lmmax@126.com
* @description
*/
@SpringBootApplication
@MapperScan("com.antai.**.repository")
public class GameApiApplication {
public static void main(String[] args) {
SpringApplication.run(GameApiApplication.class, args);
}
}
package com.antai.sport.http.server.game.api.controller;
import com.antai.sport.http.server.repository.SysRole;
import com.antai.sport.http.server.repository.SysRoleMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author 厉明
* @date 2021/8/18 11:40
* @email lmmax@126.com
* @description
*/
@RestController
public class TestController {
@Resource
private SysRoleMapper sysRoleMapper;
@GetMapping("test")
public Map<String, Object> test() {
Map<String, Object> result = new HashMap<>();
List<SysRole> roleList = sysRoleMapper.selectList(null);
result.put("roleList", roleList);
return result;
}
}
spring:
profiles:
include:
- common-db-dev
\ No newline at end of file
spring:
profiles:
include:
- common-db-prod
\ No newline at end of file
spring:
application:
name: "antai-sport-http-server"
config:
use-legacy-processing: true
profiles:
active: dev
......@@ -3,14 +3,90 @@
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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.antai.sport.http.server</groupId>
<artifactId>antai-sport-http-server</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>repository</module>
<module>game-api</module>
<module>profile</module>
</modules>
<properties>
<java.version>11</java.version>
<spring-boot.version>2.4.2</spring-boot.version>
<mybatis-plus.version>3.4.3.1</mybatis-plus.version>
<jasypt.version>3.0.3</jasypt.version>
<yaml.version>1.28</yaml.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>${jasypt.version}</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>public</id>
<name>aliyun-repository</name>
<url>https://maven.aliyun.com/repository/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun-plugin</name>
<url>https://maven.aliyun.com/repository/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>antai-sport-http-server</artifactId>
<groupId>com.antai.sport.http.server</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>profile</artifactId>
<packaging>jar</packaging>
<name>profile</name>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.antai.sport.http.server.profile;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
/**
* @author 厉明
* @date 2021/8/18 14:24
* @email lmmax@126.com
* @description
*/
public class EncryptUtil {
/**
* Jasypt生成加密结果
*
* @param password 配置文件中设定的加密盐值
* @param value 加密值
* @return 加密结果
*/
public static String encryptPwd(String password, String value) {
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
encryptor.setConfig(initConfig(password));
return encryptor.encrypt(value);
}
/**
* 解密
*
* @param password 配置文件中设定的加密盐值
* @param value 解密密文
* @return 解密结果
*/
public static String decryptPwd(String password, String value) {
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor();
encryptor.setConfig(initConfig(password));
return encryptor.decrypt(value);
}
public static SimpleStringPBEConfig initConfig(String password) {
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPassword(password);
config.setAlgorithm("PBEWithMD5AndDES");
config.setKeyObtentionIterations("1000");
config.setPoolSize("1");
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setStringOutputType("base64");
return config;
}
}
spring:
profiles:
include:
- common-db
datasource:
url: jdbc:mysql://39.106.215.44:3306/baobeilianmeng${project.mysql-url-params}
username: root
password: ENC(eeesjD8BM2hklNwdDv4FCDoaVZF9c8+2)
logging:
level:
root: info
com.antai.sport.http.server.repository: debug
spring:
profiles:
include:
- common-db
datasource:
url: jdbc:mysql://39.106.215.44:3306/baobeilianmeng${project.mysql-url-params}
username: root
password: ENC(gIm3rgivj5IjdeWkJ/gsFAtIwg/+bX78)
project:
mysql-url-params: ?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&allowPublicKeyRetrieval=true
spring:
datasource:
hikari:
minimum-idle: 5
maximum-pool-size: 15
idle-timeout: 30000
max-lifetime: 120000
connection-timeout: 30000
connection-test-query: SELECT 1
jasypt:
encryptor:
password: lmmax
algorithm: PBEWithMD5AndDES
iv-generator-classname: org.jasypt.iv.NoIvGenerator
package com.antai.sport.http.server.profile;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@DisplayName("EncryptUtilTest")
public class EncryptUtilTest {
@Test
@DisplayName("testEncrypt")
public void testEncrypt() {
System.out.println(EncryptUtil.encryptPwd("123", "123"));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>antai-sport-http-server</artifactId>
<groupId>com.antai.sport.http.server</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>repository</artifactId>
<packaging>jar</packaging>
<name>repository</name>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.antai.sport.http.server.repository;
import lombok.Data;
/**
* @author 厉明
* @date 2021/8/18 15:02
* @email lmmax@126.com
* @description
*/
@Data
public class SysRole {
private Long id;
private String code;
private String name;
}
package com.antai.sport.http.server.repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author 厉明
* @date 2021/8/18 15:09
* @email lmmax@126.com
* @description
*/
public interface SysRoleMapper extends BaseMapper<SysRole> {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment