How to elegantly and uniformly manage project thread pools

How to elegantly and uniformly manage the project’s thread pool 1. Problem description Sometimes we encounter such prompts when writing code. For example, in the following code, a new thread pool will be created every time the service is exposed, and the thread pool will not be destroyed after the business ends. public void batchExportUrl() […]

SpringCloud uniformly configures knife4j (swagger) documents in Gateway

I used swagger before, but I felt that its interface was not very friendly, so I switched to knife4j. This interface is indeed much better. Let me show you the effect first Pay attention to the content in the red box in the upper left corner. This is the difference between single-machine documents and multi-service […]

[Specification] SpringBoot interface return results and exceptions are handled uniformly, so that the encapsulation is elegant

Reprint: https://blog.csdn.net/m0_64355285/article/details/132903744 package net.javadog.common.result; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import net.javadog.common.enums.HttpStatusEnum; /** * Return the result set * * @authorjavadog **/ @Data @AllArgsConstructor @NoArgsConstructor @ApiModel(“Unified Result Set Processor”) public class ResponseResult<T> {<!– –> /** * status code */ @ApiModelProperty(value = “status code”) private Integer code; /** * status information */ […]

The back-end Gateway uniformly encrypts and decrypts interface parameters based on filters.

First prepare the tool class: interface preheating that requires encryption and decryption package org.springblade.gateway.provider; import java.util.ArrayList; import java.util.List; /** * @ClassName DecryptProvider * @Description TODO Decryption interface parameters * @Author YuanJiaLe * @Date 2023/10/8 15:21 * @PackageName org.springblade.gateway.provider * @Version 1.0.0 */ public class DecryptProvider { private static final List<String> Decrypt_URL = new ArrayList<>(); static […]

Use SpringMVC to handle exceptions uniformly

Use SpringMVC to uniformly handle exceptions Article directory Use SpringMVC to handle exceptions uniformly Create a maven project and import dependency preparations Three ways to achieve unified processing: Method 1: Knowledge of using servlets Method 2: Implement the HandlerExceptionResolver interface Method 3: Use the @ExceptionHandler annotation to implement exception handling Create a maven project and […]

Download/export problem (uniform return): No converter for xxx with preset Content-Type application/octet-stream; charset=UTF-8

1. Preface The download interface returns download data normally. After the file stream is closed, the response returns success and the console reports an error all content: Probably means there is no converter. Contains the default content type “application/octet-stream;charset=UTF-8” org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.cn.common.AjaxResult] with preset Content-Type ‘application/octet-stream;charset=UTF-8’ at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:319) at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:194) at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:78) […]

[Specification] SpringBoot interface return results and exceptions are handled uniformly, so that the encapsulation is elegant

Main goal Achieve 2 key points 1. Unified interface returns results 2. Configure global exception handling Text 1. Unified interface returns results The front-end interface requests the back-end, and the back-end will return the result Uniform encapsulation. It improves the standardization and versatility of interaction, and also improves the joint debugging efficiency of the front […]

[WPF] Pack URI Uniform Resource Identifier used to load files

URI In Windows Presentation Foundation (WPF), Uniform Resource Identifiers (URIs) are used to identify and load files in a variety of ways, including the following: Specifies the user interface (UI) that displays when the application is first launched. Load images. Navigate to the page. Loading non-executable data file. Additionally, URIs can be used to identify […]

PCl point cloud filtering (1) straight-through filtering, voxel filtering, uniform sampling, statistical filtering

A visual function void viewPort2(pcl::PointCloud<pcl::PointXYZ>::Ptr inputCloud, pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered) {<!– –> pcl::visualization::PCLVisualizer::Ptr viewer(new pcl::visualization::PCLVisualizer(“Comparison before and after filtering”)); /*—–Viewport 1—–*/ int v1(0); viewer->createViewPort(0.0, 0.0, 0.5, 1.0, v1); //Set the minimum and maximum values of the first viewport on the X-axis and Y-axis, with values between 0-1 viewer->setBackgroundColor(0, 0, 0, v1); //Set the background color, 0-1, default […]

SpringBoot&Vue&EmementUI separates and integrates front-end and back-end, uniformly encapsulates axios, and cross-domain configuration

?Author name: DaenCode About the author: A rising star in CSDN with two years of experience in back-end development. He once served as the technical representative of Party A. He founded Zhiyuan Enchuang Network Technology Studio in his spare time. Be familiar with Java-related technology stacks, Fanruan reports, and rapid development of low-code platforms. The […]