随笔分类 - Java
摘要:@Resource private ICustomFunctionService customFunctionService; @PostConstruct private void init() { LambdaQueryWrapper<CustomFunctionEo> wrapper = Wr
阅读全文
摘要:#!/bin/bash source /etc/profile ################################### # Please change these parameters according to your real env. #####################
阅读全文
摘要:public static enum AmisChartType { @JsonProperty("line") LINE("line", "折线图"), @JsonProperty("bar") BAR("bar", "柱状图"), @JsonProperty("pie") PIE("pie",
阅读全文
摘要:1. 一般的后管在分页列表管理里都有导出功能 我们的项目是先有分页管理,后面需求要求所有的分页再增加导出功用,所以后端采用统一导出的策略 根据不同业务场景,多次调用对应的分页接口,然后统一输出到excel里 2. 对应的配置类(后期将配置转化到数据库里) import cn.hutool.core.
阅读全文
摘要:1. @ApiOperation(value = "导出记录") @PostMapping("/excel") public ResponseEntity<byte[]> export(@RequestParam String type, @RequestBody JSONObject obj) {
阅读全文
摘要:1. 修改 nginx 大小限制 (250M) 在 metadata: annotations: 下增加 nginx.ingress.kubernetes.io/proxy-body-size: 250m apiVersion: extensions/v1beta1 kind: Ingress me
阅读全文
摘要:import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoad
阅读全文
摘要:import net.sf.jsqlparser.expression.operators.conditional.AndExpression; import net.sf.jsqlparser.parser.CCJSqlParserUtil; import net.sf.jsqlparser.sc
阅读全文
摘要:import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.
阅读全文
摘要:格式为 1. (仿 java) 魔法数 1A2B占2个字节 2. 主版本号占1个字节(0~255) 3. 次版本号占1个字节(0~255) 可供升级的版本为 6W多个,基本够用了 /** * 1. 魔法数 1A2B占2个字节 * 2. 主版本号占1个字节(0~255) * 3. 次版本号占1个字节(
阅读全文
摘要:1. LRU缓存 (Least Recently Used 删除最近未使用缓存) 在get/put时,将当前结点移到头部; 那么尾部自然是最近未使用的key import java.util.Map; import java.util.WeakHashMap; /** * LRU缓存 (Least
阅读全文
摘要:1.maven依赖 <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.co
阅读全文
摘要:1. 事件时间提取器 class CustomerStatusChangedWatermark extends AscendingTimestampExtractor<CustomerStatusChangedEvent> { @Override public long extractAscendi
阅读全文
摘要:<flink.version>1.10.2</flink.version> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-java</artifactId> <version>${flink.version}</
阅读全文
摘要:1. public class Bitmap { /** * bitmap实际存储处 */ private byte[] buf; /** * 偏移基准位 */ private int base; /** * .ctor * * @param capacity bitmap总长度 * @param
阅读全文
摘要:1. ModelsSortHelper import com.google.common.base.Strings; import org.springframework.beans.BeanUtils; import org.springframework.util.Assert; import
阅读全文
摘要:1.新建配置中心服务端项目 g2-spring-cloud-config-service 加入 pom依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:
阅读全文
摘要:参考 https://www.pianshen.com/article/9462214176/ http://www.360doc.com/content/17/1030/11/412471_699395136.shtml 1.安装git 这里暂时不考虑gitlab ,因为是私人研究用的,暂时不需要
阅读全文
摘要:public static String readText(File file) { StringBuilder result = new StringBuilder(); try (FileReader reader = new FileReader(file);) { int count = 0
阅读全文
摘要:动态代理常用的有两种实现方式,一是java自带的方式,一种是cglib提供的 mybatis使用cglib的动态代理生成mapper实例 这里模拟一下两种实现 常用的mybatis操作数据库的方式如下: 定义一下接口,里面的每个方式对应 *Mapper.xml(如bookMapper.xml)的每个
阅读全文