Bladeren bron

删掉多余代码(等待spring完成api)

zhenghao 4 maanden geleden
bovenliggende
commit
aeddd82ff0
36 gewijzigde bestanden met toevoegingen van 96 en 109 verwijderingen
  1. 1 1
      src/main/java/cn/jlsxwkj/common/R/ResponseError.java
  2. 1 1
      src/main/java/cn/jlsxwkj/common/R/ResponseSucceed.java
  3. 1 1
      src/main/java/cn/jlsxwkj/common/config/SaTokenConfig.java
  4. 1 1
      src/main/java/cn/jlsxwkj/common/exception/AccountAuthFailException.java
  5. 1 1
      src/main/java/cn/jlsxwkj/common/exception/AccountPasswordCheckFailException.java
  6. 1 1
      src/main/java/cn/jlsxwkj/common/exception/CustomException.java
  7. 1 1
      src/main/java/cn/jlsxwkj/common/exception/FileDeleteFailException.java
  8. 1 1
      src/main/java/cn/jlsxwkj/common/exception/FileTypeDoesNotSupportException.java
  9. 1 1
      src/main/java/cn/jlsxwkj/common/exception/InsertFailException.java
  10. 1 1
      src/main/java/cn/jlsxwkj/common/exception/LoginAccountAlreadyLoginException.java
  11. 1 1
      src/main/java/cn/jlsxwkj/common/exception/LoginWrongPasswordException.java
  12. 1 1
      src/main/java/cn/jlsxwkj/common/exception/NotContentInFileException.java
  13. 1 1
      src/main/java/cn/jlsxwkj/common/exception/OpenFileFailException.java
  14. 1 1
      src/main/java/cn/jlsxwkj/common/exception/TooManyRequestsException.java
  15. 1 1
      src/main/java/cn/jlsxwkj/common/exception/UnknownException.java
  16. 3 4
      src/main/java/cn/jlsxwkj/common/filter/ExecTimeFilter.java
  17. 3 4
      src/main/java/cn/jlsxwkj/common/filter/RateLimiterFilter.java
  18. 1 1
      src/main/java/cn/jlsxwkj/common/handler/GlobalRestExceptionHandler.java
  19. 8 10
      src/main/java/cn/jlsxwkj/common/handler/ResultResponseHandler.java
  20. 5 5
      src/main/java/cn/jlsxwkj/common/reader/ParagraphDocReader.java
  21. 4 4
      src/main/java/cn/jlsxwkj/common/reader/ParagraphOcrReader.java
  22. 3 3
      src/main/java/cn/jlsxwkj/common/reader/ParagraphTextReader.java
  23. 4 6
      src/main/java/cn/jlsxwkj/common/utils/CheckPassword.java
  24. 5 5
      src/main/java/cn/jlsxwkj/common/utils/FileType.java
  25. 10 10
      src/main/java/cn/jlsxwkj/common/utils/Log.java
  26. 1 2
      src/main/java/cn/jlsxwkj/common/utils/MergeDocuments.java
  27. 7 8
      src/main/java/cn/jlsxwkj/common/utils/SplitDocument.java
  28. 5 6
      src/main/java/cn/jlsxwkj/moudles/chat/ChatController.java
  29. 10 12
      src/main/java/cn/jlsxwkj/moudles/chat/ChatService.java
  30. 3 3
      src/main/java/cn/jlsxwkj/moudles/chat_history/ChatHistoryService.java
  31. 1 1
      src/main/java/cn/jlsxwkj/moudles/chat_history/ChatHistoryVO.java
  32. 1 1
      src/main/java/cn/jlsxwkj/moudles/log_error/LogErrorService.java
  33. 2 3
      src/main/java/cn/jlsxwkj/moudles/user_list/UserListController.java
  34. 2 3
      src/main/java/cn/jlsxwkj/moudles/user_list/UserListService.java
  35. 2 2
      src/main/java/cn/jlsxwkj/moudles/user_list/UserVO.java
  36. 1 1
      src/main/java/cn/jlsxwkj/moudles/weather_demo/WeatherService.java

+ 1 - 1
src/main/java/cn/jlsxwkj/common/R/ResponseError.java

