springboot单元测试
每个圣人都有过去,每个罪人都有未来。 ――王尔德 我们在开发中经常会进行测试,如果是需要springboot环境,我们就可以使用spring-boot-starter-test 引入依赖 1234567891011<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </...
vue路由NavigationDuplicated错误
有志者,事竟成,破釜沉舟,百二秦关终属楚;苦心人,天不负,卧薪尝胆,三千越甲可吞吴。——蒲松龄 如果遇到了Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location异常 可以在router里配置一下 1234567891011121314151617181920import Vue from 'vue'import Router from 'vue-router'// 解决路由重复问题const originalPush = Router.prototype.pushRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err)}Vue.use(Router)export default new Router({...
实用避免空指针的工具类
一星陨落,黯淡不了星空灿烂;一花凋零,荒芜不了整个春天。——巴尔扎克 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495package com.ruben.utils;import com.ruben.pojo.User;import org.thymeleaf.expression.Lists;import sun.reflect.misc.ReflectUtil;import java.math.BigDecimal;import java.util.ArrayList;import java.util.List;import java.util.Optional;import java.util.concurrent.atomic.AtomicReference;...
elementUI隐藏组件
追求使你充实,成功和失败都是伴奏。——史铁生 关于ElementUI相信大家只要看过我这篇博客,都能有一定的了解 今天聊聊ElementUI官方文档都找不到的一个隐藏组件 那便是滚动条el-scrollbar 我们在开发中可能会用到数据量稍微多一点点的情况 例如我这里写的一个v-for 123456789<div style="width: 20%"> <div v-for="(item, i) in tableData" :key="i"> <div v-text="item.name"></div> <div v-text="item.name"></div> <div v-text="item.name"></div> <div v-text="item.name"></div> &...
js打字机动画效果实现
坦白使人心地轻松的妙药。——西塞罗 实现打字机效果 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> ...
set取交集、并集、差集
蜡烛的美是绝唱的美,它以自焚的痛苦将自己化为光和热,照亮了别人。——鲁迅 123456789101112131415HashSet<String> hashSet = new HashSet<>(Arrays.asList("0", "1", "2"));HashSet<String> hashSet2 = new HashSet<>(Arrays.asList("1", "2", "3"));// 取交集hashSet.retainAll(hashSet2);hashSet.forEach(System.out::println);System.out.println();HashSet<String> hashSet3 = new HashSet<>(Arrays.asList("0", "1", "2"));// 取并集h...
mybatis-plus基本使用
如果一个人不知道他要驶向哪个码头,那么任何风都不会是顺风。——小塞涅卡 上回我们写到封装了axios的工具类 今天我把OSS上传文件接了,可以去项目目录自取 前端项目:https://gitee.com/VampireAchao/my-vue-app.git 后端项目:https://gitee.com/VampireAchao/simple-springboot.git 传统代码以点到为止,所以这里就不再多聊OSS,想了解可以看这篇博客 然后我们聊聊mybatis-plus的基本使用 首先引入依赖,这个没什么好说的 12345<dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.1.0</version></dependency> 然后我们按照之前创的表去对应新建一个DO 因为之前我们的表结构为这样【T...
Streamのlist链表转换
如果人生有也能有第二版,我将会如何认真地修改校对!——克莱尔 直接上代码! 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970package com.ruben;/** * @ClassName: ListNodeDemo * @Date: 2020/11/21 0021 00:06 * @Description: */import java.util.Comparator;import java.util.List;import java.util.concurrent.atomic.AtomicInteger;import java.util.function.Function;import java.util.stream.Collectors;import java.util.stream.Stream;/** * @ClassName: ListNodeDe...
vue封装axios请求工具类
以勇气面对人生的巨大悲恸,用耐心对待生活的小小哀伤。——雨果 首先安装 12345678# axioscnpm i --save axios# 格式化参数插件cnpm i -- save qs# 对象合并插件cnpm i -- save lodash# cookie操作cnpm i -- save vue-cookie 然后我们自己封装一个请求组件 首先创建文件 然后放入我们的代码。。。 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132import ...
使用stream流连接两个list
生命如同寓言,其价值不在于长短,而在于内容—— 塞涅卡 1234567List<Integer> integerList = Arrays.stream(new int[]{1, 2, 3}).boxed().collect(Collectors.toList());List<Integer> collect = Stream.concat(integerList.stream(), integerList.stream()).collect(Collectors.toList());collect.forEach(System.out::print);System.out.println();collect = Stream.of(integerList, integerList).flatMap(List::stream).collect(Collectors.toList());collect.forEach(System.out::print);System.out.println();
