61 lines
1.6 KiB
Java
61 lines
1.6 KiB
Java
package com.aos.fileidentify.controller;
|
|
|
|
import com.aos.fileidentify.service.FileIdentifyService;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestPart;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.AllArgsConstructor;
|
|
|
|
/**
|
|
* <p>Company: 成都返空汇网络技术有限公司</p>
|
|
* <p>Description: </p>
|
|
*
|
|
* @author yangjiyu
|
|
* @version x.x.x
|
|
* @email "mailto:yangjiyu@fkhwl.com"
|
|
* @date 2022.07.04 09:53
|
|
* @since x.x.x
|
|
*/
|
|
@Api(value = "PDF文件上传识别服务")
|
|
@RestController
|
|
@RequestMapping(value = "/fileIdentify")
|
|
@AllArgsConstructor
|
|
public class FileIdentifyController {
|
|
|
|
/** File identify service */
|
|
private final FileIdentifyService fileIdentifyService;
|
|
|
|
|
|
/**
|
|
* Identify pdf
|
|
*
|
|
* @param file file
|
|
* @since 0.0.1
|
|
*/
|
|
@ApiOperation(value = "pdf文件解析服务")
|
|
@PostMapping(value = "/pdf")
|
|
public void identifyPdf(@RequestPart("pdf") MultipartFile file) {
|
|
this.fileIdentifyService.processPdf(file);
|
|
}
|
|
|
|
|
|
/**
|
|
* Identify excel
|
|
*
|
|
* @param file file
|
|
* @since 0.0.1
|
|
*/
|
|
@ApiOperation(value = "excel文件解析服务")
|
|
@PostMapping(value = "/excel")
|
|
public void identifyExcel(@RequestPart("excel") MultipartFile file) {
|
|
this.fileIdentifyService.processExcel(file);
|
|
}
|
|
|
|
}
|