Commit fe8b17dd by 雷紫添

添加测试

parent 9bbbab2e
...@@ -3,8 +3,10 @@ package com.founder; ...@@ -3,8 +3,10 @@ package com.founder;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication @SpringBootApplication
@EnableAsync
@ComponentScan(basePackages = {"com.founder.*"}) @ComponentScan(basePackages = {"com.founder.*"})
public class Application { public class Application {
......
...@@ -23,9 +23,14 @@ import java.util.List; ...@@ -23,9 +23,14 @@ import java.util.List;
import java.util.Map; import java.util.Map;
@RestController @RestController
public class FaceController { public class FaceController {
@Autowired
private FaceService faceService;
@ResponseBody @ResponseBody
@RequestMapping("/query") @RequestMapping("/query")
public String query() { public String query() {
System.out.println("1111111111111111111");
faceService.sync();;
System.out.println("33333333333333333");
/* List<Face> face = faceService.query(); /* List<Face> face = faceService.query();
for (Map<String, String> item : codeMsg.getStatus()) { for (Map<String, String> item : codeMsg.getStatus()) {
if (item.get("code").equals("001")) if (item.get("code").equals("001"))
...@@ -36,7 +41,7 @@ public class FaceController { ...@@ -36,7 +41,7 @@ public class FaceController {
System.out.println(item.get("name")); System.out.println(item.get("name"));
} }
});*/ });*/
final Base64.Decoder decoder = Base64.getDecoder(); /* final Base64.Decoder decoder = Base64.getDecoder();
final Base64.Encoder encoder = Base64.getEncoder(); final Base64.Encoder encoder = Base64.getEncoder();
Jccj jccj =new Jccj(); Jccj jccj =new Jccj();
try { try {
...@@ -66,7 +71,7 @@ public class FaceController { ...@@ -66,7 +71,7 @@ public class FaceController {
System.out.println("返回的参数为::"+jsonResult.toJSONString()); System.out.println("返回的参数为::"+jsonResult.toJSONString());
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }*/
return "已执行"; return "已执行";
} }
......
...@@ -2,6 +2,7 @@ package com.founder.service; ...@@ -2,6 +2,7 @@ package com.founder.service;
import com.founder.model.Face; import com.founder.model.Face;
import org.springframework.scheduling.annotation.Async;
import java.util.List; import java.util.List;
...@@ -10,4 +11,6 @@ import java.util.List; ...@@ -10,4 +11,6 @@ import java.util.List;
*/ */
public interface FaceService { public interface FaceService {
public List<Face> query(); public List<Face> query();
@Async
public void sync();
} }
...@@ -21,4 +21,9 @@ public class FaceServiceImpl implements FaceService { ...@@ -21,4 +21,9 @@ public class FaceServiceImpl implements FaceService {
List<Face> face = faceDao.query(); List<Face> face = faceDao.query();
return face; return face;
} }
@Override
public void sync() {
System.out.println("22222222222222");
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment