
SpringBoot
write less,do more
这个作者很懒,什么都没留下…
展开
-
对手机号脱敏
// 对手机号码实现脱敏String mobile = "18782766707"; String desensMobile = mobile.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");原创 2020-08-23 12:44:57 · 815 阅读 · 0 评论 -
springboot验证手机号
/** * 手机号码 */ @NotBlank(message = "手机号码不能为空") @Size(min = 11, max = 11, message = "手机号码长度不正确") @Pattern(regexp = "^(((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8})$", message = "手机号格式错误") private String mobil原创 2020-08-23 11:43:19 · 4288 阅读 · 0 评论 -
springboot文件下载
/** * 下载文件 * * @param filepath * @throws WiiException */ @ApiOperation("下载文件") @GetMapping(path = "/doc_download") public ResponseEntity<FileSystemResource> downloadFile(@RequestParam("filepath") @ApiParam(name="原创 2020-08-21 17:41:11 · 190 阅读 · 0 评论 -
以json的格式返回数据
/** * 返回错误提示 * * @param errorMsg * @param httpServletResponse * @throws IOException */ public void resultError(String errorMsg, HttpServletResponse httpServletResponse) { httpServletResponse.setCharacterEncoding("U原创 2020-08-13 10:56:37 · 509 阅读 · 0 评论 -
使用aop进行异步执行代码。@Async失效的时候用
1、annotation 包下package com.app.annotation;import java.lang.annotation.*;/** * 自定义异步注解,service.impl层打此注解 * */@Target({ElementType.METHOD, ElementType.TYPE})@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface AsyncAnnotation {}2、a原创 2020-08-10 11:20:11 · 1187 阅读 · 0 评论 -
Springboot中自定义注解时间校验
https://blog.youkuaiyun.com/liu19900205/article/details/81503511原创 2020-07-05 10:33:34 · 2815 阅读 · 0 评论 -
HttpClientUtil类
package com.app.util;import java.io.IOException;import java.util.Map;import com.alibaba.fastjson.JSONObject;import lombok.extern.slf4j.Slf4j;import org.apache.http.HttpEntity;import org.apache.http.HttpStatus;import org.apache.http.client.config.Re原创 2020-06-29 20:36:33 · 178 阅读 · 0 评论 -
dom4j解析xml文件
引包: <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6.1</version> </dependency>@Test public void test1()...原创 2019-09-29 16:15:21 · 121 阅读 · 0 评论 -
SpringBoot中使用拦截器拦截跳转登录
拦截器以及界面位置效果:访问main.html时会进行拦截,判断是否存在用户,不存在则跳转登录登录成功跳转成功页面1、写一个登录拦截类LoginInterceptor实现HandlerInterceptor@Componentpublic class LoginInterceptor implements HandlerInterceptor { //这个方法是在访问接口...原创 2019-08-29 23:07:00 · 6734 阅读 · 2 评论 -
SpringBoot拦截器
https://blog.youkuaiyun.com/qq_30745307/article/details/80974407转载 2019-08-29 10:23:47 · 116 阅读 · 0 评论 -
SpringBoot 注解整理
项目用到的注解作用:bean的分类标识@Service: 注解在类上,表示这是一个业务层bean@Controller:注解在类上,表示这是一个控制层bean@Repository: 注解在类上,表示这是一个数据访问层bean@Component: 注解在类上,表示通用beanbean注入:@Autowired:按类型装配@Resource: 按名称装配@Configuratio...转载 2018-11-01 10:09:25 · 132 阅读 · 0 评论 -
SpringBoot+Easyui+pagehelper实现真分页功能
1.首先引入jar包 &lt;dependency&gt; &lt;groupId&gt;com.github.pagehelper&lt;/groupId&gt; &lt;artifactId&gt;pagehelper&lt;/artifactId&gt; &lt;version&gt;4.1.3&a原创 2018-11-20 14:44:51 · 1223 阅读 · 0 评论 -
SpringBoot文件上传
jsp页面&lt;form method="post" action="${pageContext.request.contextPath}/UserInfoController/uploadImage" enctype="multipart/form-data"&gt; &lt;input name="fil原创 2018-11-06 14:44:59 · 118 阅读 · 0 评论 -
SpringBoot图片下载
jsp页面:<img src="${pageContext.request.contextPath}/showImg?imgID=1" />后台:@RequestMapping("/showImg")public void showImg(HttpServletRequest request, HttpServletResponse response){ String i...原创 2018-11-07 10:02:48 · 6183 阅读 · 0 评论 -
SpringBoot中aop大概用法
1.pom.xml中引入<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>package com.wood.lo...原创 2019-03-22 22:12:50 · 109 阅读 · 0 评论