51 lines
1.4 KiB
Java
51 lines
1.4 KiB
Java
package com.dpkj.modules.cardReader.controller;
|
|
|
|
import com.dpkj.common.vo.Result;
|
|
import com.dpkj.modules.cardReader.service.CardReaderService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
/**
|
|
* 多合一读卡器
|
|
*/
|
|
@Slf4j
|
|
@RestController
|
|
@RequestMapping("readCard")
|
|
public class CardReaderController {
|
|
@Autowired
|
|
private CardReaderService cardReaderService;
|
|
|
|
/**
|
|
* 连接设备并读取身份证信息
|
|
* @return
|
|
*/
|
|
@PostMapping("IDCardReader")
|
|
public Result IDCardReader() {
|
|
try {
|
|
return cardReaderService.IDCardReader();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
log.info("设备连接失败 {}", e.getMessage());
|
|
return Result.error("设备连接失败");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* 连接设备并读取社保卡信息
|
|
* @return
|
|
*/
|
|
@PostMapping("SocialSecurityCardReader")
|
|
public Result<?> SocialSecurityCardReader() {
|
|
try {
|
|
return cardReaderService.SocialSecurityCardReader();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
log.info("连接设备并读取社保卡信息失败 {}", e.getMessage());
|
|
return Result.error("连接设备并读取社保卡信息失败");
|
|
}
|
|
}
|
|
|
|
}
|