mysql单条sql批量新增封装
人活一生,值得爱的东西很多,不要因为一个不满意,就灰心。——路遥 前两天写了mp自定义sql注入 今天对其进行了二次封装: 首先是目录: 源码地址:https://gitee.com/VampireAchao/stream-query 使用方式: 12345678910111213@Testvoid testSaveOneSql() { UserInfo entity = new UserInfo(); entity.setName("cat"); entity.setAge(20); entity.setEmail("achao1441470436@gmail.com"); UserInfo userInfo = new UserInfo(); userInfo.setName("ruben"); List<UserInfo> list = Arrays.asList(userInfo, entity); boolean isSuccess =...
sql注入工具类
日出之美便在于它脱胎于最深的黑暗。——辛夷坞 在mybatis-plus中内置了该工具类: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950/* * Copyright (c) 2011-2022, baomidou (jobob@qq.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, s...
mp自定义sql注入
我有一瓢酒,可以慰风尘。——韦应物 以mysql语法INSERT INTO user_info (name,age,email) VALUES ( ?,?,? ),( ?,?,? )举例: 首先注入自定义策略 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869package io.github.vampireachao.stream.plugin.mybatisplus.injector;import com.baomidou.mybatisplus.annotation.IdType;import com.baomidou.mybatisplus.core.injector.AbstractMethod;import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;import com.baomidou...
科大讯飞NLP黑白名单上传
“你喜欢一个人,就像喜欢富士山。你可以看到它,但是不能搬走它。你有什么方法可以移动一座富士山呢?回答是,你自己走过去。爱情也是如此,逛过就已经足够。”——林夕 介绍:对接科大讯飞NLP 贴代码,其中一些常量在上面有: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758package org.example;import cn.hutool.core.codec.Base64;import cn.hutool.core.lang.Console;import cn.hutool.core.lang.Opt;import cn.hutool.core.map.MapUtil;import cn.hutool.core.text.CharSequenceUtil;import cn.hutool.http.HttpUtil;import cn.hutool.json.JSONObject;import cn.hutool...
js修改复制到剪贴板的内容
祝你今天愉快,你明天的愉快留着我明天再祝。——《爱你就像爱生命》 MDN:https://developer.mozilla.org/zh-CN/docs/Web/API/Element/copy_event demo: 123456789101112131415161718192021222324252627<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>copy</title></head>&...
stream拓展
开成花灾的玫瑰不是灿烂,而是荒凉。——严歌苓 源码地址:https://gitee.com/VampireAchao/stream-query/blob/master/stream-core/src/main/java/io/github/vampireachao/stream/core/stream/Steam.java 测试用例: https://gitee.com/VampireAchao/stream-query/blob/master/stream-core/src/test/java/io/github/vampireachao/stream/core/stream/SteamTest.java 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798...
申请jetbrain开源key
醉过才知酒浓,爱过才知情重。你不能做我的诗,正如我不能做你的梦。——胡适 申请链接: https://www.jetbrains.com/shop/eform/opensource?product=ALL 进去随便填一填 然后就会有人发邮件给你 然后回复一下 然后等待审核通过,告诉你只能用来写开源项目,不能用于商业用途 然后会再发你一封邮件包含一个链接,打开就可以了
对接科大讯飞NLP
“未知苦处,不信神佛。”——Priest《杀破狼》 这里对接的是文本纠错 git仓库: https://gitee.com/VampireAchao/simple-kdxf-nlp.git api文档: https://www.xfyun.cn/doc/nlp/textCorrection/API.html#%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E 引入maven依赖 12345<dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.8.4</version></dependency> 然后在 resources目录下添加 app.setting配置文件(也可以用 spring配置文件或者硬编码,随便你) 编写配置文件 12345678910111213# --------------------------...
反射获取声明泛型工具类
和上帝一样聪明,和天才一样幼稚。——巴尔扎克《奥诺丽纳》 工具类: 1234567891011121314151617public static Type[] getGenericTypes(Type paramType) { Type type; for (type = paramType; type instanceof Class; type = ((Class<?>) type).getGenericSuperclass()) { if (Object.class.equals(type)) { Type[] genericInterfaces = ((Class<?>) type).getGenericInterfaces(); if (genericInterfaces.length > 0 && Objects.nonNull(genericInterfaces[0])) { ...
h2从1.4.200升级到2.1.212
鲸落海底,哺暗界众生十五年。——加里·斯奈德 如果直接修改GAV版本号 12345<dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>2.1.212</version></dependency> 你会获得一堆报错 下面是我的ddl: 123456789101112131415161718192021222324drop table if exists user_info;create table if not exists user_info( id BIGINT(20) AUTO_INCREMENT NOT NULL COMMENT '主键ID', name VARCHAR(30) NULL DEFAULT NULL COMMENT '姓名', age...
