|
|
|
@@ -12,6 +12,8 @@ import com.xueyi.system.api.pass.feign.RemoteRecognizedRecordsService; |
|
|
|
import com.xueyi.system.pass.mapper.DmRecognizedRecordsMapper; |
|
|
|
import com.xueyi.system.pass.service.impl.DmRecognizedRecordsServiceImpl; |
|
|
|
import com.xueyi.system.resource.controller.api.BaseApiController; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
@@ -30,7 +32,7 @@ import java.util.List; |
|
|
|
@RestController |
|
|
|
@RequestMapping("/pass/api") |
|
|
|
public class DmRecognizedRecordsApiController extends BaseApiController { |
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(DmRecognizedRecordsApiController.class); |
|
|
|
@Autowired |
|
|
|
private RemoteRecognizedRecordsService recognizedRecordsFeign; |
|
|
|
|
|
|
|
@@ -40,15 +42,17 @@ public class DmRecognizedRecordsApiController extends BaseApiController { |
|
|
|
@ResponseBody |
|
|
|
@PostMapping(value = "/upload-pass", produces = "application/json;charset=UTF-8") |
|
|
|
public JSONObject upload(@RequestBody DmRecognizedRecordsDto recognizedRecordsDto){ |
|
|
|
log.info("upload-pass devId={}", recognizedRecordsDto.getDevId()); |
|
|
|
DeviceTenantSourceMergeVo vo = super.getDeviceTenantSourceMergeVo(recognizedRecordsDto.getDevId()); |
|
|
|
|
|
|
|
recognizedRecordsService.setRedisRecognizedCount(1); |
|
|
|
|
|
|
|
return recognizedRecordsFeign.uploadPass(recognizedRecordsDto, vo.getTenantId(), vo.getSourceSlave(), SecurityConstants.INNER); |
|
|
|
} |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
@PostMapping(value = "/upload-multi-pass", produces = "application/json;charset=UTF-8") |
|
|
|
public JSONObject uploads(@RequestBody DmRecognizedMultiRecordsDto recognizedMultiRecordsDto){ |
|
|
|
log.info("upload-multi-pass devId={}", recognizedMultiRecordsDto.getDevId()); |
|
|
|
DeviceTenantSourceMergeVo vo = super.getDeviceTenantSourceMergeVo(recognizedMultiRecordsDto.getDevId()); |
|
|
|
if (recognizedMultiRecordsDto.getRecords().size() > 0) |
|
|
|
recognizedRecordsService.setRedisRecognizedCount(recognizedMultiRecordsDto.getRecords().size()); |
|
|
|
|