Commit b641d4d3 by xmh

1

1 parent e4494cd1
package com.viontech.match.controller;
import com.viontech.keliu.model.FaceFeature;
import com.viontech.keliu.model.Person;
import com.viontech.match.entity.vo.RequestVo;
import com.viontech.match.entity.vo.ResponseVo;
import com.viontech.match.service.PersonService;
import com.viontech.match.service.PoolService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* .
......@@ -31,7 +35,7 @@ public class MainController {
@PostMapping
public ResponseVo all(@RequestBody RequestVo requestVo) throws Exception {
String rid = requestVo.getRid();
try{
try {
switch (requestVo.getCommand()) {
case AddPersonPool:
return poolService.createPool(requestVo);
......@@ -48,9 +52,18 @@ public class MainController {
default:
return ResponseVo.commandNotFound(rid);
}
}catch(Exception e){
log.error("",e);
} catch (Exception e) {
log.error("", e);
return ResponseVo.error(rid, e.getMessage());
}
}
@GetMapping("/pools")
public Object getPools() {
try {
return poolService.queryPoolInfo(null);
} catch (IOException e) {
return ResponseVo.error("error", e.getMessage());
}
}
}
......@@ -85,7 +85,9 @@ public class PersonService {
poolStatus.add(pool);
}
ResponseVo success = ResponseVo.success(rid, "success");
success.setMatchPersons(result);
if (result.size() > 0) {
success.setMatchPersons(result);
}
success.setMatch(1);
success.setPersonPoolStatus(poolStatus);
log.info("人员匹配操作完成,PoolIds:[{}},结果:[{}]", poolIds.toString(), objectMapper.writeValueAsString(success));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!