From 2f737df6f8e482540a465445bdb003d98103db54 Mon Sep 17 00:00:00 2001 From: linzhijie <19970921lzj> Date: 星期一, 12 四月 2021 23:41:17 +0800 Subject: [PATCH] 第二次无注释的源码 --- src/main/java/com/ots/OtsApplication.java | 26 +------------------------- 1 files changed, 1 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/ots/OtsApplication.java b/src/main/java/com/ots/OtsApplication.java index 37c99c0..c74e789 100644 --- a/src/main/java/com/ots/OtsApplication.java +++ b/src/main/java/com/ots/OtsApplication.java @@ -1,28 +1,10 @@ package com.ots; -import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; -import org.jasypt.encryption.StringEncryptor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.context.ApplicationContext; -import org.springframework.core.env.Environment; @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) -@EnableEncryptableProperties -public class OtsApplication implements CommandLineRunner { - - private static final Logger l = LoggerFactory.getLogger(OtsApplication.class); - - @Autowired - private StringEncryptor stringEncryptor; - - @Autowired - private ApplicationContext applicationContext; - +public class OtsApplication { public static void main(String[] args) { SpringApplication.run(OtsApplication.class, args); @@ -34,11 +16,5 @@ builder.append("** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **\n"); builder.append("********************************************************************\n"); System.out.println(builder.toString()); - } - - @Override - public void run(String... args) throws Exception { - Environment environment = applicationContext.getEnvironment(); - l.info(stringEncryptor.encrypt(environment.getProperty("password"))); } } -- Gitblit v1.9.1