You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.7 KiB
71 lines
2.7 KiB
package com.cweb.controller;
|
|
|
|
import com.hfkj.common.security.UserCenter;
|
|
import com.hfkj.common.utils.ResponseMsgUtil;
|
|
import com.hfkj.model.ResponseData;
|
|
import com.hfkj.common.ocr.AliYunOcrService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
@Controller
|
|
@RequestMapping(value = "/ocr")
|
|
@Api(value = "ocr识别")
|
|
public class OcrController {
|
|
|
|
private static Logger log = LoggerFactory.getLogger(OcrController.class);
|
|
|
|
@RequestMapping(value="/recognizeIdCard",method = RequestMethod.GET)
|
|
@ResponseBody
|
|
@ApiOperation(value = "身份证识别")
|
|
public ResponseData recognizeIdCard(@RequestParam(name = "url", required = true) String url) {
|
|
try {
|
|
return ResponseMsgUtil.success(AliYunOcrService.recognizeIdCard(url));
|
|
} catch (Exception e) {
|
|
log.error("recognizeIdCard error!",e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
@RequestMapping(value="/recognizeBankCard",method = RequestMethod.GET)
|
|
@ResponseBody
|
|
@ApiOperation(value = "银行卡识别")
|
|
public ResponseData recognizeBankCard(@RequestParam(name = "url", required = true) String url) {
|
|
try {
|
|
return ResponseMsgUtil.success(AliYunOcrService.recognizeBankCard(url));
|
|
} catch (Exception e) {
|
|
log.error("recognizeBankCard error!",e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
@RequestMapping(value="/recognizeBankAccount",method = RequestMethod.GET)
|
|
@ResponseBody
|
|
@ApiOperation(value = "银行开户许可证识别")
|
|
public ResponseData recognizeBankAccount(@RequestParam(name = "url", required = true) String url) {
|
|
try {
|
|
return ResponseMsgUtil.success(AliYunOcrService.recognizeBankAccount(url));
|
|
} catch (Exception e) {
|
|
log.error("recognizeBankCard error!",e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
|
|
@RequestMapping(value="/recognizeBusinessLicense",method = RequestMethod.GET)
|
|
@ResponseBody
|
|
@ApiOperation(value = "营业执照识别")
|
|
public ResponseData recognizeBusinessLicense(@RequestParam(name = "url", required = true) String url) {
|
|
try {
|
|
return ResponseMsgUtil.success(AliYunOcrService.recognizeBusinessLicense(url));
|
|
} catch (Exception e) {
|
|
log.error("recognizeBusinessLicense error!",e);
|
|
return ResponseMsgUtil.exception(e);
|
|
}
|
|
}
|
|
}
|
|
|