From 54bf07e1d64442920e0cb6405643e56878488960 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Fri, 19 Apr 2019 06:12:33 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=202.=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E9=87=8D?= =?UTF-8?q?=E5=86=99=E6=96=B9=E6=B3=95=E6=B2=A1=E6=9C=89=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lq/code/dao/impl/BaseDaoImpl.java | 10 +- .../lq/code/service/impl/BaseServiceImpl.java | 2 +- src/main/java/com/lq/code/util/HttpKit.java | 6 +- src/main/java/com/lq/code/util/TestUtil.java | 106 +++++++++++------- .../lq/code/util/email/MyAuthenticator.java | 1 + src/main/java/com/lq/dao/SysRoleDao.java | 2 +- .../com/lq/wechat/util/WechatUserUtil.java | 5 + src/main/resources/dev/jdbc.properties | 2 +- src/main/resources/dev/redis.properties | 2 +- .../mybatis/mapping/WechatInfoDao.xml | 7 +- src/main/resources/pro/jdbc.properties | 6 +- .../views/jsp/cms/wechat/info/index.jsp | 8 +- .../webapp/WEB-INF/views/jsp/error/403.jsp | 3 +- src/main/webapp/WEB-INF/web.xml | 6 +- 14 files changed, 95 insertions(+), 71 deletions(-) diff --git a/src/main/java/com/lq/code/dao/impl/BaseDaoImpl.java b/src/main/java/com/lq/code/dao/impl/BaseDaoImpl.java index 2625d4a..ce92ab0 100755 --- a/src/main/java/com/lq/code/dao/impl/BaseDaoImpl.java +++ b/src/main/java/com/lq/code/dao/impl/BaseDaoImpl.java @@ -1,6 +1,7 @@ package com.lq.code.dao.impl; import com.lq.code.dao.BaseDao; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; @@ -17,14 +18,7 @@ import java.util.List; */ public class BaseDaoImpl implements BaseDao { - public final static String SQL_TYPE_INSERT="INSERT"; - - public final static String SQL_TYPE_UPDATE="UPDATE"; - - public final static String SQL_TYPE_DELETE="DELETE"; - - - @Resource + @Autowired(required = false) private JdbcTemplate jdbcTemplate; private NamedParameterJdbcTemplate namedParameterJdbcTemplate; diff --git a/src/main/java/com/lq/code/service/impl/BaseServiceImpl.java b/src/main/java/com/lq/code/service/impl/BaseServiceImpl.java index a8485f9..1f52d4f 100755 --- a/src/main/java/com/lq/code/service/impl/BaseServiceImpl.java +++ b/src/main/java/com/lq/code/service/impl/BaseServiceImpl.java @@ -10,7 +10,7 @@ import java.util.List; * Created by qi_liang on 2018/6/21. */ public abstract class BaseServiceImpl implements BaseService{ - + @Override public abstract BaseDao getBaseDao(); @Override diff --git a/src/main/java/com/lq/code/util/HttpKit.java b/src/main/java/com/lq/code/util/HttpKit.java index 066ac5b..dc443d3 100755 --- a/src/main/java/com/lq/code/util/HttpKit.java +++ b/src/main/java/com/lq/code/util/HttpKit.java @@ -199,15 +199,15 @@ public class HttpKit { * 证书管理 */ class MyX509TrustManager implements X509TrustManager { - + @Override public X509Certificate[] getAcceptedIssuers() { return null; } - + @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { } - + @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { } diff --git a/src/main/java/com/lq/code/util/TestUtil.java b/src/main/java/com/lq/code/util/TestUtil.java index 51d30dc..58844f4 100755 --- a/src/main/java/com/lq/code/util/TestUtil.java +++ b/src/main/java/com/lq/code/util/TestUtil.java @@ -17,48 +17,70 @@ import java.util.*; */ public class TestUtil { - public static void main(String[] args) throws IOException { - - // new TestUtil().showURL(); - // Document document = Jsoup.connect("https://www.oschina.net/").get(); - // System.out.println(document.body()); - // InetAddress address = InetAddress.getLocalHost(); - // String ip = address.getHostAddress().toLowerCase(); - // System.out.println(ip); - new HashMap<>(8); - } - - - public void showURL() throws IOException, IOException { - - // 第一种:获取类加载的根路径 D:\git\daotie\daotie\target\classes - File f = new File(this.getClass().getResource("/").getPath()); - System.out.println(f); - - // 获取当前类的所在工程路径; 如果不加“/” 获取当前类的加载目录 D:\git\daotie\daotie\target\classes\my - File f2 = new File(this.getClass().getResource("").getPath()); - System.out.println(f2); - - // 第二种:获取项目路径 D:\git\daotie\daotie - File directory = new File("");// 参数为空 - String courseFile = directory.getCanonicalPath(); - System.out.println(courseFile); - - - // 第三种: file:/D:/git/daotie/daotie/target/classes/ - URL xmlpath = this.getClass().getClassLoader().getResource(""); - System.out.println(xmlpath); - - - // 第四种: D:\git\daotie\daotie - System.out.println(System.getProperty("user.dir")); - /* - * 结果: C:\Documents and Settings\Administrator\workspace\projectName - * 获取当前工程路径 - */ - - // 第五种: 获取所有的类路径 包括jar包的路径 - System.out.println(System.getProperty("java.class.path")); +// public static void main(String[] args) throws IOException { +// +// // new TestUtil().showURL(); +// // Document document = Jsoup.connect("https://www.oschina.net/").get(); +// // System.out.println(document.body()); +// // InetAddress address = InetAddress.getLocalHost(); +// // String ip = address.getHostAddress().toLowerCase(); +// // System.out.println(ip); +// new HashMap<>(8); +// } +// +// +// public void showURL() throws IOException, IOException { +// +// // 第一种:获取类加载的根路径 D:\git\daotie\daotie\target\classes +// File f = new File(this.getClass().getResource("/").getPath()); +// System.out.println(f); +// +// // 获取当前类的所在工程路径; 如果不加“/” 获取当前类的加载目录 D:\git\daotie\daotie\target\classes\my +// File f2 = new File(this.getClass().getResource("").getPath()); +// System.out.println(f2); +// +// // 第二种:获取项目路径 D:\git\daotie\daotie +// File directory = new File("");// 参数为空 +// String courseFile = directory.getCanonicalPath(); +// System.out.println(courseFile); +// +// +// // 第三种: file:/D:/git/daotie/daotie/target/classes/ +// URL xmlpath = this.getClass().getClassLoader().getResource(""); +// System.out.println(xmlpath); +// +// +// // 第四种: D:\git\daotie\daotie +// System.out.println(System.getProperty("user.dir")); +// /* +// * 结果: C:\Documents and Settings\Administrator\workspace\projectName +// * 获取当前工程路径 +// */ +// +// // 第五种: 获取所有的类路径 包括jar包的路径 +// System.out.println(System.getProperty("java.class.path")); +// +// } + + public static void main(String[] args) { + int [] a = new int[78]; + int [] b= new int[79]; + int [] result = new int[99*99]; + for (int i =0;i10){ + sum = sumNum%10; + }else { + sum = 0; + } + result[j]= sumNum/10; + } + } } } diff --git a/src/main/java/com/lq/code/util/email/MyAuthenticator.java b/src/main/java/com/lq/code/util/email/MyAuthenticator.java index 4be9113..517cfc0 100755 --- a/src/main/java/com/lq/code/util/email/MyAuthenticator.java +++ b/src/main/java/com/lq/code/util/email/MyAuthenticator.java @@ -22,6 +22,7 @@ public class MyAuthenticator extends Authenticator { this.userName=userName; this.password=password; } + @Override protected PasswordAuthentication getPasswordAuthentication(){ return new PasswordAuthentication(userName, password); } diff --git a/src/main/java/com/lq/dao/SysRoleDao.java b/src/main/java/com/lq/dao/SysRoleDao.java index 6069c0e..2dec877 100755 --- a/src/main/java/com/lq/dao/SysRoleDao.java +++ b/src/main/java/com/lq/dao/SysRoleDao.java @@ -14,7 +14,7 @@ import java.util.Map; public interface SysRoleDao extends BaseDao { List findByUserId(@Param("userId") Long userId); - + @Override List findAll(); Integer count(SysRoleVo vo); diff --git a/src/main/java/com/lq/wechat/util/WechatUserUtil.java b/src/main/java/com/lq/wechat/util/WechatUserUtil.java index 0e50061..88222db 100755 --- a/src/main/java/com/lq/wechat/util/WechatUserUtil.java +++ b/src/main/java/com/lq/wechat/util/WechatUserUtil.java @@ -32,4 +32,9 @@ public class WechatUserUtil { WechatUser wechatUser = JSONObject.parseObject(result,WechatUser.class); return wechatUser; } + + public static void main(String[] args) { + + + } } diff --git a/src/main/resources/dev/jdbc.properties b/src/main/resources/dev/jdbc.properties index 8741005..cf92f01 100644 --- a/src/main/resources/dev/jdbc.properties +++ b/src/main/resources/dev/jdbc.properties @@ -1,6 +1,6 @@ #--------- jdbc 配置--------- jdbc.driver=com.mysql.jdbc.Driver -jdbc.url=jdbc:mysql://192.168.31.19:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 +jdbc.url=jdbc:mysql://localhost:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 jdbc.user=root jdbc.password=mysql #--------数据库连接池配置 ------- diff --git a/src/main/resources/dev/redis.properties b/src/main/resources/dev/redis.properties index bc1f169..3cd757e 100644 --- a/src/main/resources/dev/redis.properties +++ b/src/main/resources/dev/redis.properties @@ -1,4 +1,4 @@ -redis.host=192.168.31.19 +redis.host=127.0.0.1 redis.port=6379 redis.pass= redis.timeout=-1 diff --git a/src/main/resources/mybatis/mapping/WechatInfoDao.xml b/src/main/resources/mybatis/mapping/WechatInfoDao.xml index 0c69619..3ff3c68 100644 --- a/src/main/resources/mybatis/mapping/WechatInfoDao.xml +++ b/src/main/resources/mybatis/mapping/WechatInfoDao.xml @@ -7,7 +7,7 @@ - id,wechat_open_id,app_secpet,create_time,app_id,encoding_type,wechat_name,url,token,encoding_aes_key,last_update_time,status + id,wechat_open_id,app_secpet,create_time,app_id,encoding_type,wechat_name,url,token,encoding_aes_key,last_update_time,status,wechat_info_type