Spring boot integration -- Cache (Redis)

Abstract: Time flies quickly, and I'm about to usher in a brand-new and hopeful 2020, which is also the representative of my brand-new start in the new year. I will ask myself to meet a brand-new year with the highest expectation. As procedural apes, we will take performance, safety, concise code as the ...

Added by robert.access on Tue, 14 Jan 2020 04:06:49 +0200

Give default values to your objects properties

I'm a zebra What to do and what to solve in this blog What knowledge is needed to solve this problem Specific code, effect In actual development, in order to avoid unnecessary null pointer exception. It is necessary to judge whether it is empty. If a method is called to judge whether it is null every time an object's prop ...

Added by PHPThorsten on Mon, 02 Dec 2019 18:23:03 +0200

Deep understanding of lambda expression and functional programming functional interface source code analysis

package com.java.design.java8; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.util.Arrays; import java.util.Compar ...

Added by Cagecrawler on Sun, 01 Dec 2019 22:03:58 +0200

spring cloud feign file upload and file download

File upload reference: http://blog.didispace.com/spring-cloud-starter-dalston-2-4/ File download reference: https://blog.csdn.net/aaronsimon/article/details/82710979 My spring boot and spring cloud versions are: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artif ...

Added by zilem on Sun, 01 Dec 2019 05:50:26 +0200

Collection of annotations and AOP implementation logs

The background is: the project is a distributed project deployed with spring cloud eureka service system, which is separated before and after, and the front-end node s directly call each service interface. The principle is to start and end the log collection of recording request, response and operation information in the handl ...

Added by aleksandra on Wed, 27 Nov 2019 18:36:19 +0200

[design mode] let's talk about the single example mode

? for some classes in the system, it is important to have only one instance. For example, a system can have multiple print tasks, but only one working task; a system can only have one window manager or file system; a system can only have one timing tool or ID (sequence number) generator. How to ensure that a class has only one instance and that ...

Added by barry_p on Wed, 13 Nov 2019 05:14:02 +0200

Strategy mode and factory mode

The combination of policy pattern and factory pattern can eliminate the multi nesting of code if else demand There is such a demand for under store stores. There are four levels for user customers: ordinary customers, vip customers, super vip users and exclusive vip users. When users purchase goods, different discount strategies are adopted f ...

Added by supermars on Mon, 04 Nov 2019 03:51:54 +0200

SND - entity creation

There are two entities: node entity and relationship entity.  1.@NodeEntity 2.@RelationshipEntity 1. Node entity package org.canaan.neo4j.graph.entity; import lombok.Data; import org.canaan.neo4j.graph.convert.MoneyConverter; import org.neo4j.ogm.annotation.Id; import org.neo4j.ogm.annotation.Labels; import org.neo4j.ogm.annotatio ...

Added by NightCoder on Wed, 30 Oct 2019 22:52:50 +0200

Java interface unified style return template

background In the development of interfaces, a fixed return style is generally required. When the interface is successful or failed, the unified return is carried out according to this format. In this way, the joint debugging between interfaces with other people will not appear disorderly. If this fixed format is placed in each interface of Jav ...

Added by Amitk on Wed, 30 Oct 2019 10:42:09 +0200

Spring Cloud Alibaba nacos configuration center

background In the last article, we talked about how to build a registry. This time, we talked about how to use nacos as a registry. Spring cloud Alibaba basis to create basic dependency First of all, we create a spring cloud Alibaba basis basic dependency project to work out the common version we want to use. spring boot version 2.1.7.RELEASE ...

Added by reaper7861 on Sun, 27 Oct 2019 18:42:05 +0200