From 4aea8058dd7c176428a8fef8c3e5882a0dba1b3c Mon Sep 17 00:00:00 2001 From: zhaowenxuan <chacca165@163.com> Date: 星期一, 15 七月 2024 11:26:48 +0800 Subject: [PATCH] 增加返回已拥有的所有字典 --- src/main/java/com/example/scheudleds/DictSync.java | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/example/scheudleds/DictSync.java b/src/main/java/com/example/scheudleds/DictSync.java index 96f1800..5de19a9 100644 --- a/src/main/java/com/example/scheudleds/DictSync.java +++ b/src/main/java/com/example/scheudleds/DictSync.java @@ -1,6 +1,7 @@ package com.example.scheudleds; import com.example.utils.DictionaryUtil; +import com.example.utils.DictionaryUtilNew; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -9,6 +10,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.io.FileWriter; import java.io.IOException; @Slf4j @@ -17,17 +19,26 @@ public class DictSync { @Autowired private DictionaryUtil dictionaryUtil; + @Autowired + private DictionaryUtilNew dictionaryUtilNew; /** * 瀛楀吀鍚屾 */ @Scheduled(cron = "0 0 22 * * ? ") public void execDict(){ + FileWriter fileWriter = null; try { - dictionaryUtil.exec1(); - } catch (IOException e) { - log.error("瀹氭椂浠诲姟寮傚父"); - e.printStackTrace(); - } + fileWriter = new FileWriter("src/main/resources/log.log"); + fileWriter.write(""); + fileWriter.close(); + } catch (IOException ignored) {} +// try { +// dictionaryUtil.exec1(); +// } catch (IOException e) { +// log.error("瀹氭椂浠诲姟寮傚父"); +// e.printStackTrace(); +// } + dictionaryUtilNew.exec1(); } } -- Gitblit v1.8.0