merge
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.xwbing.demo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/23 14:45
|
||||
* 作者: xiangwb
|
||||
* 说明: 测试用
|
||||
*/
|
||||
public class Ademo {
|
||||
public static void main(String[] args) {
|
||||
List<Integer> integers = new ArrayList<>();
|
||||
for (int i = 0; i < 1000000; i++) {
|
||||
integers.add(i);
|
||||
}
|
||||
long l = System.currentTimeMillis();
|
||||
integers.forEach(integer -> {
|
||||
int i = integer * 2;
|
||||
});
|
||||
long l1 = System.currentTimeMillis();
|
||||
System.out.println(l1-l);
|
||||
long l3 = System.currentTimeMillis();
|
||||
integers.parallelStream().forEach(integer -> {
|
||||
int i = integer * 2;
|
||||
});
|
||||
long l4 = System.currentTimeMillis();
|
||||
System.out.println(l4-l3);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: xiangwb
|
||||
* 说明: FileUploadDemo
|
||||
* 说明: FileUpload
|
||||
*/
|
||||
@Service
|
||||
public class FileUploadDemo {
|
||||
@@ -62,7 +62,7 @@ public class FileUploadDemo {
|
||||
ClassPathResource file = new ClassPathResource("file");
|
||||
try {
|
||||
String path = file.getFile().getAbsolutePath();
|
||||
File targetFile = new File(path+ File.separator+ File.separator+name);
|
||||
File targetFile = new File(path+ File.separator+name);
|
||||
if (!targetFile.exists()) {
|
||||
targetFile.createNewFile();
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class FileUploadDemo {
|
||||
public static void main(String[] args) throws Exception{
|
||||
ClassPathResource file = new ClassPathResource("file");
|
||||
String path = file.getFile().getAbsolutePath();
|
||||
File targetFile = new File(path+ File.separator+ File.separator+"test.txt");
|
||||
File targetFile = new File(path+ File.separator+"test.txt");
|
||||
if(!targetFile.exists()){
|
||||
targetFile.createNewFile(); //创建文件
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* Date: 2017/6/15 17:09
|
||||
* Author: xiangwb
|
||||
* 说明: 纯遍历list.forEach/需要collect用parallelStream
|
||||
*/
|
||||
public class LambdaDemo {
|
||||
@Resource
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.xwbing.demo;
|
||||
|
||||
import com.xwbing.domain.entity.sys.SysUser;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 项目名称: boot-module-demo
|
||||
* 创建时间: 2018/1/23 14:45
|
||||
* 作者: xiangwb
|
||||
* 说明: 测试用
|
||||
*/
|
||||
public class demo {
|
||||
public static void main(String[] args) {
|
||||
SysUser sysUser=new SysUser();
|
||||
Map<String, Object> stringObjectHashMap = new HashMap<>();
|
||||
Object o = stringObjectHashMap.get(sysUser.getAdmin());
|
||||
System.out.println("");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@
|
||||
<!-- 自动追加日志信息到文件中,直至文件达到预定的大小,然后自动重新生成另外一个文件来记录之后的日志-->
|
||||
<!-- 设置日志格式并配置回滚日志压缩格式(error.log.年份.gz) -->
|
||||
<RollingRandomAccessFile name="error_appender"
|
||||
immediateFlush="true" fileName="${LOG_HOME}/error.log"
|
||||
immediateFlush="false" fileName="${LOG_HOME}/error.log"
|
||||
filePattern="${LOG_HOME}/error.%d{yyyy-MM-dd}.log.gz">
|
||||
<ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout>
|
||||
@@ -49,7 +49,7 @@
|
||||
</RollingRandomAccessFile>
|
||||
<!-- info.log-->
|
||||
<RollingRandomAccessFile name="info_appender"
|
||||
immediateFlush="true" fileName="${LOG_HOME}/info.log"
|
||||
immediateFlush="false" fileName="${LOG_HOME}/info.log"
|
||||
filePattern="${LOG_HOME}/info.%d{yyyy-MM-dd}.log.gz">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout>
|
||||
|
||||
Reference in New Issue
Block a user