This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8081; | |
server_name 10.255.203.162; | |
#charset koi8-r; | |
#access_log logs/host.access.log main; | |
location / { | |
root C:\Users\zyl\Documents\Axure\HTML; | |
try_files $uri $uri/ @router; | |
index index.html start.html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ps -ef | grep dbservice | grep -v grep | awk '{print $2}' | xargs kill -9 | |
sleep 3 | |
cd /home/user/dbservice | |
nohup /usr/local/java/jdk1.8.0_231/bin/java -jar dbservice-1.0-SNAPSHOT.jar >> dbservice.log 2>&1 & | |
Windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//循环遍历多级文件名并打印 | |
public static void getFile(File file){ | |
if(file != null){ | |
File[] f = file.listFiles(); | |
if(f != null){ | |
for (File value : f) { | |
getFile(value); | |
} | |
}else{ | |
System.out.println(file); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
使用Oracle函数生成主键,时间+4位随机 | |
CREATE OR REPLACE PACKAGE BODY sys_helper_pkg IS | |
FUNCTION get_key_id RETURN INTEGER IS | |
v_key_id INTEGER; | |
v_unix_timestamp INTEGER; | |
v_random_value CHAR(4); | |
BEGIN | |
v_unix_timestamp := (SYSDATE - to_date('2019-10-01', 'yyyy-mm-dd')) * | |
86400; | |
v_random_value := lpad(seq_random_value.nextval, 4, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
springboot项目添加如下依赖: | |
<dependency> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
<optional>true</optional> | |
</dependency> | |
<dependency> | |
<groupId>com.baomidou</groupId> | |
<artifactId>mybatis-plus-boot-starter</artifactId> | |
<version>3.2.0</version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.ytkj.abims.common.vo.Result; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.ui.Model; | |
import org.springframework.web.bind.WebDataBinder; | |
import org.springframework.web.bind.annotation.ExceptionHandler; | |
import org.springframework.web.bind.annotation.InitBinder; | |
import org.springframework.web.bind.annotation.ModelAttribute; | |
import org.springframework.web.bind.annotation.RestControllerAdvice; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration scan="true" scanPeriod="30 seconds" debug="true"> | |
<property name="LOG_HOME" value="logs"/> | |
<!--获取比info级别高(包括info级别)但除error级别的日志--> | |
<appender name="INFO-LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
<level>ERROR</level> | |
<onMatch>DENY</onMatch> | |
<onMismatch>ACCEPT</onMismatch> | |
</filter> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
共三步: | |
1. springboot-maven项目,引入依赖: | |
<dependency> | |
<groupId>com.github.jai-imageio</groupId> | |
<artifactId>jai-imageio-core</artifactId> | |
<version>1.4.0</version> | |
</dependency> | |
<dependency> | |
<groupId>net.java.dev.jna</groupId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.alibaba.fastjson.JSONObject; | |
import org.apache.commons.httpclient.HttpClient; | |
import org.apache.commons.httpclient.HttpMethod; | |
import org.apache.commons.httpclient.methods.GetMethod; | |
import org.apache.commons.httpclient.methods.PostMethod; | |
import org.apache.http.*; | |
public class HttpClient{ | |
/** | |
* 发送application/json的post请求 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.alibaba.fastjson.JSON; | |
import com.fasterxml.jackson.databind.JavaType; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import java.text.SimpleDateFormat; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.List; |
NewerOlder