@@ -28,7 +28,7 @@ public class ResponseError extends Response {
      * @param exception 异常名称
      * @return 封装后的异常对象
      */
-    public static ResponseError data(final String exception) {
+    public static ResponseError data(String exception) {
         ResponseError r = new ResponseError();
         r.setCode(ERROR_CODE);
         r.setMessage("服务器异常");

+ 1 - 1
src/main/java/cn/jlsxwkj/common/R/ResponseSucceed.java

@@ -24,7 +24,7 @@ public class ResponseSucceed extends Response {
      * @param data 数据
      * @return 返回响应成功对象
      */
-    public static ResponseSucceed data(final Object data) {
+    public static ResponseSucceed data(Object data) {
         ResponseSucceed r = new ResponseSucceed();
         r.setCode(SUCCESS_CODE);
         r.setMessage("完成");

+ 1 - 1
src/main/java/cn/jlsxwkj/common/config/SaTokenConfig.java

@@ -20,7 +20,7 @@ public class SaTokenConfig implements WebMvcConfigurer {
      * @param registry 注册
      */
     @Override
-    public void addInterceptors(final InterceptorRegistry registry) {
+    public void addInterceptors(InterceptorRegistry registry) {
         registry.addInterceptor(new SaInterceptor(handler -> StpUtil.checkLogin()))
             .addPathPatterns("/**");
     }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/AccountAuthFailException.java

@@ -18,7 +18,7 @@ public class AccountAuthFailException extends CustomException {
     /**
      * @param message 消息
      */
-    public AccountAuthFailException(final String message) {
+    public AccountAuthFailException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/AccountPasswordCheckFailException.java

@@ -18,7 +18,7 @@ public class AccountPasswordCheckFailException extends CustomException {
     /**
      * @param message 消息
      */
-    public AccountPasswordCheckFailException(final String message) {
+    public AccountPasswordCheckFailException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/CustomException.java

@@ -10,7 +10,7 @@ public abstract class CustomException extends Exception {
     /**
      * @param message 消息
      */
-    public CustomException(final String message) {
+    public CustomException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/FileDeleteFailException.java

@@ -18,7 +18,7 @@ public class FileDeleteFailException extends CustomException {
     /**
      * @param message 消息
      */
-    public FileDeleteFailException(final String message) {
+    public FileDeleteFailException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/FileTypeDoesNotSupportException.java

@@ -18,7 +18,7 @@ public class FileTypeDoesNotSupportException extends CustomException {
     /**
      * @param message 消息
      */
-    public FileTypeDoesNotSupportException(final String message) {
+    public FileTypeDoesNotSupportException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/InsertFailException.java

@@ -17,7 +17,7 @@ public class InsertFailException extends CustomException {
     /**
      * @param message 消息
      */
-    public InsertFailException(final String message) {
+    public InsertFailException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/LoginAccountAlreadyLoginException.java

@@ -18,7 +18,7 @@ public class LoginAccountAlreadyLoginException extends CustomException {
     /**
      * @param message 消息
      */
-    public LoginAccountAlreadyLoginException(final String message) {
+    public LoginAccountAlreadyLoginException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/LoginWrongPasswordException.java

@@ -18,7 +18,7 @@ public class LoginWrongPasswordException extends CustomException {
     /**
      * @param message 消息
      */
-    public LoginWrongPasswordException(final String message) {
+    public LoginWrongPasswordException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/NotContentInFileException.java

@@ -18,7 +18,7 @@ public class NotContentInFileException extends CustomException {
     /**
      * @param message 消息
      */
-    public NotContentInFileException(final String message) {
+    public NotContentInFileException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/OpenFileFailException.java

@@ -9,7 +9,7 @@ public class OpenFileFailException extends CustomException {
     /**
      * @param message 消息
      */
-    public OpenFileFailException(final String message) {
+    public OpenFileFailException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/TooManyRequestsException.java

@@ -10,7 +10,7 @@ public class TooManyRequestsException extends CustomException {
     /**
      * @param message 消息
      */
-    public TooManyRequestsException(final String message) {
+    public TooManyRequestsException(String message) {
         super(message);
     }
 }

+ 1 - 1
src/main/java/cn/jlsxwkj/common/exception/UnknownException.java

@@ -17,7 +17,7 @@ public class UnknownException extends CustomException {
     /**
      * @param message 消息
      */
-    public UnknownException(final String message) {
+    public UnknownException(String message) {
         super(message);
     }
 }

+ 3 - 4
src/main/java/cn/jlsxwkj/common/filter/ExecTimeFilter.java

@@ -35,10 +35,9 @@ public class ExecTimeFilter implements Filter {
      * @throws ServletException ServletException
      */
     @Override
-    public void doFilter(
-        final ServletRequest servletRequest,
-        final ServletResponse servletResponse,
-        final FilterChain filterChain)
+    public void doFilter(ServletRequest servletRequest,
+                         ServletResponse servletResponse,
+                         FilterChain filterChain)
         throws IOException, ServletException {
         long startTime = System.currentTimeMillis();
         String url = ((HttpServletRequest) servletRequest).getRequestURL().toString();

+ 3 - 4
src/main/java/cn/jlsxwkj/common/filter/RateLimiterFilter.java

@@ -38,10 +38,9 @@ public class RateLimiterFilter implements Filter {
      * @throws ServletException ServletException
      */
     @Override
-    public void doFilter(
-        final ServletRequest request,
-        final ServletResponse response,
-        final FilterChain chain)
+    public void doFilter(ServletRequest request,
+                         ServletResponse response,
+                         FilterChain chain)
         throws IOException, ServletException {
         if (bucket.tryConsume(1)) {
             chain.doFilter(request, response);

+ 1 - 1
src/main/java/cn/jlsxwkj/common/handler/GlobalRestExceptionHandler.java

@@ -32,7 +32,7 @@ public class GlobalRestExceptionHandler {
      * @return 封装异常对象
      */
     @ExceptionHandler(Throwable.class)
-    public ResponseError exception(final Throwable e) {
+    public ResponseError exception(Throwable e) {
 
         ResponseError responseError =
             ResponseError.data(e.getClass().getName());

+ 8 - 10
src/main/java/cn/jlsxwkj/common/handler/ResultResponseHandler.java

@@ -32,9 +32,8 @@ public class ResultResponseHandler implements ResponseBodyAdvice<Object> {
      * @return boolean
      */
     @Override
-    public boolean supports(
-        @Nullable final MethodParameter methodParameter,
-        @Nullable final Class<? extends HttpMessageConverter<?>> aClass) {
+    public boolean supports(@Nullable MethodParameter methodParameter,
+                            @Nullable Class<? extends HttpMessageConverter<?>> aClass) {
         return true;
     }
 
@@ -50,13 +49,12 @@ public class ResultResponseHandler implements ResponseBodyAdvice<Object> {
      * @return Object
      */
     @Override
-    public Object beforeBodyWrite(
-        @Nullable final Object o,
-        @Nullable final MethodParameter methodParameter,
-        @Nullable final MediaType mediaType,
-        @Nullable final Class<? extends HttpMessageConverter<?>> aClass,
-        @Nullable final ServerHttpRequest serverHttpRequest,
-        @Nullable final ServerHttpResponse serverHttpResponse) {
+    public Object beforeBodyWrite(@Nullable Object o,
+                                  @Nullable MethodParameter methodParameter,
+                                  @Nullable MediaType mediaType,
+                                  @Nullable Class<? extends HttpMessageConverter<?>> aClass,
+                                  @Nullable ServerHttpRequest serverHttpRequest,
+                                  @Nullable ServerHttpResponse serverHttpResponse) {
         // 对请求的结果在这里统一返回和处理
         if (o instanceof ResponseError errorHandler) {
             // 1、如果返回的结果是一个异常的结果,就把异常返回的结构数据倒腾到R.fail里面即可

+ 5 - 5
src/main/java/cn/jlsxwkj/common/reader/ParagraphDocReader.java

@@ -60,12 +60,12 @@ public class ParagraphDocReader implements DocumentReader {
      * doc reader.
      *
      * @param bytes 文件数据
-     * @param name    文件名
-     * @param size    窗口大小
+     * @param name  文件名
+     * @param size  窗口大小
      */
-    public ParagraphDocReader(final byte[] bytes,
-                              final String name,
-                              final int size) {
+    public ParagraphDocReader(byte[] bytes,
+                              String name,
+                              int size) {
         this.textFormatter = ExtractedTextFormatter.defaults();
         this.parser = new AutoDetectParser();
         this.handler = new BodyContentHandler(-1);

+ 4 - 4
src/main/java/cn/jlsxwkj/common/reader/ParagraphOcrReader.java

@@ -48,10 +48,10 @@ public class ParagraphOcrReader implements DocumentReader {
      * @param url  ocr 地址
      * @param ws   窗口大小
      */
-    public ParagraphOcrReader(final byte[] file,
-                              final String name,
-                              final String url,
-                              final int ws) {
+    public ParagraphOcrReader(byte[] file,
+                              String name,
+                              String url,
+                              int ws) {
         this.bytes = file;
         this.windowSize = ws;
         this.cnocrUrl = url;

+ 3 - 3
src/main/java/cn/jlsxwkj/common/reader/ParagraphTextReader.java

@@ -46,9 +46,9 @@ public class ParagraphTextReader implements DocumentReader {
      * @param name 文件名
      * @param size 窗口大小
      */
-    public ParagraphTextReader(final byte[] file,
-                               final String name,
-                               final int size) {
+    public ParagraphTextReader(byte[] file,
+                               String name,
+                               int size) {
         this.inputStream = new ByteArrayInputStream(file);
         this.windowSize = size;
         this.fileName = name;

+ 4 - 6
src/main/java/cn/jlsxwkj/common/utils/CheckPassword.java

@@ -15,13 +15,11 @@ public final class CheckPassword {
     /**
      * 密码长度为8到20位,必须包含字母和数字,字母区分大小写.
      */
-    private static final String
-        REG_EX1 = "^(?=.*[0-9])(?=.*[a-zA-Z])(.{8,20})$";
+    private static final String REG_EX1 = "^(?=.*[0-9])(?=.*[a-zA-Z])(.{8,20})$";
     /**
      * 密码中必须包含字母、数字、特称字符,至少8个字符,最多16个字符.
      */
-    private static final String
-        REG_EX2 = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9])(.{8,16})$";
+    private static final String REG_EX2 = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9])(.{8,16})$";
 
     /**
      * 密码长度为8到20位,必须包含字母和数字,字母区分大小写.
@@ -29,7 +27,7 @@ public final class CheckPassword {
      * @param password 需要校验的密码
      * @return 返回校验结果
      */
-    public static boolean checkPassword(final String password) {
+    public static boolean checkPassword(String password) {
         Pattern passwordPattern = Pattern.compile(REG_EX1);
         Matcher matcher = passwordPattern.matcher(password);
         return matcher.matches();
@@ -42,7 +40,7 @@ public final class CheckPassword {
      * @return 返回校验结果
      */
     @SuppressWarnings("unused")
-    public static boolean password(final String password) {
+    public static boolean password(String password) {
         Pattern passwordPattern = Pattern.compile(REG_EX2);
         Matcher matcher = passwordPattern.matcher(password);
         return matcher.matches();

+ 5 - 5
src/main/java/cn/jlsxwkj/common/utils/FileType.java

@@ -27,10 +27,10 @@ public class FileType {
      * @param winSize  窗口大小
      * @param cnocrUrl ocr识别地址
      */
-    public FileType(final byte[] bytes,
-                    final String fileName,
-                    final int winSize,
-                    final String cnocrUrl) {
+    public FileType(byte[] bytes,
+                    String fileName,
+                    int winSize,
+                    String cnocrUrl) {
         TYPE.put("txt", new Tuple("文本", new ParagraphTextReader(bytes, fileName, winSize)));
         TYPE.put("doc docx", new Tuple("文档", new ParagraphDocReader(bytes, fileName, winSize)));
         TYPE.put("jpg png", new Tuple("图片", new ParagraphOcrReader(bytes, fileName, cnocrUrl, winSize)));
@@ -42,7 +42,7 @@ public class FileType {
      * @param fileType 文件类型
      * @return 返回存在的对象
      */
-    public Tuple getFileTypeAndResource(final String fileType) {
+    public Tuple getFileTypeAndResource(String fileType) {
         for (String s : TYPE.keySet()) {
             if (s.contains(fileType)) {
                 return TYPE.get(s);

+ 10 - 10
src/main/java/cn/jlsxwkj/common/utils/Log.java

@@ -26,9 +26,9 @@ public final class Log {
      * @param format 格式化或需要打印的字符串
      * @param args   格式化字符串需要的参数
      */
-    public static void info(final Class<?> clazz,
-                            final String format,
-                            final Object... args) {
+    public static void info(Class<?> clazz,
+                            String format,
+                            Object... args) {
         Slf4jLog log = getLogObj(clazz);
         log.info(format, args);
     }
@@ -40,9 +40,9 @@ public final class Log {
      * @param format 格式化或需要打印的字符串
      * @param args   格式化字符串需要的参数
      */
-    public static void warn(final Class<?> clazz,
-                            final String format,
-                            final Object... args) {
+    public static void warn(Class<?> clazz,
+                            String format,
+                            Object... args) {
         Slf4jLog log = getLogObj(clazz);
         log.warn(format, args);
     }
@@ -54,9 +54,9 @@ public final class Log {
      * @param format 格式化或需要打印的字符串
      * @param args   格式化字符串需要的参数
      */
-    public static void error(final Class<?> clazz,
-                             final String format,
-                             final Object... args) {
+    public static void error(Class<?> clazz,
+                             String format,
+                             Object... args) {
         Slf4jLog log = getLogObj(clazz);
         log.error(format, args);
     }
@@ -67,7 +67,7 @@ public final class Log {
      * @param clazz 需要打印的对象类
      * @return 返回 log 对象
      */
-    private static Slf4jLog getLogObj(final Class<?> clazz) {
+    private static Slf4jLog getLogObj(Class<?> clazz) {
         if (!CACHE_LOGS.containsKey(clazz.getName())) {
             CACHE_LOGS.put(clazz.getName(), new Slf4jLog(clazz));
         }

+ 1 - 2
src/main/java/cn/jlsxwkj/common/utils/MergeDocuments.java

@@ -24,8 +24,7 @@ public final class MergeDocuments {
      * @param documentList 文档列表
      * @return 合并后的文档列表
      */
-    public static List<Document> mergeDocuments(
-        final List<Document> documentList) {
+    public static List<Document> mergeDocuments(List<Document> documentList) {
         ArrayList<Document> mergeDocuments = new ArrayList<>();
         //根据文档来源进行分组
         for (var docListEntry : documentList.stream().collect(Collectors.groupingBy(document -> (String) document.getMetadata().get(SplitDocument.FILE_NAME))).entrySet()) {

+ 7 - 8
src/main/java/cn/jlsxwkj/common/utils/SplitDocument.java

@@ -38,10 +38,9 @@ public final class SplitDocument {
      * @param fileName   文件名
      * @return 多个文档
      */
-    public static List<Document> splitStringToListDocument(
-        final String document,
-        final int windowSize,
-        final String fileName) {
+    public static List<Document> splitStringToListDocument(String document,
+                                                           int windowSize,
+                                                           String fileName) {
         if (document.isBlank()) {
             return null;
         }
@@ -70,10 +69,10 @@ public final class SplitDocument {
      * @param endParagraphNum   结束段落编码
      * @return 文档信息
      */
-    private static Document toDocument(final List<String> paragraphList,
-                                       final String fileName,
-                                       final int startParagraphNum,
-                                       final int endParagraphNum) {
+    private static Document toDocument(List<String> paragraphList,
+                                       String fileName,
+                                       int startParagraphNum,
+                                       int endParagraphNum) {
         Document doc = new Document(String.join("\n", paragraphList));
         doc.getMetadata().put(FILE_NAME, fileName);
         doc.getMetadata().put(START_PARAGRAPH_NUMBER, startParagraphNum);

+ 5 - 6
src/main/java/cn/jlsxwkj/moudles/chat/ChatController.java

@@ -36,8 +36,7 @@ public class ChatController {
      */
     @PostMapping("/upload")
     @SaIgnore
-    public String uploadDoc(
-        @RequestBody final MultipartFile file) throws CustomException {
+    public String uploadDoc(@RequestBody MultipartFile file) throws CustomException {
         return chatService.uploadDocument(file);
     }
 
@@ -48,7 +47,7 @@ public class ChatController {
      * @return 结果
      */
     @PostMapping("/search")
-    public String searchDoc(@RequestParam final String keyword) {
+    public String searchDoc(@RequestParam String keyword) {
         return chatService.search(keyword);
     }
 
@@ -60,7 +59,7 @@ public class ChatController {
      */
     @PostMapping(value = "/chatStream",
         produces = {MediaType.TEXT_EVENT_STREAM_VALUE})
-    public Flux<String> chatStream(@RequestParam final String message) {
+    public Flux<String> chatStream(@RequestParam String message) {
         return chatService.chatStream(message);
     }
 
@@ -74,8 +73,8 @@ public class ChatController {
     @PostMapping(value = "/chatSummaryStream",
         produces = {MediaType.TEXT_EVENT_STREAM_VALUE})
     public Flux<String> chatSummaryStream(
-        @RequestParam(defaultValue = "帮我总结一下上面内容") final String message,
-        @RequestBody final MultipartFile file) {
+        @RequestParam(defaultValue = "帮我总结一下上面内容") String message,
+        @RequestBody MultipartFile file) {
         return chatService.chatSummaryStream(message, file);
     }
 }

+ 10 - 12
src/main/java/cn/jlsxwkj/moudles/chat/ChatService.java

@@ -87,8 +87,7 @@ public class ChatService {
      * @param file 保存的文件
      * @return 保存状态
      */
-    public String uploadDocument(
-        final MultipartFile file) throws CustomException {
+    public String uploadDocument(MultipartFile file) throws CustomException {
         Tuple supportFile = isSupportFile(file);
         File saveFile = supportFile.get(0);
         String fileName = supportFile.get(1);
@@ -114,7 +113,7 @@ public class ChatService {
      * @param keyword 关键词
      * @return 文本内容
      */
-    public String search(final String keyword) {
+    public String search(String keyword) {
         SearchRequest searchRequest = SearchRequest.query(keyword).withSimilarityThreshold(0.5);
         List<Document> documents = vectorStore.similaritySearch(searchRequest);
         return mergeDocuments(documents);
@@ -126,7 +125,7 @@ public class ChatService {
      * @param message 输入内容
      * @return 回答内容
      */
-    public Flux<String> chatStream(final String message) {
+    public Flux<String> chatStream(String message) {
         String context = search(message);
         Prompt prompt = new Prompt(List.of(
             new SystemMessage(userConfig.getSysMessage()),
@@ -167,8 +166,8 @@ public class ChatService {
      * @param file    文件
      * @return 内容总结
      */
-    public Flux<String> chatSummaryStream(final String message,
-                                          final MultipartFile file) {
+    public Flux<String> chatSummaryStream(String message,
+                                          MultipartFile file) {
         embeddingModel.embed("");
         Tuple supportFile;
         try {
@@ -194,7 +193,7 @@ public class ChatService {
      * @param documents 文档列表
      * @return 合并后的文档
      */
-    private String mergeDocuments(final List<Document> documents) {
+    private String mergeDocuments(List<Document> documents) {
         return MergeDocuments.mergeDocuments(documents).stream()
             .map(Document::getContent).collect(Collectors.joining("\n"));
     }
@@ -203,12 +202,12 @@ public class ChatService {
     /**
      * chat stream 封装.
      *
-     * @param userMessage 提问内容
+     * @param userMessage      提问内容
      * @param sysOrUserMessage 用户或系统提示词
      * @return flux
      */
-    private Flux<String> stream(final Message userMessage,
-                                final Message sysOrUserMessage) {
+    private Flux<String> stream(Message userMessage,
+                                Message sysOrUserMessage) {
         String userId = SaManager.getStpLogic("").getLoginIdAsString();
         StringBuilder chatMessage = new StringBuilder();
         return ollamaChatModel.stream(sysOrUserMessage, userMessage).map(response -> {
@@ -231,8 +230,7 @@ public class ChatService {
      * @param file 文件流
      * @return 元组
      */
-    private Tuple isSupportFile(
-        final MultipartFile file) throws CustomException {
+    private Tuple isSupportFile(MultipartFile file) throws CustomException {
         byte[] bytes;
         try {
             bytes = file.getBytes();

+ 3 - 3
src/main/java/cn/jlsxwkj/moudles/chat_history/ChatHistoryService.java

@@ -28,9 +28,9 @@ public class ChatHistoryService {
      * @throws InsertFailException 插入失败
      */
     @Transactional(rollbackFor = InsertFailException.class)
-    public void insert(final String userId,
-                       final String userQ,
-                       final String chatA) throws InsertFailException {
+    public void insert(String userId,
+                       String userQ,
+                       String chatA) throws InsertFailException {
         ChatHistory chatHistory = new ChatHistory();
         chatHistory.setUserId(userId);
         chatHistory.setUserQ(userQ);

+ 1 - 1
src/main/java/cn/jlsxwkj/moudles/chat_history/ChatHistoryVO.java

@@ -24,7 +24,7 @@ public class ChatHistoryVO {
      * @param chatHistory 历史消息
      * @return VO
      */
-    public static ChatHistoryVO cast(final ChatHistory chatHistory) {
+    public static ChatHistoryVO cast(ChatHistory chatHistory) {
         ChatHistoryVO chatHistoryVO = new ChatHistoryVO();
         chatHistoryVO.setUserId(chatHistory.getUserId());
         chatHistoryVO.setUserQ(chatHistory.getUserQ());

+ 1 - 1
src/main/java/cn/jlsxwkj/moudles/log_error/LogErrorService.java

@@ -24,7 +24,7 @@ public class LogErrorService {
      * @throws InsertFailException 插入失败
      */
     @Transactional(rollbackFor = InsertFailException.class)
-    public void insertOne(final Throwable e) throws InsertFailException {
+    public void insertOne(Throwable e) throws InsertFailException {
         LogError logError = new LogError();
         logError.setException(e.getClass().getName());
         logError.setMessage(e.getMessage());

+ 2 - 3
src/main/java/cn/jlsxwkj/moudles/user_list/UserListController.java

@@ -35,9 +35,8 @@ public class UserListController {
      */
     @PostMapping("/login")
     @SaIgnore
-    public UserVO login(
-        @RequestParam final String userName,
-        @RequestParam final String userPassword) throws CustomException {
+    public UserVO login(@RequestParam String userName,
+                        @RequestParam String userPassword) throws CustomException {
         return userListService.checkOrAddUser(userName, userPassword);
     }
 

+ 2 - 3
src/main/java/cn/jlsxwkj/moudles/user_list/UserListService.java

@@ -40,9 +40,8 @@ public class UserListService {
      * @throws CustomException CustomException
      */
     @Transactional(rollbackFor = AccountAuthFailException.class)
-    public UserVO checkOrAddUser(
-        final String userName,
-        final String userPassword) throws CustomException {
+    public UserVO checkOrAddUser(String userName,
+                                 String userPassword) throws CustomException {
         if (!CheckPassword.checkPassword(userPassword)) {
             throw new AccountPasswordCheckFailException("密码长度为8到20位,必须包含字母和数字,字母区分大小写");
         }

+ 2 - 2
src/main/java/cn/jlsxwkj/moudles/user_list/UserVO.java

@@ -25,8 +25,8 @@ public class UserVO {
      * @param message  消息
      * @return VO
      */
-    public static UserVO cast(final UserList userList,
-                              final String message) {
+    public static UserVO cast(UserList userList,
+                              String message) {
         UserVO userVO = new UserVO();
         userVO.setUserId(userList.getUserId());
         userVO.setUserName(userList.getUserName());

+ 1 - 1
src/main/java/cn/jlsxwkj/moudles/weather_demo/WeatherService.java

@@ -13,7 +13,7 @@ import java.util.function.Function;
 public class WeatherService implements Function<Request, String> {
 
     @Override
-    public String apply(final Request request) {
+    public String apply(Request request) {
         Log.info(this.getClass(), "省 : {},  地区 {}", request.getSheng(), request.getPlace());
         Map<String, Object> kv = new HashMap<>();
         kv.put("id", "88888888");