Skip to content
This repository has been archived by the owner on Dec 25, 2019. It is now read-only.

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
crossoverJie authored and 陈杰 committed Apr 5, 2017
1 parent 5f3216b commit 09ca17f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 42 deletions.
48 changes: 16 additions & 32 deletions SSM-API/src/main/java/com/crossoverJie/dto/UserInfoRsp.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,35 @@
import java.io.Serializable;

public class UserInfoRsp implements Serializable {
private int userId ;
private String username ;
private String password ;
private String description ;
private int age ;
private Integer id;
private String userName;
private String password;
private Integer roleId ;



public int getUserId() {
return userId;
public Integer getId() {
return id;
}

public void setUserId(int userId) {
this.userId = userId;
public void setId(Integer id) {
this.id = id;
}

public String getUsername() {
return username;
public String getUserName() {
return userName;
}

public void setUsername(String username) {
this.username = username;
public void setUserName(String userName) {
this.userName = userName;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public int getAge() {
return age;
public Integer getRoleId() {
return roleId;
}

public void setAge(int age) {
this.age = age;
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void before(JoinPoint point) {
Class<?> aClass = point.getTarget().getClass();

//获取包名用于区分不同数据源
String whichDataSource = aClass.getName().substring(25, aClass.getName().lastIndexOf("."));
String whichDataSource = aClass.getName().substring(35, aClass.getName().lastIndexOf("."));
if ("ssmone".equals(whichDataSource)) {
DataSourceHolder.setDataSources(Constants.DATASOURCE_ONE);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public UserInfoRsp getUserInfo(int userId) throws Exception {
* @param t_user
*/
private void buildUserInfoRsp(UserInfoRsp userInfoRsp, T_user t_user) {
if (t_user == null){
t_user = new T_user() ;
}
CommonUtil.setLogValueModelToModel(t_user,userInfoRsp);
}
}
2 changes: 1 addition & 1 deletion SSM-SERVICE/src/main/resources/config.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#dubbo配置
dubbo.protocol.port=2181
dubbo.protocol.port=20880
dubbo.registry.address=zookeeper://192.168.0.188:2181
dubbo.registry.file=/tmp/dubbo.cachr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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.crossoverJie.dao.DatasourceMapper">
<mapper namespace="com.crossoverJie.api.dubbo.dao.DatasourceMapper">
<resultMap id="BaseResultMap" type="com.crossoverJie.api.dubbo.pojo.Datasource">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="name" property="name" jdbcType="VARCHAR"/>
Expand Down
10 changes: 3 additions & 7 deletions SSM-SERVICE/src/main/resources/mapping/T_userMapper.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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.crossoverJie.dao.T_userDao" >
<mapper namespace="com.crossoverJie.api.dubbo.dao.T_userDao" >
<resultMap id="BaseResultMap" type="com.crossoverJie.api.dubbo.pojo.T_user" >
<result property="id" column="id"/>
<result property="userName" column="userName"/>
Expand All @@ -26,14 +26,10 @@
</select>

<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from user
where userId = #{userid,jdbcType=INTEGER}
from t_user
where id = #{userid,jdbcType=INTEGER}
</select>

</mapper>

0 comments on commit 09ca17f

Please sign in to comment.