Stella981 Stella981
3年前
Service Discovery with Spring Cloud Eureka
<dependency<groupIdorg.springframework.cloud</groupId<artifactIdspringcloudstartereurekaserver</artifactId</dependency@SpringBootApplication@EnableEurekaServe
Stella981 Stella981
3年前
Spring Boot项目使用maven
springbootassembly1.在springboot项目中使用mavenprofiles和mavenassembly插件根据不同环境打包成tar.gz或者zip2.将springboot项目中的配置文件提取到外部config目录中3.将springboot项目中
Stella981 Stella981
3年前
Spring Boot 访问静态资源
在SpringBoot项目中没有我们之前常规web开发的WebContent(WebApp),它只有src目录。在src/main/resources下面有两个文件夹,static和templates。SpringBoot默认在static目录中存放静态页面,而templates中放动态页面。1static目录
Stella981 Stella981
3年前
Spring Boot + Elasticsearch 使用示例
本文分别使用ElasticsearchRepository和ElasticsearchTemplate实现Elasticsearch的简单的增删改查一、ElasticStackElasticStack是ELKStack在5.0版本加入Beats套件后的新称呼1.Elasti
Stella981 Stella981
3年前
Spring Cloud 详解(一)简介
SpringCloud并不是一个具体的框架,可以理解为一个工具集合。利用SpringCloud提供的各种工具,可以快速的搭建一个基于微服务的分布式系统。SpringCloud各个项目基于SpringBoot, Netflix的多个框架进行封装,并且通过自动配置的方式将这些框架绑定到Spring的环境中,从而简化了这些框架的使用。Spri
Stella981 Stella981
3年前
Spring 12 种 常用注解!
1.声明bean的注解@Component组件,没有明确的角色@Service在业务逻辑层使用(service层)@Repository在数据访问层使用(dao层)@Controller在展现层使用,控制器的声明(C)2.注入bean的注解@Autowired:由Spring提供@Inj
Stella981 Stella981
3年前
Spring IOC 之 注册 BeanDefinition
获取Document对象后,会根据该对象和Resource资源对象调用 registerBeanDefinitions() 方法,开始注册BeanDefinitions!(https://oscimg.oschina.net/oscnet/36e85103bf03cfbc0117fc33eb4af909c0a.jpg)首先调
Stella981 Stella981
3年前
Spring Security 中的 Bcrypt
<divclass"postcontent"itemprop"articleBody"<p最近在写用户管理相关的微服务,其中比较重要的问题是如何保存用户的密码,加盐哈希是一种常见的做法。知乎上有个问题大家可以先读一下:<ahref"https://www.zhihu.com/question/20299384"加盐密码保存的最通用方法
Stella981 Stella981
3年前
How to convert BigDecimal to Double in spring
问题描述:我们都知道对于涉及钱的数据必须使用BigDecimal类型进行存储,今天在查询mongo时仍然有精度问题,虽然我在代码中使用了BigDecimal类型,但mongo中使用的是double类型。我初步推断是mongoTemplate在类型转换时出现了问题,根源还是因为mongodb中使用了double类型来存储。但是我决定不了mongodb于是我只
Stella981 Stella981
3年前
Spring Cloud云服务架构
今天正式给大家介绍了SpringCloud企业分布式微服务云架构构建,我这边结合了当前大部分企业的通用需求,包括技术的选型比较严格、苛刻,不仅要用业界最流行的技术,还要和国际接轨,在未来的5~10年内不能out。作为公司的架构师,也要有一种放眼世界的眼光,不仅要给公司做好的技术选型,而且还要快速响应企业的业务需求,能够为企业快速定制化业务。以下是