summaryrefslogtreecommitdiffstats
path: root/webservice/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'webservice/src/main/resources')
-rw-r--r--webservice/src/main/resources/fileManager.properties6
-rw-r--r--webservice/src/main/resources/log4j.xml77
-rw-r--r--webservice/src/main/resources/mybatis-config.xml38
-rw-r--r--webservice/src/main/resources/properties.properties7
-rw-r--r--webservice/src/main/resources/redis-config.xml50
-rw-r--r--webservice/src/main/resources/redis.properties13
-rw-r--r--webservice/src/main/resources/servlet-context.xml56
-rw-r--r--webservice/src/main/resources/spring-mybatis.xml68
8 files changed, 315 insertions, 0 deletions
diff --git a/webservice/src/main/resources/fileManager.properties b/webservice/src/main/resources/fileManager.properties
new file mode 100644
index 0000000..2f27402
--- /dev/null
+++ b/webservice/src/main/resources/fileManager.properties
@@ -0,0 +1,6 @@
+upload_path=/data/appmarket/filesystem
+upload_path_checked=/data/appmarket/filesystem
+upload_icon_path=/resource
+#upload_path=D:\appMarket\appFile
+#upload_path_checked=D:\appMarket\appFile
+
diff --git a/webservice/src/main/resources/log4j.xml b/webservice/src/main/resources/log4j.xml
new file mode 100644
index 0000000..804b762
--- /dev/null
+++ b/webservice/src/main/resources/log4j.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <context:property-placeholder location="classpath*:properties.properties" />
+ <!-- [STDOUT] -->
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="encoding" value="UTF-8" />
+ <param name="target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p %c{2} - %m%n" />
+ </layout>
+ </appender>
+
+ <!-- [Default Appender] -->
+ <appender name="DEFAULT-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${log_ws_common_default}" />
+ <param name="threshold" value="info" />
+ <param name="Append" value="true" />
+ <param name="encoding" value="UTF-8" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p %c{2} - %m%n" />
+ </layout>
+ </appender>
+
+ <!-- [Console Appender] -->
+ <appender name="CONSOLE-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${log_ws_console_default}" />
+ <param name="threshold" value="debug" />
+ <param name="Append" value="true" />
+ <param name="encoding" value="UTF-8" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p %c{2} - %m%n" />
+ </layout>
+ </appender>
+
+ <!-- [Error Appender] -->
+ <appender name="ERROR-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${log_ws_common_error}" />
+ <param name="threshold" value="error" />
+ <param name="Append" value="true" />
+ <param name="encoding" value="UTF-8" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p %c{2} - %m%n" />
+ </layout>
+ </appender>
+
+ <!-- [Componet Appender] -->
+ <appender name="COMPONENT-APPENDER" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${log_ws_logistics_component}" />
+ <param name="Append" value="true" />
+ <param name="encoding" value="UTF-8" />
+ <param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p %c{2} - %m%n" />
+ </layout>
+ </appender>
+
+ <!-- [Componet log] -->
+ <logger name="LOGISTICS-COMPONENT">
+ <level value="debug" />
+ <appender-ref ref="console" />
+ <appender-ref ref="COMPONENT-APPENDER" />
+ <appender-ref ref="ERROR-APPENDER" />
+ </logger>
+
+ <!-- Root Logger -->
+ <root>
+ <level value="debug"></level>
+ <appender-ref ref="console" />
+ <appender-ref ref="DEFAULT-APPENDER" />
+ <appender-ref ref="CONSOLE-APPENDER" />
+ <appender-ref ref="ERROR-APPENDER" />
+ </root>
+</log4j:configuration> \ No newline at end of file
diff --git a/webservice/src/main/resources/mybatis-config.xml b/webservice/src/main/resources/mybatis-config.xml
new file mode 100644
index 0000000..4537ceb
--- /dev/null
+++ b/webservice/src/main/resources/mybatis-config.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE configuration
+PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-config.dtd">
+<configuration>
+ <typeAliases>
+ <typeAlias alias="Authority" type="app.market.model.authority.Authority" />
+ <typeAlias alias="AuthorityExample" type="app.market.model.authority.AuthorityExample" />
+ <typeAlias alias="AuthorityResourceLinkExample" type="app.market.model.authority.AuthorityResourceLinkExample" />
+ <typeAlias alias="AuthorityResourceLinkKey" type="app.market.model.authority.AuthorityResourceLinkKey" />
+
+ <typeAlias alias="Resource" type="app.market.model.resource.Resource" />
+ <typeAlias alias="ResourceExample" type="app.market.model.resource.ResourceExample" />
+ <typeAlias alias="Dictionary" type="app.market.model.resource.Dictionary" />
+ <typeAlias alias="DictionaryExample" type="app.market.model.resource.DictionaryExample" />
+
+ <typeAlias alias="User" type="app.market.model.user.User" />
+ <typeAlias alias="UserExample" type="app.market.model.user.UserExample" />
+ <typeAlias alias="UserAuthorityLinkExample" type="app.market.model.user.UserAuthorityLinkExample" />
+ <typeAlias alias="UserAuthorityLinkKey" type="app.market.model.user.UserAuthorityLinkKey" />
+
+ <typeAlias alias="App" type="app.market.model.app.App" />
+ <typeAlias alias="AppExample" type="app.market.model.app.AppExample" />
+ <typeAlias alias="AppVersion" type="app.market.model.app.AppVersion" />
+ <typeAlias alias="AppVersionExample" type="app.market.model.app.AppVersionExample" />
+ </typeAliases>
+
+ <mappers>
+ <mapper resource="app/market/persistence/xml/app/AppMapper.xml" />
+ <mapper resource="app/market/persistence/xml/app/AppVersionMapper.xml" />
+ <mapper resource="app/market/persistence/xml/authority/AuthorityMapper.xml" />
+ <mapper resource="app/market/persistence/xml/authority/AuthorityResourceLinkMapper.xml" />
+ <mapper resource="app/market/persistence/xml/resource/ResourceMapper.xml" />
+ <mapper resource="app/market/persistence/xml/resource/DictionaryMapper.xml" />
+ <mapper resource="app/market/persistence/xml/user/UserAuthorityLinkMapper.xml" />
+ <mapper resource="app/market/persistence/xml/user/UserMapper.xml" />
+ </mappers>
+</configuration> \ No newline at end of file
diff --git a/webservice/src/main/resources/properties.properties b/webservice/src/main/resources/properties.properties
new file mode 100644
index 0000000..8da8bda
--- /dev/null
+++ b/webservice/src/main/resources/properties.properties
@@ -0,0 +1,7 @@
+#file path
+log_ws_common_default=/data/appmarket/log/webservice/common-default.log
+log_ws_console_default=/data/appmarket/log/webservice/console-default.log
+log_ws_common_error=/data/appmarket/log/webservice/common-error.log
+log_ws_logistics_component=/data/appmarket/log/webservice/logistics-component.log
+
+webservice_base_uri=http://localhost:8080/webservice \ No newline at end of file
diff --git a/webservice/src/main/resources/redis-config.xml b/webservice/src/main/resources/redis-config.xml
new file mode 100644
index 0000000..3751034
--- /dev/null
+++ b/webservice/src/main/resources/redis-config.xml
@@ -0,0 +1,50 @@
+<?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:aop="http://www.springframework.org/schema/aop"
+ xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"
+ default-autowire="byName" default-lazy-init="true">
+
+ <context:component-scan base-package="app.market.token.*"/>
+
+ <!-- scanner redis properties -->
+ <context:property-placeholder location="classpath*:redis.properties" />
+
+ <bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
+ <property name="maxIdle" value="${redis.maxIdle}" />
+ <property name="maxTotal" value="${redis.maxActive}" />
+ <property name="maxWaitMillis" value="${redis.maxWait}" />
+ <property name="testOnBorrow" value="${redis.testOnBorrow}" />
+ </bean>
+
+ <!-- redis server center -->
+ <bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" destroy-method="destroy">
+ <property name="hostName" value="${redis.host}" />
+ <property name="password" value="${redis.password}" />
+ <property name="port" value="${redis.port}" />
+ <property name="poolConfig" ref="poolConfig" />
+ <!-- <property name="timeout" value="${redis.timeout}" /> -->
+ </bean>
+
+ <bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
+ <property name="connectionFactory" ref="connectionFactory" />
+ <property name="keySerializer">
+ <bean class="org.springframework.data.redis.serializer.StringRedisSerializer" />
+ </property>
+ <property name="valueSerializer">
+ <bean class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer" />
+ </property>
+ <!-- <property name="hashKeySerializer">
+ <bean class="org.springframework.data.redis.serializer.StringRedisSerializer"/>
+ </property>
+ <property name="hashValueSerializer">
+ <bean class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer"/>
+ </property> -->
+ </bean>
+
+ <!-- <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" /> -->
+</beans> \ No newline at end of file
diff --git a/webservice/src/main/resources/redis.properties b/webservice/src/main/resources/redis.properties
new file mode 100644
index 0000000..4c37bce
--- /dev/null
+++ b/webservice/src/main/resources/redis.properties
@@ -0,0 +1,13 @@
+#redis setting
+redis.host=localhost
+redis.port=6379
+redis.password=appmarket
+redis.maxIdle=300
+redis.maxActive=600
+redis.maxWait=1000
+redis.testOnBorrow=true
+#time unit=minutes
+redis.timeout=10
+redis.refreshtimeout=72
+
+fep.local.cache.capacity=10000 \ No newline at end of file
diff --git a/webservice/src/main/resources/servlet-context.xml b/webservice/src/main/resources/servlet-context.xml
new file mode 100644
index 0000000..6302892
--- /dev/null
+++ b/webservice/src/main/resources/servlet-context.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:mvc="http://www.springframework.org/schema/mvc"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-4.0.xsd
+ http://www.springframework.org/schema/mvc
+ http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
+
+ <!-- activate @Controller -->
+ <mvc:annotation-driven>
+ <mvc:message-converters register-defaults="true">
+ <bean class="org.springframework.http.converter.StringHttpMessageConverter">
+ <constructor-arg value="UTF-8"></constructor-arg>
+ <property name="supportedMediaTypes" value="text/plain;charset=UTF-8"/>
+ </bean>
+ </mvc:message-converters>
+ </mvc:annotation-driven>
+
+ <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
+ <!-- scan webservice -->
+ <context:component-scan base-package="app.market.webservice.*" />
+ <!-- <context:component-scan base-package="app.market.core.*">
+ <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
+ <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
+ </context:component-scan> -->
+ <!-- import redis config -->
+ <import resource="redis-config.xml"/>
+
+ <bean class="app.market.webservice.InitServer"></bean>
+
+ <!-- interceptors -->
+ <mvc:interceptors>
+ <mvc:interceptor>
+ <mvc:mapping path="/**"/>
+ <bean class="app.market.token.interceptor.AuthenticationTokenInterceptor"/>
+ </mvc:interceptor>
+ </mvc:interceptors>
+
+ <bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
+ <property name="supportedMediaTypes">
+ <list>
+ <value>text/html;charset=UTF-8</value>
+ </list>
+ </property>
+ </bean>
+
+ <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
+ <property name="maxUploadSize" value="268435456"/>
+ </bean>
+</beans> \ No newline at end of file
diff --git a/webservice/src/main/resources/spring-mybatis.xml b/webservice/src/main/resources/spring-mybatis.xml
new file mode 100644
index 0000000..7abc6ae
--- /dev/null
+++ b/webservice/src/main/resources/spring-mybatis.xml
@@ -0,0 +1,68 @@
+<?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:p="http://www.springframework.org/schema/p"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-4.0.xsd
+ http://www.springframework.org/schema/tx
+ http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
+ http://www.springframework.org/schema/aop
+ http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util-4.0.xsd">
+
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="driverClassName" value="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost:3306/appmarket?characterEncoding=UTF-8&amp;allowMultiQueries=true" />
+ <property name="username" value="root" />
+ <property name="password" value="123456" />
+ </bean>
+
+ <bean name="paginationInterceptor" class="app.market.persistence.interceptor.PaginationInterceptor"></bean>
+
+ <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
+ <property name="dataSource" ref="dataSource"></property>
+ <property name="configLocation" value="classpath:mybatis-config.xml" />
+ <property name="plugins">
+ <list>
+ <ref bean="paginationInterceptor" />
+ </list>
+ </property>
+ </bean>
+
+ <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
+ <property name="basePackage" value="app.market.persistence.mapper"></property>
+ <property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
+ </bean>
+
+ <context:component-scan base-package="app.market.core.*">
+ <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
+ </context:component-scan>
+
+ <tx:annotation-driven transaction-manager="txManager" />
+
+ <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+ <property name="dataSource" ref="dataSource" />
+ </bean>
+
+ <aop:config>
+ <aop:pointcut id="fooServiceMethods" expression="execution(public * app.market.core.*.impl.*(..))" />
+ <aop:advisor advice-ref="txAdvice" pointcut-ref="fooServiceMethods" />
+ </aop:config>
+
+ <tx:advice id="txAdvice" transaction-manager="txManager">
+ <tx:attributes>
+ <tx:method name="select*" read-only="true" />
+ <tx:method name="get*" read-only="true" />
+ <tx:method name="count*" read-only="true" />
+ <tx:method name="insert*" propagation="REQUIRED" rollback-for="java.lang.RuntimeException" />
+ <tx:method name="save*" propagation="REQUIRED" rollback-for="java.lang.RuntimeException" />
+ <tx:method name="update*" propagation="REQUIRED" rollback-for="java.lang.RuntimeException" />
+ <tx:method name="delete*" propagation="REQUIRED" rollback-for="java.lang.RuntimeException" />
+ </tx:attributes>
+ </tx:advice>
+</beans> \ No newline at end of file