Authored by ping

联盟

Showing 45 changed files with 904 additions and 39 deletions
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yoho</groupId>
... ... @@ -11,8 +10,36 @@
<artifactId>yoho-union</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project-name>yoho-union</project-name>
<project-version>1.0.0-SNAPSHOT</project-version>
<yoho.service.model.version>1.0.0-SNAPSHOT</yoho.service.model.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-users-dal</artifactId>
<version>${project-version}</version>
</dependency>
<dependency>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-server</artifactId>
<version>${project-version}</version>
</dependency>
<dependency>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-web</artifactId>
<version>${project-version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>yoho-union-dal</module>
<module>yoho-union-server</module>
</modules>
<module>yoho-union-web</module>
</modules>
</project>
\ No newline at end of file
... ...
... ... @@ -6,20 +6,22 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
... ...
... ... @@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
... ... @@ -15,9 +20,17 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
... ...
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
... ...
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="yoho-union-dal">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
</project-modules>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.8"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>
... ...
... ... @@ -8,9 +8,9 @@
<artifactId>yoho-union</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-dal</artifactId>
<name>yoho-union-dal</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
... ... @@ -20,5 +20,26 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<build>
<finalName>yoho-union-dal</finalName>
</build>
</project>
... ...
package com.yoho.union.dal;
import com.yoho.union.dal.model.UnionLog;
public interface IUnionLogDAO {
int insert(UnionLog record);
UnionLog selectByPrimaryKey(Integer id);
UnionLog selectByUdidAndApp(UnionLog record);
int updateByPrimaryKeySelective(UnionLog record);
int updateByPrimaryKey(UnionLog record);
}
\ No newline at end of file
... ...
package com.yoho.union.dal.model;
public class UnionLog {
private Integer id;
private String unionName;
private String app;
private String udid;
private String callbackurl;
private Integer createTime;
private String isActive;
private Integer updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUnionName() {
return unionName;
}
public void setUnionName(String unionName) {
this.unionName = unionName == null ? null : unionName.trim();
}
public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app == null ? null : app.trim();
}
public String getUdid() {
return udid;
}
public void setUdid(String udid) {
this.udid = udid == null ? null : udid.trim();
}
public String getCallbackurl() {
return callbackurl;
}
public void setCallbackurl(String callbackurl) {
this.callbackurl = callbackurl == null ? null : callbackurl.trim();
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public String getIsActive() {
return isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive == null ? null : isActive.trim();
}
public Integer getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Integer updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
... ...
package org.yoho.union.dal;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.union.dal.IUnionLogDAO">
<resultMap id="BaseResultMap" type="com.yoho.union.dal.model.UnionLog">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="union_name" property="unionName" jdbcType="VARCHAR" />
<result column="app" property="app" jdbcType="VARCHAR" />
<result column="udid" property="udid" jdbcType="VARCHAR" />
<result column="callbackurl" property="callbackurl" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="is_active" property="isActive" jdbcType="CHAR" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
id, union_name, app, udid, callbackurl, create_time, is_active,
update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from union_log
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByUdidAndApp" resultMap="BaseResultMap"
parameterType="com.yoho.union.dal.model.UnionLog">
select
<include refid="Base_Column_List" />
from union_log
where udid=#{udid} and app=#{app} limit 1
</select>
<insert id="insert" parameterType="com.yoho.union.dal.model.UnionLog">
insert into union_log (union_name, app,udid, callbackurl, create_time,is_active, update_time)
values (#{unionName,jdbcType=VARCHAR},#{app,jdbcType=VARCHAR},#{udid,jdbcType=VARCHAR}, #{callbackurl,jdbcType=VARCHAR}, UNIX_TIMESTAMP(),0, UNIX_TIMESTAMP())
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.union.dal.model.UnionLog">
update union_log
<set>
<if test="unionName != null">
union_name = #{unionName,jdbcType=VARCHAR},
</if>
<if test="app != null">
app = #{app,jdbcType=VARCHAR},
</if>
<if test="udid != null">
udid = #{udid,jdbcType=VARCHAR},
</if>
<if test="callbackurl != null">
callbackurl = #{callbackurl,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="isActive != null">
is_active = #{isActive,jdbcType=CHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.union.dal.model.UnionLog">
update union_log
set union_name = #{unionName,jdbcType=VARCHAR},
app = #{app,jdbcType=VARCHAR},
udid = #{udid,jdbcType=VARCHAR},
callbackurl = #{callbackurl,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=INTEGER},
is_active = #{isActive,jdbcType=CHAR},
update_time = #{updateTime,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -12,14 +12,15 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
... ...
... ... @@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
... ... @@ -15,9 +20,17 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
... ...
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
... ...
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="yoho-union-server">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
</wb-module>
</project-modules>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.8"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>
... ...
... ... @@ -8,17 +8,35 @@
<artifactId>yoho-union</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-server</artifactId>
<name>yoho-union-server</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-dal</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.yoho.service.model</groupId>
<artifactId>union-service-model</artifactId>
<version>1.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
</dependencies>
<build>
<finalName>yoho-union-server</finalName>
</build>
</project>
... ...
package com.yoho.union.server.service;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.union.request.AddUnionRequestBO;
import com.yoho.service.model.union.response.UnionResponseBO;
public interface IUnionService {
/**
* 用户首次下载时,联盟调用接口
* @param request
* @return
* @throws ServiceException
*/
public UnionResponseBO addUnion(AddUnionRequestBO request) throws ServiceException;
}
... ...
package com.yoho.union.server.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yoho.error.exception.ServiceException;
import com.yoho.service.model.union.request.AddUnionRequestBO;
import com.yoho.service.model.union.response.UnionResponseBO;
import com.yoho.union.dal.IUnionLogDAO;
import com.yoho.union.server.service.IUnionService;
@Service
public class UnionServiceImpl implements IUnionService {
@Resource
IUnionLogDAO unionLogDAO;
@Override
public UnionResponseBO addUnion(AddUnionRequestBO request) throws ServiceException {
System.out.println("========" + unionLogDAO.selectByPrimaryKey(1));
return null;
}
}
... ...
package org.yoho.union.server;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>yoho-union-web</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
... ...
eclipse.preferences.version=1
encoding//src/main/resources=UTF-8
encoding//src/main/resources/jdbc.properties=UTF-8
encoding/<project>=UTF-8
... ...
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
... ...
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
... ...
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="yoho-union-web">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="yoho-union-dal-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/yoho-union-dal/yoho-union-dal">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="yoho-union-server-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/yoho-union-server/yoho-union-server">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="union-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/union-service-model/union-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="error-code-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/error-code/error-code">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="sns-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/sns-service-model/sns-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="resource-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/resource-service-model/resource-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="promotion-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/promotion-service-model/promotion-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="users-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/users-service-model/users-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="product-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/product-service-model/product-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="order-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/order-service-model/order-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="message-service-model-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/message-service-model/message-service-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="yoho-union-web"/>
<property name="java-output-path" value="/yoho-union-web/target/classes"/>
</wb-module>
</project-modules>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
... ...
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
... ...
Window
\ No newline at end of file
... ...
disabled=06target
eclipse.preferences.version=1
... ...
This diff could not be displayed because it is too large.
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yoho.dsf</groupId>
<artifactId>yoho-union</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-web</artifactId>
<packaging>war</packaging>
<name>yoho-union-web Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-dal</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yoho.dsf.union</groupId>
<artifactId>yoho-union-server</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>yoho-union-web</finalName>
</build>
</project>
... ...
<?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:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<context:component-scan base-package="com.yoho" />
<mvc:annotation-driven />
<!-- 装在properties文件 -->
<context:property-placeholder location="classpath*:jdbc.properties" />
<!-- <bean id="restServiceBeanRegistry" class="com.yoho.core.rest.spring.RestServiceBeanRegistry">
<property name="registry" ref="serviceRegistry"></property>
</bean> -->
<bean id="serviceGlobalExceptionHandler" class="com.yoho.error.exception.handler.ServiceGlobalExceptionHandler"/>
<!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="stringConverter" />
<ref bean="jsonConverter" />
</list>
</property>
</bean>
<bean id="stringConverter"
class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list>
</property>
</bean>
<!-- 输出对象转JSON支持 -->
<bean id="jsonConverter"
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
</bean>
</beans>
\ No newline at end of file
... ...
<?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:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
<!-- yoho_passport 数据源 -->
<bean id="yohobuylogsMasterDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.mysql.driver}" />
<property name="url" value="${jdbc.mysql.yohobuy_logs.master.url}" />
<property name="username" value="${jdbc.mysql.yohobuy_logs.username}" />
<property name="password" value="${jdbc.mysql.yohobuy_logs.password}" />
<!-- 初始化连接大小 -->
<property name="initialSize" value="${jdbc.mysql.initialSize}"></property>
<!-- 连接池最大数量 -->
<property name="maxActive" value="${jdbc.mysql.maxActive}"></property>
<!-- 连接池最大空闲 -->
<property name="maxIdle" value="${jdbc.mysql.maxIdle}"></property>
<!-- 连接池最小空闲 -->
<property name="minIdle" value="${jdbc.mysql.minIdle}"></property>
<!-- 获取连接最大等待时间 -->
<property name="maxWait" value="${jdbc.mysql.maxWait}"></property>
<!--定时对线程池中的链接进行校验 -->
<property name="testWhileIdle" value="${jdbc.mysql.testWhileIdle}"></property>
<property name="timeBetweenEvictionRunsMillis" value="${jdbc.mysql.timeBetweenEvictionRunsMillis}"></property>
<property name="validationQuery" value="${jdbc.mysql.validationQuery}"></property>
<property name="testOnBorrow" value="${jdbc.mysql.testOnBorrow}"></property>
<property name="testOnReturn" value="${jdbc.mysql.testOnReturn}"></property>
</bean>
<bean id="yohobuylogsSlaveDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.mysql.driver}" />
<property name="url" value="${jdbc.mysql.yohobuy_logs.slave.url}" />
<property name="username" value="${jdbc.mysql.yohobuy_logs.username}" />
<property name="password" value="${jdbc.mysql.yohobuy_logs.password}" />
<!-- 初始化连接大小 -->
<property name="initialSize" value="${jdbc.mysql.initialSize}"></property>
<!-- 连接池最大数量 -->
<property name="maxActive" value="${jdbc.mysql.maxActive}"></property>
<!-- 连接池最大空闲 -->
<property name="maxIdle" value="${jdbc.mysql.maxIdle}"></property>
<!-- 连接池最小空闲 -->
<property name="minIdle" value="${jdbc.mysql.minIdle}"></property>
<!-- 获取连接最大等待时间 -->
<property name="maxWait" value="${jdbc.mysql.maxWait}"></property>
<!--定时对线程池中的链接进行校验 -->
<property name="testWhileIdle" value="${jdbc.mysql.testWhileIdle}"></property>
<property name="timeBetweenEvictionRunsMillis" value="${jdbc.mysql.timeBetweenEvictionRunsMillis}"></property>
<property name="validationQuery" value="${jdbc.mysql.validationQuery}"></property>
<property name="testOnBorrow" value="${jdbc.mysql.testOnBorrow}"></property>
<property name="testOnReturn" value="${jdbc.mysql.testOnReturn}"></property>
</bean>
<bean id="dynamicDataSource" class="com.yoho.core.dal.datasource.DynamicDataSource">
<property name="defaultTargetDataSource" ref="yohobuylogsMasterDataSource" />
<property name="targetDataSources">
<map>
<entry key="yohobuylogsMasterDataSource" value-ref="yohobuylogsMasterDataSource" />
</map>
</property>
</bean>
<bean id="multipleDataSourceRouter" class="com.yoho.core.dal.datasource.MultiDataSourceRouter">
<property name="defaultDBCluster" value="yohobuylogsDbCluster" />
<property name="readOnlyInSlave" value="${jdbc.mysql.readonlyinslave:false}" />
<property name="dbClusterSet">
<map>
<entry key="yohobuylogsDbCluster" value="yohobuylogsMasterDataSource,yohobuylogsMasterDataSource" />
</map>
</property>
<property name="daoDbClusterMap">
<map>
</map>
</property>
</bean>
<bean id="dataSourceMethodInterceptor" class="com.yoho.core.dal.datasource.DataSourceMethodInterceptor">
</bean>
<aop:config>
<aop:pointcut id="daoPoint" expression="execution(* com.yoho.*.dal.*.*(..)) " />
<aop:advisor pointcut-ref="daoPoint" advice-ref="dataSourceMethodInterceptor" />
</aop:config>
<!-- spring和MyBatis完美整合,不需要mybatis的配置映射文件 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dynamicDataSource" />
<!-- 自动扫描mapping.xml文件 -->
<property name="mapperLocations" value="classpath*:META-INF/mybatis/*.xml"></property>
</bean>
<!-- DAO接口所在包名,Spring会自动查找其下的类 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.yoho.*.dal" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>
</beans>
\ No newline at end of file
... ...
jdbc.mysql.driver=com.mysql.jdbc.Driver
#定义初始连接数
jdbc.mysql.initialSize=0
#定义最大连接数
jdbc.mysql.maxActive=80
#定义最大空闲
jdbc.mysql.maxIdle=60
#定义最小空闲
jdbc.mysql.minIdle=10
#定义最长等待时间
jdbc.mysql.maxWait=10000
jdbc.mysql.testWhileIdle=true
jdbc.mysql.timeBetweenEvictionRunsMillis=2000
jdbc.mysql.validationQuery=select 1
jdbc.mysql.testOnBorrow=true
jdbc.mysql.testOnReturn=true
#读操作是否只在从库
jdbc.mysql.readonlyinslave=false
#yoho_passport读写数据分离
jdbc.mysql.yohobuy_logs.master.url=jdbc:mysql://192.168.50.69:9980/yohobuy_logs
jdbc.mysql.yohobuy_logs.slave.url=jdbc:mysql://192.168.102.219:3306/yohobuy_logs
jdbc.mysql.yohobuy_logs.username=yh_test
jdbc.mysql.yohobuy_logs.password=yh_test
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!-- 从高到地低 OFF 、 FATAL 、 ERROR 、 WARN 、 INFO 、 DEBUG 、 TRACE 、 ALL -->
<!-- 日志输出规则 根据当前ROOT 级别,日志输出时,级别高于root默认的级别时 会输出 -->
<!-- 以下 每个配置的 filter 是过滤掉输出文件里面,会出现高级别文件,依然出现低级别的日志信息,通过filter 过滤只记录本级别的日志-->
<!-- 属性描述 scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 日志最大的历史 7天 -->
<property name="maxHistory" value="7"/>
<!-- 日志最大的文件大小 10MB-->
<property name="maxFileSize" value="10MB"/>
<!-- ConsoleAppender 控制台输出日志 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- 对日志进行格式化 -->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss,SSS} [%thread] %-5level %logger:%line -%msg%n</pattern>
</encoder>
</appender>
<!-- WARN级别日志 appender -->
<appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 过滤器,过滤掉 TRACE 和 DEBUG 和 INFO 级别的日志 -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/warn-log.log</fileNamePattern>
<!-- 日志最大的保存天数 -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger:%line - %msg%n</pattern>
</encoder>
</appender>
<!-- HTTP请求超时 appender -->
<appender name="REQUEST_TIMEOUT" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/request-timeout.log</fileNamePattern>
<!-- 日志最大的保存天数 -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}:%line -- %msg%n</pattern>
</encoder>
</appender>
<!-- 数据库请求超时 appender -->
<appender name="DATABASE_TIMEOUT" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/database-timeout.log</fileNamePattern>
<!-- 日志最大的保存天数 -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}:%line -- %msg%n</pattern>
</encoder>
</appender>
<!-- DEBUG级别日志 appender -->
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/debug-log.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger:%line - %msg%n</pattern>
</encoder>
</appender>
<!-- 数据库操作日志 -->
<logger name="java.sql.PreparedStatement" value="DEBUG" />
<logger name="java.sql.Connection" value="DEBUG" />
<logger name="java.sql.Statement" value="DEBUG" />
<logger name="com.ibatis" value="DEBUG" />
<logger name="com.ibatis.common.jdbc.SimpleDataSource" value="DEBUG" />
<logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG"/>
<logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" value="DEBUG" />
<!-- root级别 DEBUG -->
<root level="DEBUG">
<!-- 控制台输出 -->
<appender-ref ref="STDOUT" />
<!-- 文件输出 -->
<appender-ref ref="DEBUG" />
</root>
<!-- http请求处理超时日志 -->
<logger name="com.yoho.core.common.monitor.ThreadProfile" additivity="true">
<level value="DEBUG"/>
<appender-ref ref="REQUEST_TIMEOUT"/>
</logger>
</configuration>
\ No newline at end of file
... ...
order:
servers:
- http://192.168.102.205:8084/order
services:
- mergeShoppingCart:/shopping/mergeShoppingCart
product:
servers:
- http://192.168.102.205:8083/product
services:
- queryFavoriteProductrByProductIds:/product/queryFavoriteProductrByProductIds
- queryBrand:/brandSearch/queryBrand
- querymiddleCategoryList:/product/querymiddleCategoryList
- queryBrowserProduct:/browser/queryBrowserProduct
- serchFavoriteProductrByProductIds:/favorite/serchFavoriteProductrByProductIds
promotion:
servers:
- http://192.168.102.205:8085/promotion
services:
- queryCouponList:/coupon/queryCouponList
- sendCoupon:/coupon/sendCoupon
- sendChannelCoupon:/coupon/sendChannelCoupon
- sendRegCoupon:/activity/sendRegCoupon
- queryActivityList:/activity/queryActivityList
... ...
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="schedule-console" version="3.0">
<web-app>
<display-name>Archetype Created Web Application</display-name>
</web-app>
... ...
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>
... ...
package com.test;
import javax.annotation.Resource;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.yoho.union.server.service.IUnionService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath*:META-INF/spring/spring*.xml")
public class Test {
@Resource
IUnionService unionService;
@org.junit.Test
public void t() {
unionService.addUnion(null);
}
}
... ...