|
@@ -2,6 +2,7 @@ package com.jjt.biz.controller;
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.jjt.biz.service.IApiYrService;
|
|
|
+import com.jjt.biz.vo.YrCompareReq;
|
|
|
import com.jjt.biz.vo.YrTwinVO;
|
|
|
import com.jjt.common.constant.CacheConstants;
|
|
|
import com.jjt.common.core.controller.BaseController;
|
|
@@ -11,14 +12,12 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Paths;
|
|
|
-import java.time.LocalDateTime;
|
|
|
|
|
|
/**
|
|
|
* swagger 用户测试方法
|
|
@@ -46,10 +45,10 @@ public class ApiYrController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation("染整线数AI比对")
|
|
|
- @GetMapping("/api/yr/compare")
|
|
|
+ @RequestMapping("/api/yr/compare")
|
|
|
@CrossOrigin(origins = "*")
|
|
|
@ResponseBody
|
|
|
- public R<?> compare(@RequestParam("line1") Integer line1, @RequestParam("line1") Integer line2, @RequestParam("time1") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime time1, @RequestParam("time2") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime time2) throws IOException {
|
|
|
+ public R<?> compare(@RequestBody YrCompareReq vo) throws IOException {
|
|
|
String str = new String(Files.readAllBytes(Paths.get(path)));
|
|
|
return R.ok(JSONUtil.parseArray(str));
|
|
|
}
|