|
| 1 | +package cn.mysdp.aop; |
| 2 | + |
| 3 | +import cn.mysdp.biz.dto.request.BaseRequest; |
| 4 | +import cn.mysdp.http.SDPHttpResponse; |
| 5 | +import cn.mysdp.http.SDPHttpResult; |
| 6 | +import com.alibaba.fastjson.JSON; |
| 7 | +import com.alibaba.fastjson.JSONObject; |
| 8 | +import org.aspectj.lang.JoinPoint; |
| 9 | +import org.aspectj.lang.ProceedingJoinPoint; |
| 10 | +import org.aspectj.lang.annotation.AfterReturning; |
| 11 | +import org.aspectj.lang.annotation.Around; |
| 12 | +import org.aspectj.lang.annotation.Aspect; |
| 13 | +import org.aspectj.lang.annotation.Pointcut; |
| 14 | +import org.springframework.beans.factory.annotation.Value; |
| 15 | +import org.springframework.boot.ApplicationArguments; |
| 16 | +import org.springframework.boot.ApplicationRunner; |
| 17 | +import org.springframework.core.annotation.Order; |
| 18 | +import org.springframework.stereotype.Component; |
| 19 | +import org.springframework.web.context.request.RequestContextHolder; |
| 20 | +import org.springframework.web.context.request.ServletRequestAttributes; |
| 21 | +import org.springframework.web.multipart.MultipartFile; |
| 22 | +import org.springframework.web.servlet.mvc.method.annotation.ExtendedServletRequestDataBinder; |
| 23 | + |
| 24 | +import javax.servlet.ServletOutputStream; |
| 25 | +import javax.servlet.ServletRequest; |
| 26 | +import javax.servlet.ServletResponse; |
| 27 | +import javax.servlet.http.HttpServletRequest; |
| 28 | +import javax.servlet.http.HttpServletResponse; |
| 29 | +import java.util.Set; |
| 30 | +import java.util.TreeSet; |
| 31 | + |
| 32 | +/** |
| 33 | + * @ClassName: |
| 34 | + * @Description: |
| 35 | + * @Author: SDP |
| 36 | + * @Date: 2020-10-30 |
| 37 | + * Table: |
| 38 | + * Comment: |
| 39 | + */ |
| 40 | +@Component |
| 41 | +public class GlobalApplicationRunner implements ApplicationRunner { |
| 42 | + @Value("${server.port}") |
| 43 | + String serverPort; |
| 44 | + |
| 45 | + @Value("${spring.datasource.url}") |
| 46 | + String datasourceUrl; |
| 47 | + |
| 48 | + @Override |
| 49 | + public void run(ApplicationArguments applicationArguments) throws Exception { |
| 50 | + String db = datasourceUrl.split(";")[0]; |
| 51 | + db = db.split(":")[db.split(":").length - 1]; |
| 52 | + System.err.println("------------------------------------------------------------------------"); |
| 53 | + System.err.println("Welcome to SDP's world via the following URL:"); |
| 54 | + System.err.println(""); |
| 55 | + System.err.println(" http://localhost:"+serverPort); |
| 56 | + System.err.println(""); |
| 57 | + System.err.println("Browse http://localhost:"+serverPort+"/db to view the database."); |
| 58 | + System.err.println("Access https://github.com/BrookYuGit/sdp to get the lastest source code."); |
| 59 | + System.err.println(""); |
| 60 | + System.err.println("Datasource is "+datasourceUrl); |
| 61 | + System.err.println("Database file is "+db+"/sdp.mv.db"); |
| 62 | + System.err.println("------------------------------------------------------------------------"); |
| 63 | + } |
| 64 | +} |
0 commit comments