- 博客(11)
- 收藏
- 关注
原创 完整demo,webSocket实现浏览器消息推送系统
一。开启webSocket支持 @Configuration public class AppConfig { /** * 开启webSocket支持 * @return */ @Bean public ServerEndpointExporter serverEndpointExporter() { return new ServerEndpointExporter(); } } 二定义webSocket给前端调用 package com.example.yys_websocket_server.webs
2020-11-24 15:00:25
388
原创 调用百度文字识别api,识别图片上的文字
package com.dianjue.sso.utils; import com.alibaba.fastjson.JSONObject; import com.dianjue.sso.entity.BaiduKeyYml; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpU...
2019-06-14 10:50:44
730
原创 JPA之二:分页和模糊查询
模糊查询需要Repository接口继承JpaSpecificationExecutor接口 该接口含方法: Page findAll(Specification spec,Pageable pageable);//分页加条件 List findAll(Specification spec);//条件 List findAll(Specification spec,Sort sort);//条件加...
2019-04-24 11:27:44
2091
原创 通过Spring Security来密码加密(BCrypt)
第一步:导入依赖 org.springframework.boot spring‐boot‐starter‐security 第二步:添加配置类 导入依赖后会控制所有的地址,可以进行访问鉴权,不过这里我们只是来加密的所以,让所有的接口都可以匿名访问 /** 安全配置类 */ @Configuration @EnableWebSecurit...
2019-03-27 09:52:30
3567
原创 nginx
1.静态服务器 将cart.html放在/usr/local/nginx/cart下 将search.html放在/usr/local/nginx/search下 修改nginx/conf/nginx.conf server { listen 81; server_name localhost; ----此处也可添加域名指向 location / { root cart; ind...
2019-03-25 13:55:07
175
原创 Mycat数据库中间件的使用教程
这是篇实战的教程,关于mycat的优点理论请自行百度 第一步:下载mycat,上传到服务器,建议放在/usr/local/mycat 下载地址:http://dl.mycat.io/1.6-RELEASE/ 进入mycat bin输入命令./mycat start mycat默认的端口是:8066 第二步: 准备好了mycat,下面介绍数据的分片知识 ...
2019-03-25 13:17:36
345
原创 MybatisPlus之一:分页加条件查询
本文主要介绍三个框架各自的条件加分页查询的实现过程 第一部分:JPA的模糊条件查询加分页 模糊查询需要Repository接口继承JpaSpecificationExecutor接口 该接口含方法: Page findAll(Specification spec,Pageable pageable);//分页加条件 List findAll(Specification spec);//条件 Lis...
2019-03-22 11:17:34
14495
原创 工行支付之加工需要提交的数据和签名
methodName:icbc加密签名 public icbc icbcMD(TspResponseOrderInfo i) { icbc result = new icbc(); ICBCTranData tranData = new ICBCTranData(); try { //为空返回true if (!StringUtils.isBlank(i.getPrice())) ...
2019-02-20 17:38:05
915
1
原创 限流和算法(浅)
1.限流方式:Hystrix适用线程池隔离,超过线程池的负载,走熔断的逻辑。 tomcat容器也是通过限制它的线程数来控制并发的; 也有通过时间窗口的平均速度来控制流量。 常见的限流纬度有比如通过Ip来限流、通过uri来限流、通过用户访问频次来限流。 2.一般限流都是在网关这一层做,比如Nginx、zuul、Spring Cloud Gateway 3.限流的算法: 1.计数器算法:比如一秒内限流...
2019-02-18 14:18:43
361
原创 获取xml里的内容
public static String getXMLValue(String xmlStr,String tagName){ Matcher matcher = Pattern.compile("<"+tagName+">(.*?)</"+tagName+">").matcher(xmlStr); while (matcher.find()) { return matc...
2019-02-13 10:11:10
446
原创 JPA之一:基础和实战
现在使用jpa的项目越来越多,它是封装的hibernate的高级类库,快捷的开发模式,让程序员脱离繁琐的sql语句,会让你爱不释手,下面进行介绍jpa的使用方法,让你快速入门 1.使用jpa的项目结构  下面进行按步骤介绍:.yml-----entity---...
2018-11-27 12:14:36
967
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