自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 页面定时实时刷新数据库数据

<script type="text/javascript"> var t1 = window.setInterval("findPepo()", 5000); //定时刷新某一个DIV或者某一个区域数据 </script> //查询最新数据 function findPepo() { $.ajax({ type: "post", async: true, //异

2021-06-07 17:26:39 1112

原创 Java操作图片处理后前景色变红的解决办法

因为使用错误的色彩空间渲染图像,给BufferedImage设置type为BufferedImage.TYPE_INT_RGB,如果不行再设置为TYPE_INT_ARGB,因为原本图片的位深度是24,替换的位深度是32或者原本图片的位深度是32,替换的位深度是24这两种都是不行的BufferedImage bi1 = ImageIO.read(bais);//上面这句代码后面加下面内容即可解决BufferedImage resizedImage = new BufferedImage(bi1.getW

2021-05-13 17:19:41 2024

原创 java解决跨域问题

mport org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.CorsRegistry;import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;/** * 跨域配置 */@Configurationpublic class Cross

2021-05-11 16:28:58 109

原创 springboot中接入shiro权限框架

首先在pom.xml中引入shiro包<dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.5.3</version> </dependency>下面是表和实体类结构:注:继承的baseBean为我的基础实体类,包含主键,操作记录等信息,根据

2021-05-06 17:37:52 157

原创 shiro权限框架 -过滤器ShiroConfig详细配置(ShiroFilterFactoryBean详细参数配置)

package com.pcframe.config;import com.pcframe.realm.PcUserRealm;import org.apache.shiro.mgt.SecurityManager;import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;import org.apache.shiro.spring.web.ShiroFilterFactoryBea

2021-05-06 17:21:36 1346

原创 shiro权限框架-实体类表结构与数据库设计

注:继承的baseBean为我的基础实体类,包含主键,操作记录等信息,根据业务逻辑自行修改一、用户表实体类@org.hibernate.annotations.Table(appliesTo = "pc_user", comment = "Pc端用户表")public class PcUser extends BaseBean { @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(columnDefinition.

2021-05-06 17:09:16 298

原创 java中@AllArgsConstructor注解作用

这是一个lombok中的注解,写在类上@AllArgsConstructorpublic class ShopUser{}@Data这个注解是自动添加各属性的get,set方法,而@AllArgsConstructor这个注解是自动添加类的构造函数

2021-05-06 16:55:55 4866

原创 java接入极光推送(可全推,标签,别名推送)并设置标签与别名

一、首先在pom导入jar包 <!-- 极光推送 --> <dependency> <groupId>cn.jpush.api</groupId> <artifactId>jpush-client</artifactId> <version>3.3.5</version> </depend

2021-04-26 11:53:30 1528 2

原创 java完成订单自动取消和自动收货的逻辑

主要逻辑:(如半小时自动收货)使用定时器定时一分钟执行一次,检查下单时间和当前时间对比,如果大于30分钟,则执行收货逻辑代码代码如下:@Componentpublic class TimedTask { static DefaultWebSecurityManager manager = new DefaultWebSecurityManager(); @Autowired DindanService dindanService; @Autowired Dind

2021-04-23 16:40:52 747

原创 Spring Boot使用自带定时器@Scheduled

①:写法:@Scheduled(cron = “0 * * * * ?”)," "号中的内容可自行百度Scheduled代码生成,这里是一分钟执行一次,百度生成的代码中一般都是6位,有的版本只支持5位,可直接删除生成的最后一位,效果不变。②在Application启动类中加入注解:@EnableScheduling //定时器注解...

2021-04-23 16:36:59 131

原创 随笔-Java-springboot加了定时器@Scheduled后和shiro的兼容问题-No SecurityManager accessible to the calling code

需要在加了@Scheduled的方法中加一个DefaultWebSecurityManager带来的问题与优化:每次定时任务启动就要new一个DefaultWebSecurityManager,这是个问题;优化下,可以将DefaultWebSecurityManager 作为静态变量,或者放到spring容器中。如下面代码:static DefaultWebSecurityManager manager = new DefaultWebSecurityManager(); @Schedul

2021-04-23 16:34:24 630 3

原创 SpringBoot框架解决后台传给前端Long类型超长前端接收精度丢失问题

此方法只针对SpringBoot框架@JsonSerialize(using = ToStringSerializer.class)private Long id;原理是加这个注解,会自动将Long类型转换为String类型,未封装的long类型不行,必须是Long

2021-04-16 17:21:01 953

原创 springboot允许跨域访问

package com.springboottest.config;import org.springframework.beans.factory.annotation.Configurable;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.CorsRegistry;import org.springframew

2021-04-13 15:40:21 64

转载 spring boot配置mybatis和事务管理

在java中异常的基类为Throwable,他有两个子类xception与Errors。同时RuntimeException就是Exception的子类,只有RuntimeException才会进行回滚;1,Spring事务回滚机制是这样的:当所拦截的方法有指定异常抛出,事务才会自动进行回滚!我们需要注意的地方有四点: 如果你在开发当中引入Spring进行事务管理,但是事务没能正常的自动回滚,可以对照下面四点,缺一不可!①被拦截方法-—— 注解式:方法或者方法所在类被@Transaction

2021-04-09 09:52:46 98

转载 spring boot配置mybatis和事务管理

spring boot配置mybatis和事务管理一、spring boot与mybatis的配置1.首先,spring boot 配置mybatis需要的全部依赖如下:org.springframework.bootspring-boot-starter-parent1.5.1.RELEASE org.springframework.boot spring-boot-starter-web 1.5.1.RELEASE org.my

2021-04-09 09:49:01 981

转载 mybatis 传递参数的7种方法

在实际开发过程中,增删改查操作都要涉及到请求参数的传递,今天这节就集中讲下在mybatis中传递参数的7中方法单个参数的传递很简单没有什么好将的,这里主要说下多个参数的传递1.第一种方式 匿名参数 顺序传递参数复制代码controller@ApiOperation(value = “多个参数查询_匿名顺序传参”)@GetMapping(“findByParams”)public ResultMsg findByParams(Short gender,String age){List res

2021-04-08 14:16:08 676

转载 如何关闭liunx CentOs7.0防火墙

CentOS7这个版本的防火墙默认使用的是firewall,与之前的版本使用iptables不一样。按如下方便配置防火墙:1.关闭防火墙:sudo systemctl stop firewalld.service2.关闭开机启动:sudo systemctl disable firewalld.service3、安装iptables防火墙执行以下命令安装iptables防火墙:sudo y...

2019-04-22 10:49:00 671

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除