diff --git a/.gitignore b/.gitignore
index 4be73d9..97caa67 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,6 +48,7 @@ src/test/resources/font
src/main/resources/WEB-INF/vm/outFile
target/
*.back
+!/src/main/youhong_ai_jitu_src/selfdev/util/log
# 老项目代码
#/lib/jitulib/
#/lib/classbean
diff --git a/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java b/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java
index f728648..bc39ea2 100644
--- a/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java
+++ b/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java
@@ -323,6 +323,16 @@ public class HttpUtils {
return baseRequest(httpConnection, httpGet);
}
+ /**
+ *
删除方法调用
+ *
+ * @param url 地址
+ * @param params 参数
+ * @param headers 请求头
+ * @return 请求结果
+ * @throws IOException 异常
+ */
+
public ResponeVo apiDelete(String url, Map params, Map headers) throws IOException {
Map paramsMap = paramsHandle(params);
String getUrl = urlHandle(url, paramsMap);
diff --git a/src/main/youhong_ai_jitu_src/selfdev/util/log/LogTool.java b/src/main/youhong_ai_jitu_src/selfdev/util/log/LogTool.java
new file mode 100644
index 0000000..22a8a3b
--- /dev/null
+++ b/src/main/youhong_ai_jitu_src/selfdev/util/log/LogTool.java
@@ -0,0 +1,111 @@
+package selfdev.util.log;
+
+import java.io.BufferedWriter;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.IOException;
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import weaver.general.BaseBean;
+import weaver.general.GCONST;
+
+/**
+ * 日志工具类
+ * @author KangMD
+ * 1、2019-01-29 add by KangMD
+ */
+
+public class LogTool {
+ private BufferedWriter logPrint;
+ private String logFile = "";
+ private String logPath="";
+ private boolean systemlog=false;//是否写系统日记
+ static SimpleDateFormat newDf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ static SimpleDateFormat df =new SimpleDateFormat("yyyy-MM-dd");
+ static BaseBean log=new BaseBean();
+ public LogTool(){
+ //if(logFile == null || logFile.trim().equals("") || !logFile.equals(getLogFile())){
+ // newLog();
+ //}
+ }
+ public LogTool(String logPath,boolean systemlog){
+ this.logPath=logPath;
+ this.systemlog=systemlog;
+ }
+ private String getLogFile(){
+ //获取当前系统路径
+ String sysPath=GCONST.getRootPath();
+ if(sysPath==null){
+ sysPath=System.getProperty("user.dir");
+ }
+ if(!"".equals(logPath)){
+ if(logPath.endsWith("/")){
+ sysPath += logPath+df.format(new Date())+".log";
+ }else{
+ sysPath += logPath+"/"+df.format(new Date())+".log";
+ }
+ }else {
+ sysPath += "/log/dev/"+df.format(new Date())+".log";
+ }
+ return sysPath;
+ }
+
+ private void newLog(){
+ logFile = getLogFile();
+ try{
+ //logPrint = new PrintWriter(new FileWriter(logFile, true), true);
+ logPrint = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (logFile,true),"UTF-8"));
+ }catch(IOException e){
+ try{
+ File file=new File(logFile);
+ if(!file.getParentFile().exists()) {
+ //如果目标文件所在的目录不存在,则创建父目录
+ if(file.getParentFile().mkdirs()){
+ file.createNewFile();
+ }
+ }
+ //logPrint = new PrintWriter(new FileWriter(logFile, true), true);
+ logPrint = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (logFile,true),"UTF-8"));
+ }catch(IOException ex){
+ log.writeLog("Log记录出错了",ex);
+ }
+ }
+ }
+
+ public void writeLog(Object msg) {
+ if(systemlog){
+ log.writeLog(msg);
+ }
+ newLog();
+ try {
+ logPrint.write(newDf.format(new Date()) + ": " + msg);
+ logPrint.newLine();//每次换行
+ logPrint.flush();
+ logPrint.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ public void writeLog(String msg,Throwable e) {
+ if(systemlog){
+ log.writeLog(msg,e);
+ }
+ newLog();
+ try {
+ logPrint.write(newDf.format(new Date()) + ": " + msg);
+ logPrint.newLine();//每次换行
+ //e.printStackTrace(logPrint);
+ logPrint.flush();
+ logPrint.close();
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ }
+}
\ No newline at end of file