SpringBoot uses JsonSerializer and Aop to achieve controllable data desensitization

This is a community that may be useful to you One-to-one communication/interview brochure/resume optimization/job search questions, welcome to join the “Yudao Rapid Development Platform” Knowledge Planet. The following is some information provided by Planet: “Project Practice (Video)”: Learn from books, “practice” from past events “Internet High Frequency Interview Questions”: Studying with your resume, spring blossoms […]

(Java) Spring-Aop

1.Aop overview: AOP (Aspect Oriented Programming), which is aspect-oriented programming. Enhance the code without modifying the original code. 2. Terminology diagram 3. Underlying principles 4.Aop Getting Started Case 1. Environment setup 2. Coordinates: web, test, aop <!–Determine the spring boot version–> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.5.RELEASE</version> <relativePath/> </parent> <properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> </properties> <dependencies> <!–web development launcher–> […]

03-Implementing AOP based on annotations

Using Spring’s AOP AspectJ is a framework organized by Eclipse that supports AOP. It is a framework independent of the Spring framework. Spring’s implementation of AOP includes several methods The first way (commonly used): AOP implemented by the Spring framework combined with the AspectJ framework based annotation method The second method (commonly used): Spring framework […]

[SpringBoot] Spring’s AOP combined with Redis implements current limiting for SMS interfaces

Article directory Preface 1. Preparation work 2. Current limiting annotation 3. Customize or select redisTemplate 1. Customize RedisTemplate (depending on needs, I use the second option) 2. Use StringRedisTemplate directly 4. Open lua script 5.Annotation analysis 6.Interface testing Foreword Scenario: In order to limit the number of visits to the SMS verification code interface and […]

springboot+Redis+AOP implements request current limiter

Write at the beginning This article refers to the technical post Programmer’s Things Mainly summarize the learning experience, and also add your own explanations of understanding. Configure RedisTemplate instance //Configure redis to use String data structure //Serialize key value //Connect to redis according to configuration @Configuration public class RedisLimiterHelper {<!– –> @Bean public RedisTemplate<String, Serializable> […]

Solve Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigExce

Table of Contents Solve Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class com.alibaba.alibrain.quotareport.controller.QuotaReportDayController Problem Description solution 1. Check the visibility of a class 2. Exclude final classes 3. Check Spring version 4. Use other proxy modes Summarize Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate […]

IOC and AOP of Spring system

Foreword Spring is a lightweight Inversion of Control (IoC) and Aspect-Oriented (AOP) container framework. IOC 1. Concept of IOC Inversion of Control (IoC=Inversion of Control) IoC, in vernacular terms, means that the container controls the (dependency) relationship between programs, instead of being directly controlled by program code in traditional implementations. This is the so-called “inversion […]

AOP and MDC implement log tracking

Foreword In actual development, log output is very important. In a production environment, if the logs are well typed, problems can be quickly checked. In order to better view the logs, we need to connect these logs in series, which will make the troubleshooting problems easier. Got to be more relaxed. It just so happens […]

The springboot project implements entry participation decryption through custom annotations + aop

1. Create custom annotations: @Target({<!– –>ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface EncryptDecrypt {<!– –> } 2. Create an encryption and decryption tool class: public class EncryptionUtils {<!– –> // Encryption method public static String encrypt(String data) {<!– –> // Implement encryption logic // … return encryptedData; } //Decryption method public static String decrypt(String encryptedData) {<!– –> […]

Spring AOP source code interpretation

Today we will analyze the source code of AOP in Spring, mainly about how Spring AOP works. Preliminary preparation First we need to have a Spring AOP project and add Spring AOP dependencies. <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>6.0.2</version> </dependency> <!–spring aop dependency–> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>6.0.2</version> </dependency> <!–spring aspects dependency–> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>6.0.2</version> </dependency> Start […]