10 changed files with 123 additions and 30 deletions
@ -0,0 +1,35 @@ |
|||||
|
package com.userinformation.backend.controller; |
||||
|
|
||||
|
import com.fasterxml.jackson.core.type.TypeReference; |
||||
|
import com.fasterxml.jackson.databind.ObjectMapper; |
||||
|
import com.userinformation.backend.model.dto.DepartResult; |
||||
|
import com.userinformation.backend.model.dto.TestResult; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.io.IOException; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author: xiaowuler |
||||
|
* @createTime: 2022-05-17 17:00 |
||||
|
* @describe: 测试控制层 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("test") |
||||
|
public class TestController { |
||||
|
|
||||
|
private ObjectMapper objectMapper = new ObjectMapper(); |
||||
|
|
||||
|
@RequestMapping("test") |
||||
|
public Object test() throws IOException { |
||||
|
TestResult<List<DepartResult>> testResult = objectMapper.readValue(new File("C:\\Users\\xiaowuler\\Desktop\\data.txt"), new TypeReference<TestResult<List<DepartResult>>>() { |
||||
|
}); |
||||
|
|
||||
|
while (testResult.getData().size() < 1000000){ |
||||
|
testResult.getData().addAll(testResult.getData()); |
||||
|
} |
||||
|
return testResult; |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.userinformation.backend.model.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author: xiaowuler |
||||
|
* @createTime: 2022-05-17 17:08 |
||||
|
* @describe: 是 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class DepartResult { |
||||
|
private String id; |
||||
|
private String gslx; |
||||
|
private String name; |
||||
|
private String title; |
||||
|
private String bjid; |
||||
|
private String type; |
||||
|
private String open; |
||||
|
private String iconSkin; |
||||
|
private String para; |
||||
|
private String nocheck; |
||||
|
private String pid; |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.userinformation.backend.model.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author: xiaowuler |
||||
|
* @createTime: 2022-05-17 17:07 |
||||
|
* @describe: 测试 结果 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TestResult<T> { |
||||
|
private String msg; |
||||
|
private int code; |
||||
|
private T data; |
||||
|
} |
Loading…
Reference in new issue