Skip to content

Commit

Permalink
front-end init.
Browse files Browse the repository at this point in the history
  • Loading branch information
aizk committed Jul 1, 2017
1 parent 654a95d commit 32fbd6f
Show file tree
Hide file tree
Showing 201 changed files with 47,625 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class RedisUtil {
//port
private static int PORT = PropertiesFileUtil.getInstance("redis").getInt("master.redis.port");
//password
private static String PASSWORD = AESUtil.AESDecode(PropertiesFileUtil.getInstance("redis").get("master.redis.password"));
private static String PASSWORD = PropertiesFileUtil.getInstance("redis").get("master.redis.password");
// max active connection
private static int MAX_ACTIVE = PropertiesFileUtil.getInstance("redis").getInt("master.redis.max_active");

Expand Down
29 changes: 29 additions & 0 deletions vua-common/src/main/resources/applicationContext.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd">

<!-- 装载service -->
<context:component-scan base-package="**.service" />

<!-- 装载自定义bean -->
<context:component-scan base-package="**.*" use-default-filters="false">
<context:include-filter type="assignable" expression="com.vua.common.base.BaseInterface"></context:include-filter>
</context:component-scan>

<!-- 启动时初始化Spring上下文环境工具类 -->
<bean id="springContextUtil" class="com.vua.common.util.SpringContextUtil"></bean>

<!-- 启动任务注解 -->
<task:annotation-driven />
<context:component-scan base-package="**.task" />

</beans>
15 changes: 15 additions & 0 deletions vua-common/src/main/resources/springMVC-servlet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@
</mvc:message-converters>
</mvc:annotation-driven>

<!-- i18n国际化 -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<!-- 找不到key时用key作为返回值 -->
<property name="useCodeAsDefaultMessage" value="false"/>
<!-- 资源刷新时间 -->
<property name="cacheSeconds" value="60"/>
<!-- 资源文件列表 -->
<property name="basenames">
<list>
<value>classpath:i18n/messages</value>
</list>
</property>
<property name="defaultEncoding" value="UTF-8"/>
</bean>

<!--配置静态资源-->
<mvc:resources mapping="/resources/**" location="/resource/" cache-period="10"/>
<mvc:resources mapping="swagger-ui.html" location="classpath:/META-INF/resources"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
<property name="loginUrl" value="${sso.server.url}" />
<property name="successUrl" value="${upms.successUrl}" />
<property name="unauthorizedUrl" value="${upms.unauthorizedUrl}" />
<property name="loginUrl" value="${vua.upms.sso.server.url}" />
<property name="successUrl" value="${vua.upms.successUrl}" />
<property name="unauthorizedUrl" value="${vua.upms.unauthorizedUrl}" />

<property name="filters" >
<util:map>
Expand Down Expand Up @@ -55,7 +55,7 @@

<!-- 会话管理器 -->
<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<property name="globalSessionTimeout" value="${upms.session.timeout}" />
<property name="globalSessionTimeout" value="${vua.upms.session.timeout}" />
<property name="sessionDAO" ref="sessionDAO" />
<property name="sessionIdCookieEnabled" value="true" />
<property name="sessionIdCookie" ref="sessionIdCookie" />
Expand All @@ -77,7 +77,7 @@
<!-- 过期时间 -1表示关闭浏览器过期 -->
<property name="maxAge" value="-1" />
<!-- Cookie名称 -->
<property name="name" value="${upms.session.id}" />
<property name="name" value="${vua.upms.session.id}" />
</bean>

<bean id="sessionListener" class="com.vua.upms.client.shiro.listener.UpmsSessionListener" />
Expand All @@ -97,7 +97,7 @@
<!-- 不会暴露给客户端 -->
<property name="httpOnly" value="true"/>
<!-- 记住我cookie生效时间 -->
<property name="maxAge" value="${upms.rememberMe.timeout}"/>
<property name="maxAge" value="${vua.upms.rememberMe.timeout}"/>
</bean>

<!-- 设置SecurityUtils,相当于调用SecurityUtils.setSecurityManager(securityManager) -->
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
import org.springframework.transaction.annotation.Transactional;

/**
* UpmsRoleService实现
* Created on 2017/6/24.
*/
* UpmsRoleService实现
* Created on 2017/6/24.
*/
@Service
@Transactional
@BaseService
public class UpmsRoleServiceImpl extends BaseServiceImpl<UpmsRoleMapper, UpmsRole, UpmsRoleExample> implements UpmsRoleService {

private static Logger _log = LoggerFactory.getLogger(UpmsRoleServiceImpl.class);
private static Logger _log = LoggerFactory.getLogger(UpmsRoleServiceImpl.class);

@Autowired
UpmsRoleMapper upmsRoleMapper;
@Autowired
UpmsRoleMapper upmsRoleMapper;

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
import org.springframework.transaction.annotation.Transactional;

/**
* UpmsSystemService实现
* Created on 2017/6/24.
*/
* UpmsSystemService实现
* Created on 2017/6/24.
*/
@Service
@Transactional
@BaseService
public class UpmsSystemServiceImpl extends BaseServiceImpl<UpmsSystemMapper, UpmsSystem, UpmsSystemExample> implements UpmsSystemService {

private static Logger _log = LoggerFactory.getLogger(UpmsSystemServiceImpl.class);
private static Logger _log = LoggerFactory.getLogger(UpmsSystemServiceImpl.class);

@Autowired
UpmsSystemMapper upmsSystemMapper;
@Autowired
UpmsSystemMapper upmsSystemMapper;

}
18 changes: 18 additions & 0 deletions vua-upms/vua-upms-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,23 @@
</dependencies>
<build>
<finalName>vua-upms-server</finalName>

<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.7.v20150116</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<webApp>
<contextPath>/</contextPath>
</webApp>
<httpConnector>
<port>1111</port>
</httpConnector>
<reload>automatic</reload>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
<dubbo:consumer check="false"/>

<!--接口服务-->
<dubbo:reference interface="com.vua.upms.rpc.api.UpmsApiService" mock="true"/>
<dubbo:reference id="upmsApiService" interface="com.vua.upms.rpc.api.UpmsApiService" mock="true"/>
<!--系统-->
<dubbo:reference interface="com.vua.upms.rpc.api.UpmsSystemService" mock="true"/>
<dubbo:reference id="upmsSystemService" interface="com.vua.upms.rpc.api.UpmsSystemService" mock="true"/>
<!--组织-->
<dubbo:reference interface="com.vua.upms.rpc.api.UpmsOrganizationService" mock="true"/>
<dubbo:reference id="upmsOrganizationService" interface="com.vua.upms.rpc.api.UpmsOrganizationService" mock="true"/>
<!--用户组织-->
<dubbo:reference interface="com.vua.upms.rpc.api.UpmsUserOrganizationService" mock="true"/>
<dubbo:reference id="upmsUserOrganizationService" interface="com.vua.upms.rpc.api.UpmsUserOrganizationService" mock="true"/>
<!-- 用户 -->
<dubbo:reference id="upmsUserService" interface="com.vua.upms.rpc.api.UpmsUserService" mock="true"/>
<!-- 角色 -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- 线程池配置 -->
<bean id="threadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<!-- 线程池维护线程的最少数量 -->
<property name="corePoolSize" value="50"/>
<!-- 线程池维护线程的最大数量,默认为Integer.MAX_VALUE -->
<property name="maxPoolSize" value="1000"/>
<!-- 线程池所使用的缓冲队列,一般需要设置值>=notifyScheduledMainExecutor.maxNum;默认为Integer.MAX_VALUE -->
<property name="queueCapacity" value="20000"/>
<!-- 线程池维护线程所允许的空闲时间,默认为60s -->
<property name="keepAliveSeconds" value="300"/>
<!-- 线程池对拒绝任务(无线程可用)的处理策略,目前只支持AbortPolicy、CallerRunsPolicy;默认为后者 -->
<property name="rejectedExecutionHandler">
<!-- AbortPolicy:直接抛出java.util.concurrent.RejectedExecutionException异常 -->
<!-- CallerRunsPolicy:主线程直接执行该任务,执行完之后尝试添加下一个任务到线程池中,可以有效降低向线程池内添加任务的速度 -->
<!-- DiscardOldestPolicy:抛弃旧的任务、暂不支持;会导致被丢弃的任务无法再次被执行 -->
<!-- DiscardPolicy:抛弃当前任务、暂不支持;会导致被丢弃的任务无法再次被执行 -->
<bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy"/>
</property>
</bean>

</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
403=Access forbidden!
404=Page not found!
500=Internal server error!
error=Server error!
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
403=\u6CA1\u6709\u6743\u9650\uFF01
404=\u9875\u9762\u6CA1\u6709\u627E\u5230\uFF01
500=\u5185\u90E8\u670D\u52A1\u5668\u9519\u8BEF\uFF01
error=\u670D\u52A1\u5668\u53D1\u751F\u9519\u8BEF\uFF01
30 changes: 30 additions & 0 deletions vua-upms/vua-upms-server/src/main/resources/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#off/fatal/error/warn/info/debug/all
log4j.debug=false
log4j.rootLogger=info,stdout,log,errorlog

# Console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n

### Log ###
log4j.appender.log = org.apache.log4j.DailyRollingFileAppender
log4j.appender.log.File = ../logs/zheng-upms-server.log
log4j.appender.log.Append = true
log4j.appender.log.Threshold = DEBUG
log4j.appender.log.DatePattern='.'yyyy-MM-dd
log4j.appender.log.layout = org.apache.log4j.PatternLayout
log4j.appender.log.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %C{1}.java :%L(%M)] %m%n

### Error ###
log4j.appender.errorlog = org.apache.log4j.DailyRollingFileAppender
log4j.appender.errorlog.File = ../logs/zheng-upms-server.error.log
log4j.appender.errorlog.Append = true
log4j.appender.errorlog.Threshold = ERROR
log4j.appender.errorlog.DatePattern='.'yyyy-MM-dd
log4j.appender.errorlog.layout = org.apache.log4j.PatternLayout
log4j.appender.errorlog.layout.ConversionPattern =%-d{yyyy-MM-dd HH:mm:ss} [ %p ] [ %C{1}.java :%L(%M)] %m%n

#Spring logging configuration
log4j.category.org.springframework = warn
7 changes: 7 additions & 0 deletions vua-upms/vua-upms-server/src/main/resources/redis.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
master.redis.ip=127.0.0.1
master.redis.port=6379
master.redis.password=''
master.redis.max_active=500
master.redis.max_idle=5
master.redis.max_wait=10000
master.redis.timeout=10000
33 changes: 33 additions & 0 deletions vua-upms/vua-upms-server/src/main/resources/shiro-ehcache.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<ehcache name="shirocache">

<diskStore path="java.io.tmpdir/vua-upms-server/shiro-ehcache"/>

<cache name="authorizationCache"
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">
</cache>

<cache name="authenticationCache"
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">
</cache>

<cache name="shiro-activeSessionCache"
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">
</cache>

</ehcache>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

vua.upms.type=server

vua.upms.session.id=vua-upms-server-session-id

vua.upms.session.timeout=1800000
#login url
vua.upms.sso.server.url=127.0.0.1:1111

vua.upms.successUrl=/manage/index

vua.upms.unauthorizedUrl=/403

vua.upms.rememberMe.timeout=2592000
Loading

0 comments on commit 32fbd6f

Please sign in to comment.