修正语法问题

master
星期八 5 years ago
parent 735207e877
commit f36b0d8816
  1. 2
      src/main/java/com/lq/code/util/Md5Util.java
  2. 4
      src/main/java/com/lq/code/util/jdbc/JdbcUtils.java
  3. 4
      src/main/java/com/lq/wechat/util/DecriptTest.java
  4. 16
      src/main/java/com/lq/wechat/web/WechatController.java
  5. 2
      src/main/profile/dev/jdbc.properties
  6. 2
      src/main/profile/dev/redis.properties

@ -17,7 +17,7 @@ public class Md5Util {
try { try {
MessageDigest md = MessageDigest.getInstance("MD5"); MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plainText.getBytes()); md.update(plainText.getBytes());
byte b[]=md.digest(); byte[] b=md.digest();
int i; int i;
StringBuffer buffer=new StringBuffer(""); StringBuffer buffer=new StringBuffer("");
for (int offset=0;offset<b.length;offset++){ for (int offset=0;offset<b.length;offset++){

@ -100,7 +100,7 @@ public class JdbcUtils {
public static void update(String sql, Object params[]) { public static void update(String sql,Object[] params) {
System.out.println(sql); System.out.println(sql);
Connection conn = null; Connection conn = null;
PreparedStatement st = null; PreparedStatement st = null;
@ -147,7 +147,7 @@ public class JdbcUtils {
} }
public static Object query(String sql, Object params[], ResultSetHandler rsh) { public static Object query(String sql, Object[] params, ResultSetHandler rsh) {
Connection conn = null; Connection conn = null;
PreparedStatement st = null; PreparedStatement st = null;
ResultSet rs = null; ResultSet rs = null;

@ -15,7 +15,7 @@ public class DecriptTest {
MessageDigest digest = MessageDigest MessageDigest digest = MessageDigest
.getInstance("SHA-1"); .getInstance("SHA-1");
digest.update(decript.getBytes()); digest.update(decript.getBytes());
byte messageDigest[] = digest.digest(); byte[] messageDigest = digest.digest();
// Create Hex String // Create Hex String
StringBuffer hexString = new StringBuffer(); StringBuffer hexString = new StringBuffer();
// 字节数组转换为 十六进制 数 // 字节数组转换为 十六进制 数
@ -39,7 +39,7 @@ public class DecriptTest {
MessageDigest digest = MessageDigest MessageDigest digest = MessageDigest
.getInstance("SHA"); .getInstance("SHA");
digest.update(decript.getBytes()); digest.update(decript.getBytes());
byte messageDigest[] = digest.digest(); byte[] messageDigest= digest.digest();
// Create Hex String // Create Hex String
StringBuffer hexString = new StringBuffer(); StringBuffer hexString = new StringBuffer();
// 字节数组转换为 十六进制 数 // 字节数组转换为 十六进制 数

@ -35,13 +35,21 @@ import java.util.Map;
public class WechatController extends BaseController { public class WechatController extends BaseController {
private static final Logger LOGGER = LoggerFactory.getLogger(WechatController.class); private static final Logger LOGGER = LoggerFactory.getLogger(WechatController.class);
//消息类型 /**
* 消息类型
*/
public static final String WECHAT_MESSAGE_TYPE_KEY = "MsgType"; public static final String WECHAT_MESSAGE_TYPE_KEY = "MsgType";
//微信公众号openId /**
* 微信公众号openId
*/
public static final String WECHAT_OPENID_KEY = "ToUserName"; public static final String WECHAT_OPENID_KEY = "ToUserName";
//接收方账号 /**
* 接收方账号
*/
public static final String WECHAT_USER_OPENID_KEY = "FromUserName"; public static final String WECHAT_USER_OPENID_KEY = "FromUserName";
//用户-消息内容 /**
* 用户-消息内容
*/
public static final String WECHAT_CONTENT_KEY = "Content"; public static final String WECHAT_CONTENT_KEY = "Content";
@Autowired @Autowired

@ -1,6 +1,6 @@
#--------- jdbc 配置--------- #--------- jdbc 配置---------
jdbc.driver=com.mysql.jdbc.Driver jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 jdbc.url=jdbc:mysql://192.168.31.110:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8
jdbc.user=root jdbc.user=root
jdbc.password=mysql jdbc.password=mysql
#--------数据库连接池配置 ------- #--------数据库连接池配置 -------

@ -1,4 +1,4 @@
redis.host=localhost redis.host=192.168.31.110
redis.port=6379 redis.port=6379
redis.pass= redis.pass=
redis.timeout=-1 redis.timeout=-1

Loading…
Cancel
Save