Change to wdcy
parent
31f24a5808
commit
e1aa19638c
|
@ -1,43 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013 Honyee Industry Group Co., Ltd
|
|
||||||
* www.honyee.biz
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is the confidential and proprietary information of
|
|
||||||
* Honyee Industry Group Co., Ltd ("Confidential Information").
|
|
||||||
* You shall not disclose such Confidential Information and shall use
|
|
||||||
* it only in accordance with the terms of the license agreement you
|
|
||||||
* entered into with Honyee Industry Group Co., Ltd.
|
|
||||||
*/
|
|
||||||
package cc.wdcy.domain.dto;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Shengzhao Li
|
|
||||||
*/
|
|
||||||
public abstract class AbstractDto implements Serializable {
|
|
||||||
|
|
||||||
protected String guid;
|
|
||||||
|
|
||||||
protected AbstractDto() {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected AbstractDto(String guid) {
|
|
||||||
this.guid = guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isNewly() {
|
|
||||||
return StringUtils.isEmpty(guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGuid() {
|
|
||||||
return guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGuid(String guid) {
|
|
||||||
this.guid = guid;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013 Honyee Industry Group Co., Ltd
|
|
||||||
* www.honyee.biz
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is the confidential and proprietary information of
|
|
||||||
* Honyee Industry Group Co., Ltd ("Confidential Information").
|
|
||||||
* You shall not disclose such Confidential Information and shall use
|
|
||||||
* it only in accordance with the terms of the license agreement you
|
|
||||||
* entered into with Honyee Industry Group Co., Ltd.
|
|
||||||
*/
|
|
||||||
package cc.wdcy.domain.dto.user;
|
|
||||||
|
|
||||||
import cc.wdcy.domain.dto.AbstractDto;
|
|
||||||
import cc.wdcy.domain.user.User;
|
|
||||||
import cc.wdcy.infrastructure.DateUtils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Shengzhao Li
|
|
||||||
*/
|
|
||||||
public class UserDto extends AbstractDto {
|
|
||||||
|
|
||||||
protected String username;
|
|
||||||
protected String createDate;
|
|
||||||
|
|
||||||
protected String phone;
|
|
||||||
protected String email;
|
|
||||||
protected boolean defaultUser;
|
|
||||||
|
|
||||||
|
|
||||||
public UserDto() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserDto(User user) {
|
|
||||||
super(user.guid());
|
|
||||||
this.username = user.username();
|
|
||||||
this.createDate = DateUtils.toDateText(user.createTime());
|
|
||||||
|
|
||||||
this.phone = user.phone();
|
|
||||||
this.email = user.email();
|
|
||||||
this.defaultUser = user.defaultUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDefaultUser() {
|
|
||||||
return defaultUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefaultUser(boolean defaultUser) {
|
|
||||||
this.defaultUser = defaultUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUsername() {
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreateDate() {
|
|
||||||
return createDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateDate(String createDate) {
|
|
||||||
this.createDate = createDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPhone() {
|
|
||||||
return phone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPhone(String phone) {
|
|
||||||
this.phone = phone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEmail() {
|
|
||||||
return email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEmail(String email) {
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<UserDto> toDtos(List<User> users) {
|
|
||||||
List<UserDto> dtoList = new ArrayList<>(users.size());
|
|
||||||
for (User user : users) {
|
|
||||||
dtoList.add(new UserDto(user));
|
|
||||||
}
|
|
||||||
return dtoList;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013 Honyee Industry Group Co., Ltd
|
|
||||||
* www.honyee.biz
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This software is the confidential and proprietary information of
|
|
||||||
* Honyee Industry Group Co., Ltd ("Confidential Information").
|
|
||||||
* You shall not disclose such Confidential Information and shall use
|
|
||||||
* it only in accordance with the terms of the license agreement you
|
|
||||||
* entered into with Honyee Industry Group Co., Ltd.
|
|
||||||
*/
|
|
||||||
package cc.wdcy.domain.dto.user;
|
|
||||||
|
|
||||||
import cc.wdcy.domain.user.User;
|
|
||||||
import cc.wdcy.infrastructure.PasswordHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Shengzhao Li
|
|
||||||
*/
|
|
||||||
public class UserFormDto extends UserDto {
|
|
||||||
|
|
||||||
private String password;
|
|
||||||
private String rePassword;
|
|
||||||
|
|
||||||
private String existUsername;
|
|
||||||
|
|
||||||
public UserFormDto() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserFormDto(User user) {
|
|
||||||
super(user);
|
|
||||||
this.existUsername = user.username();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserFormDto(String guid) {
|
|
||||||
this.guid = guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isNewly() {
|
|
||||||
return super.isNewly() || "create".equalsIgnoreCase(guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
public User toDomain() {
|
|
||||||
String encryptPass = PasswordHandler.encryptPassword(password);
|
|
||||||
return new User(username, encryptPass, phone, email);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getPassword() {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRePassword() {
|
|
||||||
return rePassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRePassword(String rePassword) {
|
|
||||||
this.rePassword = rePassword;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExistUsername() {
|
|
||||||
return existUsername;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExistUsername(String existUsername) {
|
|
||||||
this.existUsername = existUsername;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,8 +15,8 @@
|
||||||
</typeAliases>
|
</typeAliases>
|
||||||
|
|
||||||
<mappers>
|
<mappers>
|
||||||
<mapper resource="cc/honyee/infrastructure/mybatis/UserMapper.xml"/>
|
<mapper resource="cc/wdcy/infrastructure/mybatis/UserMapper.xml"/>
|
||||||
<mapper resource="cc/honyee/infrastructure/mybatis/OauthMapper.xml"/>
|
<mapper resource="cc/wdcy/infrastructure/mybatis/OauthMapper.xml"/>
|
||||||
|
|
||||||
</mappers>
|
</mappers>
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||||
<property name="locations">
|
<property name="locations">
|
||||||
<list>
|
<list>
|
||||||
<value>classpath:database.properties</value>
|
<value>classpath:spring-oauth-server.properties</value>
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
|
@ -23,6 +23,20 @@
|
||||||
<body>
|
<body>
|
||||||
<h3>spring-oauth is work!</h3>
|
<h3>spring-oauth is work!</h3>
|
||||||
<a href="${contextPath}/logout.do">Logout</a>
|
<a href="${contextPath}/logout.do">Logout</a>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
操作说明:
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
菜单 User 是不需要Oauth 验证即可访问的, <br/>
|
||||||
|
但菜单 Unity 与 Mobile 需要Oauth 验证后才能访问.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
在项目的 others目录里有 oauth_test.txt文件, 里面有测试的URL地址(包括浏览器与客户端的),
|
||||||
|
若想访问 Unity 与 Mobile, 则先用基于浏览器的测试URL 访问,等验证通过后即可访问.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="${contextPath}/user/overview.htm">User</a>
|
<a href="${contextPath}/user/overview.htm">User</a>
|
||||||
|
|
Loading…
Reference in New Issue