Skip to content

auto configuration base SpringBoot & SpringBoot starter & weChatMiniProgram & TencentCloud

License

Notifications You must be signed in to change notification settings

FutaoSmile/starter-fustack

Repository files navigation

# 在项目中使用此依赖

  • use in gradle project
    • Step 1. Add the JitPack repository to your build file
    • Step 2. Add the dependency
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
        implementation 'com.github.FutaoSmile:starter-fustack:Tag'
}
  • use in maven project
    • Step 1: Add the JitPack repository to your build file
    • Step 2. Add the dependency
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.FutaoSmile</groupId>
    <artifactId>starter-fustack</artifactId>
    <version>Tag</version>
</dependency>

# 配置文件加密 jasypt

<dependency>
    <groupId>com.github.ulisesbocchio</groupId>
    <artifactId>jasypt-spring-boot-starter</artifactId>
    <version>3.0.3</version>
</dependency>
  • 设置密码: jasypt.encryptor.password=xxx
    • 不可以被泄露哟,可以在IDEA的Program arguments设置。
  • 加密命令 mvn jasypt:encrypt-value -Djasypt.encryptor.password="the password" -Djasypt.plugin.value="theValueYouWantToEncrypt"
  • 加密解密
@Autowired
    private StringEncryptor encryptor;

    @Override
    public void run(String... args) throws Exception {
        System.out.println(encryptor.encrypt("123456"));
        System.out.println(encryptor.decrypt("12mXd8r6ni5ZGrqOOm7xNxkyJJImJzysOjY6JqZo2Ouj2Hf/Azlpzdf1BW+Rczl0t63UCeoS1yVZe3v3DLiQIA=="));
    }

# 自动配置

  1. 编码流程
    1. 在编写好其他模块之后,将其他模块的依赖引入
      1. 设置该模块的<optional>true</optional>
    2. 创建自动配置类
      1. 包名 = 模块名
      2. 类名 = 模块名AutoConfiguration
    3. 编写XxxAutoConfiguration
      1. 启用条件
      2. 导入扫描类
    4. resources/META-INF/spring.factories文件的org.springframework.boot.autoconfigure.EnableAutoConfiguration属性下加入新写的自动配置类,并用逗号分隔
    5. 打包,发布

# 版本发布

  • 地址: jitpack.io
  • github上设置release

About

auto configuration base SpringBoot & SpringBoot starter & weChatMiniProgram & TencentCloud

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages