Merge remote-tracking branch 'origin/master'

master
星期八 4 years ago
commit 869209dea2
  1. 4
      src/main/java/com/lq/code/util/mybatis/plus/CreateMapperFileUtil.java
  2. 8
      src/main/java/com/lq/wechat/util/IoUtil.java
  3. 9
      src/main/java/com/lq/wechat/util/MessageUtil.java
  4. 2
      src/main/profile/test/redis.properties
  5. 1
      src/main/resources/spring/spring-redis.xml

@ -5,11 +5,7 @@ import com.lq.code.util.sql.AbstractDbBuiler;
import com.lq.code.util.sql.MysqlBuilder;
import com.lq.code.util.sql.SqlUtil;
import com.lq.dao.SysPermissionDao;
import com.lq.dao.WechatKeywordDao;
import com.lq.dao.WechatRuleMessageDao;
import com.lq.entity.SysPermission;
import com.lq.entity.WechatKeyword;
import com.lq.entity.WechatRuleMessage;
import java.io.File;
import java.io.IOException;

@ -11,11 +11,15 @@ import java.io.InputStreamReader;
*/
public class IoUtil {
/**
* 流转字符串
* @param inputStream
* @return
*/
public static String convertStreamToString(InputStream inputStream){
BufferedReader reader=new BufferedReader(new InputStreamReader(inputStream));
StringBuilder sb=new StringBuilder();
String line=null;
String line;
try {
while ((line=reader.readLine())!=null){
sb.append(line+"\n");

@ -20,8 +20,10 @@ import java.util.Map;
* @author qi
*/
public class MessageUtil {
/**
* 默认字符编辑
*/
public static final String DEFAULT_ENCODING="utf8";
/**
* xml map对象
@ -31,7 +33,6 @@ public class MessageUtil {
* @throws DocumentException
*/
public static Map<String, String> xmlToMap(HttpServletRequest req) throws IOException, DocumentException{
SAXReader reader=new SAXReader();
InputStream ins=req.getInputStream();
String resultString=IoUtil.convertStreamToString(ins);
Document doc=DocumentHelper.parseText(resultString);
@ -51,7 +52,7 @@ public class MessageUtil {
* @return
*/
public static String MessageToXml(Object obj){
XStream xstream = new XStream(new DomDriver("utf8"));
XStream xstream = new XStream(new DomDriver(DEFAULT_ENCODING));
// 识别obj类中的注解
xstream.processAnnotations(obj.getClass());
/*

@ -1,6 +1,6 @@
redis.host=127.0.0.1
redis.port=6379
redis.pass=
redis.pass=liangqi@redis
redis.timeout=-1
redis.maxTotal=15

@ -63,6 +63,7 @@
<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" destroy-method="destroy"
p:hostName="${redis.host}"
p:port="${redis.port}"
p:password="${redis.pass}"
p:poolConfig-ref="jedisConfig"
/>

Loading…
Cancel
Save