添加投注定时器脚本
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
package com.tem.bocai.controller;
|
||||
|
||||
import com.tem.bocai.entity.LotteryResult;
|
||||
import com.tem.bocai.repository.LotteryResultRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/lottery")
|
||||
public class LotteryResultController {
|
||||
|
||||
@Autowired
|
||||
private LotteryResultRepository lotteryResultRepository;
|
||||
|
||||
// 获取所有彩票开奖结果
|
||||
@GetMapping("/results")
|
||||
public List<LotteryResult> getAllLotteryResults() {
|
||||
return lotteryResultRepository.findAll();
|
||||
}
|
||||
|
||||
// 根据期号获取彩票开奖结果
|
||||
@GetMapping("/results/{issue}")
|
||||
public LotteryResult getLotteryResultByIssue(@PathVariable String issue) {
|
||||
return lotteryResultRepository.findAll()
|
||||
.stream()
|
||||
.filter(result -> result.getIssue().equals(issue))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.tem.bocai.controller;
|
||||
|
||||
import com.tem.bocai.util.ImageOcrService;
|
||||
import net.sourceforge.tess4j.TesseractException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
public class TestController {
|
||||
|
||||
|
||||
private final ImageOcrService imageOcrService;
|
||||
|
||||
@Autowired
|
||||
public TestController(ImageOcrService imageOcrService) {
|
||||
|
||||
this.imageOcrService = imageOcrService;
|
||||
}
|
||||
|
||||
@GetMapping("/ocr/local")
|
||||
public ResponseEntity<String> ocrLocalImage(String imagePath) throws IOException, TesseractException {
|
||||
imagePath = "b.jpg";
|
||||
String result = imageOcrService.ocrLocalImage(imagePath);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
@GetMapping("/ocr/remote")
|
||||
public ResponseEntity<String> ocrRemoteImage(String imageUrl) throws IOException, TesseractException, InterruptedException {
|
||||
imageUrl = "https://4701268539-esh.qdk63ayw8g.com/code";
|
||||
String result = imageOcrService.ocrRemoteImage();
|
||||
System.out.println("++++"+result);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user