- 博客(4)
- 收藏
- 关注
原创 http请求get和post请求的简单封装
引入jar包commonsHttpclient: 'commons-httpclient:commons-httpclient:3.1'封装HttpRequestUtilspublic class HttpRequestUtils { private static final String CHARSET = "UTF-8"; private static final Logger log = LoggerFactory.getLogger(HttpRequestUtil.
2021-12-17 14:45:30 528
原创 全局异常实现及抛出自定义异常错误提示
自定义GlobalExceptionpublic class GlobalException extends RuntimeException{ private String message; private String code; /** * 默认构造方法,根据异常信息 构建一个异常实例对象 * @param message 异常信息 */ public GlobalException(String message) { .
2021-12-17 14:42:07 496
原创 自定义注解整合切面+Redis实现对接口单位时间内请求次数限制
jar包依赖 aspectj : "org.aspectj:aspectjweaver:1.9.6",实现自定义注解@Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD})@Retention(RetentionPolicy.RUNTIME)public @interface RepeatRequest {}设置切面@Aspect@Componentpublic class Repe.
2021-12-17 14:36:52 726
原创 切面整合自定义注解,对接口请求参数进行校验
切面整合自定义注解,对接口请求参数进行校验jar包依赖 aspectj : "org.aspectj:aspectjweaver:1.9.6", 自定义注解并设置需要校验的字段@Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD})@Retention(RetentionPolicy.RUNTIME)public @interface StoreIdValid ...
2021-12-17 14:14:45 712
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人