摘要: 一、引入相应云平台SDK <dependency> <groupId>com.qiniu</groupId> <artifactId>qiniu-java-sdk</artifactId> <version>${qiniu.version}</version> </dependency> <depe 阅读全文
posted @ 2021-07-07 16:47 潜跃 阅读(466) 评论(0) 推荐(0)
摘要: @Configuration public class ScheduleConfig { @Bean public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) { SchedulerFactoryBean fact 阅读全文
posted @ 2021-07-07 16:14 潜跃 阅读(301) 评论(0) 推荐(0)
摘要: public class TokenGenerator { public static String generateValue() { return generateValue(UUID.randomUUID().toString()); } private static final char[] 阅读全文
posted @ 2021-07-07 16:11 潜跃 阅读(446) 评论(0) 推荐(0)
摘要: public class PageUtils implements Serializable { //定义程序序列化ID private static final long serialVersionUID = 1L; /** * 总记录数 */ private int totalCount; /* 阅读全文
posted @ 2021-07-07 16:06 潜跃 阅读(1793) 评论(0) 推荐(0)
摘要: public class ShiroUtils { public static Session getSession() { return SecurityUtils.getSubject().getSession(); } public static Subject getSubject() { 阅读全文
posted @ 2021-07-07 16:04 潜跃 阅读(324) 评论(0) 推荐(0)
摘要: @Component public class RedisUtils { @Autowired private RedisTemplate<String, Object> redisTemplate; @Autowired private ValueOperations<String, String 阅读全文
posted @ 2021-07-07 16:03 潜跃 阅读(1728) 评论(0) 推荐(0)
摘要: public class IPUtils { private static Logger logger = LoggerFactory.getLogger(IPUtils.class); /** * 获取IP地址 * * 使用Nginx等反向代理软件, 则不能通过request.getRemoteA 阅读全文
posted @ 2021-07-07 13:34 潜跃 阅读(69) 评论(0) 推荐(0)
摘要: /** * Copyright (c) 2016-2019 人人开源 All rights reserved. * * https://www.renren.io * * 版权所有,侵权必究! */ package io.renren.common.utils; import org.apache. 阅读全文
posted @ 2021-07-07 13:29 潜跃 阅读(105) 评论(0) 推荐(0)
摘要: @Configuration public class RedisConfig { @Autowired private RedisConnectionFactory factory; @Bean public RedisTemplate<String, Object> redisTemplate( 阅读全文
posted @ 2021-07-07 11:43 潜跃 阅读(315) 评论(0) 推荐(0)
摘要: @Configuration public class ShiroConfig { @Bean("securityManager") public SecurityManager securityManager(OAuth2Realm oAuth2Realm) { DefaultWebSecurit 阅读全文
posted @ 2021-07-07 11:41 潜跃 阅读(330) 评论(0) 推荐(0)
摘要: @Configuration @EnableSwagger2 public class SwaggerConfig implements WebMvcConfigurer { @Bean public Docket createRestApi() { return new Docket(Docume 阅读全文
posted @ 2021-07-07 11:38 潜跃 阅读(365) 评论(0) 推荐(0)
摘要: @Configuration public class KaptchaConfig { @Bean public DefaultKaptcha producer() { Properties properties = new Properties(); properties.put("kaptcha 阅读全文
posted @ 2021-07-07 11:28 潜跃 阅读(96) 评论(0) 推荐(0)
摘要: @Configuration public class CorsConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMappin 阅读全文
posted @ 2021-07-07 11:25 潜跃 阅读(192) 评论(0) 推荐(0)
摘要: 一、@Bean注解的作用 @Bean是一个方法级别上的注解,主要用在@Configuration注解的类里,也可以用在@Component注解的类里。添加的bean的id为方法名(来自文章1) 二、注解分为两类: 1、一类是使用Bean,即是把已经在xml文件中配置好的Bean拿来用,完成属性、方法 阅读全文
posted @ 2021-07-07 10:57 潜跃 阅读(6003) 评论(0) 推荐(0)