修复部分功能

master
星期八 5 years ago
parent 6d09d0cbeb
commit ca09811d79
  1. 24
      src/main/java/com/lq/cms/vo/SysInfoVo.java
  2. 7
      src/main/java/com/lq/code/cache/RedisShiroCache.java
  3. 2
      src/main/java/com/lq/dao/WechatKeywordDao.java
  4. 1
      src/main/java/com/lq/wechat/mode/message/BaseMessage.java
  5. 2
      src/main/java/com/lq/wechat/web/WechatController.java
  6. 2
      src/main/profile/dev/jdbc.properties
  7. 2
      src/main/resources/mybatis/mapping/SysRoleResourcePermissionDao.xml
  8. 2
      src/main/resources/mybatis/mapping/WechatKeywordDao.xml
  9. 2
      src/main/resources/spring-import.xml
  10. BIN
      src/main/webapp/resources/code/images/images404.jpg
  11. 20
      src/test/java/com/lq/code/util/os/NetUtilTest.java

@ -9,17 +9,29 @@ import com.lq.code.util.os.mode.OsInfo;
*/ */
public class SysInfoVo { public class SysInfoVo {
//服务器ip /**
* 服务器ip
*/
private String sysIp; private String sysIp;
//客服端ip /**
* 客服端ip
*/
private String userIP; private String userIP;
//操作系统信息 /**
* 操作系统信息
*/
private OsInfo osInfo; private OsInfo osInfo;
//数据库产品信息 /**
* 数据库产品信息
*/
private DbInfo dbInfo; private DbInfo dbInfo;
//服务器版本信息 /**
* 服务器版本信息
*/
private String serverInfo; private String serverInfo;
//jvm信息 /**
* jvm信息
*/
private JvmInfo jvmInfo; private JvmInfo jvmInfo;
public String getSysIp() { public String getSysIp() {

@ -7,6 +7,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import java.util.Collection; import java.util.Collection;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit;
/** /**
* @Author: qi * @Author: qi
@ -15,6 +16,11 @@ import java.util.Set;
*/ */
public class RedisShiroCache<K,V> implements Cache<K,V>{ public class RedisShiroCache<K,V> implements Cache<K,V>{
/**
* 过期时间默认2小时
*/
private int defaultExpireTime=7200;
@Autowired @Autowired
private RedisTemplate<K,V> redisTemplate; private RedisTemplate<K,V> redisTemplate;
@ -28,6 +34,7 @@ public class RedisShiroCache<K,V> implements Cache<K,V>{
@Override @Override
public V put(K k, V v) throws CacheException { public V put(K k, V v) throws CacheException {
redisTemplate.opsForValue().set(k,v); redisTemplate.opsForValue().set(k,v);
redisTemplate.expire(k,this.defaultExpireTime, TimeUnit.SECONDS);
return v; return v;
} }

@ -14,4 +14,6 @@ import java.util.List;
public interface WechatKeywordDao extends BaseDao<WechatKeyword>{ public interface WechatKeywordDao extends BaseDao<WechatKeyword>{
List<WechatKeyword> findByWechatRuleIdAndStatus(@Param("wechatRuleId") Long wehcatRuleId,@Param("status") Integer status); List<WechatKeyword> findByWechatRuleIdAndStatus(@Param("wechatRuleId") Long wehcatRuleId,@Param("status") Integer status);
List<WechatKeyword> findBykeywordAndWechatInfoId(@Param("keyword")String keyword,@Param("wechatInfoId")Long wechatInfoId);
} }

@ -2,6 +2,7 @@ package com.lq.wechat.mode.message;
/** /**
* 被动消息回复父类 * 被动消息回复父类
* @author qi
*/ */
public class BaseMessage { public class BaseMessage {
/** /**

@ -105,7 +105,7 @@ public class WechatController extends BaseController {
baseMessage.setFromUserName(wechatOpenId); baseMessage.setFromUserName(wechatOpenId);
baseMessage.setToUserName(openId); baseMessage.setToUserName(openId);
}else { }else {
// //默认回复逻辑
text.setContent("服务器繁忙!"); text.setContent("服务器繁忙!");
baseMessage = text; baseMessage = text;

@ -1,6 +1,6 @@
#--------- jdbc 配置--------- #--------- jdbc 配置---------
jdbc.driver=com.mysql.jdbc.Driver 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.user=root
jdbc.password=mysql jdbc.password=mysql
#--------数据库连接池配置 ------- #--------数据库连接池配置 -------

@ -11,7 +11,7 @@
</sql> </sql>
<select id="findByRoleId" resultType="PermissionVo"> <select id="findByRoleId" resultType="PermissionVo">
SELECT t2.id menu_id,t2.url_path menuUrl,t2.menu_name,t3.name permission_name FROM sys_role_resource_permission t1 SELECT t2.id menu_id,t2.url_path menuUrl,t2.menu_name,t3.permission_type permission_name FROM sys_role_resource_permission t1
LEFT JOIN sys_resource t2 ON t1.resource_id=t2.id LEFT JOIN sys_resource t2 ON t1.resource_id=t2.id
LEFT JOIN sys_permission t3 ON t1.permission_id=t3.id LEFT JOIN sys_permission t3 ON t1.permission_id=t3.id
WHERE t1.role_id=#{roleId} AND t1.status =1 AND t2.status =1 AND t3.status = 1 WHERE t1.role_id=#{roleId} AND t1.status =1 AND t2.status =1 AND t3.status = 1

@ -75,4 +75,6 @@
status = #{status} status = #{status}
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
</mapper> </mapper>

@ -14,7 +14,7 @@
<!-- spring 邮箱--> <!-- spring 邮箱-->
<import resource="classpath:spring/spring-email.xml"></import> <import resource="classpath:spring/spring-email.xml"></import>
<!-- 消息队列中间件 --> <!-- 消息队列中间件 -->
<import resource="classpath:spring/spring-activitMq.xml"></import> <!-- <import resource="classpath:spring/spring-activitMq.xml"></import>-->
<!-- websocket --> <!-- websocket -->
<!--<import resource="classpath:spring/spring-websocket.xml"/>--> <!--<import resource="classpath:spring/spring-websocket.xml"/>-->
</beans> </beans>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@ -0,0 +1,20 @@
package com.lq.code.util.os;
import org.junit.Test;
import static org.junit.Assert.*;
public class NetUtilTest {
@Test
public void getIP() {
String serverIp = NetUtil.getIP();
System.out.println(serverIp);
}
@Test
public void getLocalIpAddr() {
String serverIp = NetUtil.getLocalIpAddr();
System.out.println(serverIp);
}
}
Loading…
Cancel
Save