
java
明阳mark
这个作者很懒,什么都没留下…
展开
-
java发送Post请求
通过json发送、private String sendPostByJson(String url, Map<String, Object> params,Map<String, String> headers) {CloseableHttpClient httpclient = httpClient.getHttpClient();HttpPost post = new HttpPost(url);if (params != null && !param原创 2022-04-06 18:02:41 · 1078 阅读 · 0 评论 -
Quartz使用说明
原理图原创 2021-04-10 22:41:28 · 197 阅读 · 0 评论 -
pipeline测试代码
原创 2021-02-07 03:03:48 · 281 阅读 · 0 评论 -
Jenkins 之 Blue Ocean
定义安装使用原创 2021-02-07 02:53:39 · 195 阅读 · 0 评论 -
java复制类的写法
使用springframework里面的BeanUtil类 /** * 提交意见反馈 */ @PostMapping("/feedback/report") public Object reportFeedBack(@RequestBody PoliceAppIndexFeedbackDTO policeAppIndexFeedbackDTO) { PoliceAppIndexFeedback feedback = new PoliceAppInd原创 2020-10-20 15:49:32 · 221 阅读 · 0 评论 -
java的geojson格式测试数据模拟
String JSON = "{\n" + " \"type\": \"Feature\", \n" + " \"properties\": { }, \n" + " \"geometry\": {\n" + " \"type\": \"LineString\", \n" + " \"co...原创 2020-10-10 09:17:04 · 1176 阅读 · 0 评论 -
springSecurity去掉登录
package com.swcote;import com.swcote.people.resource.springboot.BasicSecurityConfigOverrider;import org.apache.ibatis.annotations.Mapper;import org.mybatis.spring.annotation.MapperScan;import org.springframework.boot.SpringApplication;import org.spri原创 2020-07-09 09:31:27 · 2309 阅读 · 0 评论 -
hutool
文章目录convertconvert原创 2020-07-06 07:31:19 · 1276 阅读 · 0 评论 -
有必要看的东西
javahutool 框架map的getordefault()方法原创 2020-07-03 12:12:46 · 89 阅读 · 0 评论 -
快速创建集合
创建String类型的集合原创 2020-06-27 08:09:15 · 450 阅读 · 0 评论 -
java导入网格
control层 @ApiOperation("网格导入") @PostMapping("/grid/import") public boolean importPatrolGrid(@PathVariable String tenant, @RequestParam("file") MultipartFile file) { try { return patrolGrid原创 2020-06-24 16:42:45 · 209 阅读 · 0 评论 -
Java的lombok
package com.swcote.pasturage.pasturageInfo.model;import java.math.BigDecimal;import com.baomidou.mybatisplus.annotation.IdType;import com.baomidou.mybatisplus.annotation.TableId;import com.baomidou.mybatisplus.extension.activerecord.Model;import jav原创 2020-06-12 15:32:17 · 141 阅读 · 0 评论 -
java创建json字符串
String JSON = "{\n" + " \"type\": \"Feature\", \n" + " \"properties\": { }, \n" + " \"geometry\": {\n" + " \"type\": \"Point\", \n" + " \"coordin...原创 2020-05-26 13:07:20 · 2024 阅读 · 0 评论 -
java上传流序列化
private ObjectMapper mapper = new ObjectMapper(); FeatureCollection featureCollection = new FeatureCollection(); try { featureCollection = mapper.readValue(featureStream, FeatureCollection.class); } catch (IOException .原创 2020-05-21 16:21:55 · 120 阅读 · 0 评论 -
java导入json
PUT http://localhost:8091/api/MWZHZLZX/patrol/trace HTTP/1.1Cookie: JSESSIONID=70C0F3FCC68BF2E1B2821318259D8B68content-type: application/json{ "gridStaffId": 324, "gridId": 302, "planI...原创 2020-01-16 13:50:50 · 483 阅读 · 0 评论 -
jdk8里面新时间的使用
两种构造 LocalDateTime time = LocalDateTime.now(); System.out.println(time); LocalDateTime of = LocalDateTime.of(2015, 10, 22, 10, 10, 10); System.out.println(of);时间的加减 LocalDateTime plusTime...原创 2019-11-04 00:09:09 · 229 阅读 · 0 评论 -
Optional的使用
创建传统 @Test public void test1() { Optional<Employee> op = Optional.of(new Employee()); Employee employee = op.get(); System.out.println(employee); }空的option...原创 2019-11-03 16:45:51 · 134 阅读 · 0 评论 -
java8并行流
并行流@Test public void test1() { Instant start = Instant.now(); LongStream.rangeClosed(0, 10000000000L) .parallel() .reduce(0, Long::sum); Instant...原创 2019-11-03 15:57:28 · 95 阅读 · 0 评论 -
java的lambda表达式排序和some的使用
对map排序//按年龄升序 employees.stream() .sorted(Comparator.comparingInt(Employee::getAge));//按年龄降序 employees.stream() .sorted((e1,e2) -> - Integer.compare(e1.getAge(), e2.getAge()...原创 2019-10-25 15:28:53 · 531 阅读 · 0 评论 -
java的lambda求map最大值的五种方法
Map<String,Integer> map = new HashMap<>(); map.put("张三", 1); map.put("李四", 2); map.put("王五", 3); //第一种方法 Optional<Map.Entry<String, In...原创 2019-10-25 15:01:16 · 4505 阅读 · 0 评论 -
关于lambda里面的终止操作
注意parallelStream是并发操作,也就是多线程,获取不固定了 List<Employee> employees = Arrays.asList( new Employee("张三", 18, 9999, 20, Employee.Status.FREE), new Employee("李四", 38, 4999, 20...原创 2019-10-22 01:06:42 · 1068 阅读 · 0 评论 -
java流操作的几种方式
注意: 使用district要重写hashCode和equl方法 /** * 筛选和切片 * filter -过滤 * limit -截断 * skip - 跳过 * district -去重 根据hashCode() 和 equal 来的 */ List<Employee> employees = Arra...原创 2019-10-21 01:04:50 · 180 阅读 · 0 评论 -
java创建Stream流的4种方式
/** * 三步 * 1、创建Stream * 2、中间操作 * 3、终止操作 */public class TestSteamApi { //创建steam的4种方式 @Test public void test1(){ //1.通过colletion 系列集合提供的steam() 或 parallelSteam() Stre...原创 2019-10-21 00:43:15 · 194 阅读 · 0 评论 -
java的一参Lambda表达式应用
先定义一个函数式接口@FunctionalInterfacepublic interface MyFun { Integer getValue(Integer value);}关于调用 @Test public void test6(){ //用lambda实现真的很灵活 100是lambda实现的参数 Integer num = ope...原创 2019-10-20 15:38:33 · 101 阅读 · 0 评论 -
java策略模式及其优化
策略模式将不同的地方剥离出来写成一个接口,可以用来减少冗余代码接口public interface MyPredicate<T> { boolean test(T t);}两个实现类public class FilterEmployeeByAge implements MyPredicate<Employee> { @Override ...原创 2019-10-19 22:43:03 · 398 阅读 · 0 评论 -
常见递归算法
由于在工作中经常碰到 数组里面的对象有个属性children又是数组,现在记录下来常见递归算法对象结构根据code递归找到对象List<OuNode> roots = new ArrayList<>();private OuNode findNode(String code) { for (OuNode root : roots) { ...原创 2019-10-15 08:30:18 · 565 阅读 · 0 评论 -
java设置启动调用函数
public static void main(String[] args) { ConfigurableApplicationContext context = new SpringApplicationBuilder(MockAirSensorApp.class).web(WebApplicationType.NONE).run(args); if(Arrays...原创 2019-08-01 09:21:18 · 507 阅读 · 0 评论 -
java8新增语法
java8新增4种接口消费型接口 没有返回 一个参数@Test public void test1(){ happy(10000, (money) -> System.out.println("大保健每次每次消费" + money + "元")); } public void happy(double money, Consumer<D...原创 2019-09-23 01:02:03 · 357 阅读 · 0 评论 -
mybatis将返回的多条数据映射为一条数据的多个字段
最近在开发一个权限管理系统,用户是两张表组合的,分别是基础属性表和扩展属性表基础属性表 pluto_useriduser_nameremarks1曹操热爱加班2曹丕热爱吃饭3蔡徐坤喜欢唱、跳、rap、篮球4郭嘉喜欢唱、跳、rap、篮球5荀彧办事效率高6程昱喜欢写代码7夏侯渊精通java扩展属性表 plu...原创 2019-06-08 20:18:10 · 3609 阅读 · 2 评论 -
java字符串替换
int id = 1;String.format("配置异常!组织结构自定义属性 %s 不存在!", id);原创 2019-06-06 14:03:01 · 517 阅读 · 0 评论 -
打包
编译的时候出现com.sun.deploy.net.URLEncoder找不到的问题改成了java.net.URLEncoder 注意以后不要引用这个包了原创 2019-05-24 10:38:13 · 86 阅读 · 0 评论 -
关于java里面的时间
获取当前时间后一年的时间戳LocalDateTime.now().plusYears(1).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()原创 2019-05-23 19:27:23 · 661 阅读 · 0 评论 -
java下载图片
public static void main(String[] args) { generateImage("iVBORw0KGgoAAAANSUhEUgAAAEUAAABQCAYAAABPlrgBAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABERSURBVHhe7ZwJtFVlFc...原创 2019-05-22 20:49:32 · 1895 阅读 · 0 评论 -
正则表达式
匹配数字 String regex="^[+-]?\\d+(\\.\\d+)?$"; if (value.matches(regex) == false){ throw new CustomAttributeException(name + "不是number类型"); }原创 2019-05-17 15:04:27 · 101 阅读 · 0 评论 -
excel填充表身方法优化比较
/** * 填充表身 */ public List<MergeCell> renderBody(Column[] headRow, List<Map<String, Object>> dataList, int rowOffset, XSSFSheet sheet){ List<MergeCell>...原创 2019-05-10 09:25:11 · 153 阅读 · 0 评论 -
ckplayer服务器搭建
ckplayer服务器搭建最近要使用ckplayer播放视频,但是ckplayer需要用服务器启动,记录一下一个简单的服务器npm install http-server -g pm i http-serveryarn -g http-serverhttp-server ....原创 2019-05-20 09:51:49 · 785 阅读 · 0 评论 -
截图功能的实现
java截图public class ScheenShot { public static void main(String[] args) throws Exception { String screenFilePath = System.getProperty("user.dir") + File.separator +"shot01.png"; Fi...原创 2019-05-19 16:57:52 · 834 阅读 · 0 评论 -
字符串操作
js里面把字符串反过来'RUNOOB'.split('').reverse().join("")结果:BOONUR原创 2019-05-14 13:06:49 · 95 阅读 · 0 评论 -
java配置和多参语法
不定参函数public static String[][] expectedRows1(int r, int c, String[]... elements) { String[][] expectTable = new String[r][c]; for (int i = 0; i < r; i++) { for (int j = ...原创 2019-05-06 15:36:44 · 75 阅读 · 0 评论 -
树状图模型的实现
模型搭建基本模型子目录1根目录摄像头1摄像头2子目录2更多使用框架springdata-jpa数据库设计- createTable: tableName: CAMERA_RESOURCE columns: - column: name: TYPE ...原创 2019-07-02 16:16:47 · 1383 阅读 · 0 评论