IdentifyController.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.ydtech.modules.order.controller;
  2. import com.ydtech.core.page.HttpResult;
  3. import com.ydtech.modules.order.entity.BusinessLicense;
  4. import com.ydtech.modules.order.service.IdentifyService;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.springframework.web.bind.annotation.PostMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import org.springframework.web.multipart.MultipartFile;
  12. import java.io.IOException;
  13. import java.util.Map;
  14. @RestController
  15. @RequestMapping("/order/identify")
  16. @Api(tags = "识别")
  17. @Slf4j
  18. public class IdentifyController {
  19. private final IdentifyService identifyService;
  20. public IdentifyController(IdentifyService identifyService) {
  21. this.identifyService = identifyService;
  22. }
  23. @PostMapping("/idCard")
  24. @ApiOperation(value = "身份证正反面识别")
  25. public HttpResult<Map<String, Object>> idCard(MultipartFile image1, MultipartFile image2) throws IOException {
  26. return identifyService.idCard(image1, image2);
  27. }
  28. @PostMapping("/drivingPermit")
  29. @ApiOperation(value = "行驶证正反面识别")
  30. public HttpResult<Map<String, Object>> drivingPermit(MultipartFile image1, MultipartFile image2) throws IOException {
  31. return identifyService.drivingPermit(image1, image2);
  32. }
  33. @PostMapping("/businessLicense")
  34. @ApiOperation(value = "营业执照识别")
  35. public HttpResult<BusinessLicense> businessLicense(MultipartFile image1) {
  36. return identifyService.businessLicense(image1);
  37. }
  38. }