From e1aa19638ccebb622025e3193576b4e558e40694 Mon Sep 17 00:00:00 2001 From: lishengzhao Date: Thu, 20 Mar 2014 11:56:33 +0800 Subject: [PATCH] Change to wdcy --- .../java/cc/wdcy/domain/dto/AbstractDto.java | 43 --------- .../java/cc/wdcy/domain/dto/user/UserDto.java | 94 ------------------- .../cc/wdcy/domain/dto/user/UserFormDto.java | 73 -------------- src/main/resources/mybatis.xml | 4 +- ...perties => spring-oauth-server.properties} | 0 src/main/resources/spring/context.xml | 2 +- src/main/webapp/index.jsp | 14 +++ 7 files changed, 17 insertions(+), 213 deletions(-) delete mode 100644 src/main/java/cc/wdcy/domain/dto/AbstractDto.java delete mode 100644 src/main/java/cc/wdcy/domain/dto/user/UserDto.java delete mode 100644 src/main/java/cc/wdcy/domain/dto/user/UserFormDto.java rename src/main/resources/{database.properties => spring-oauth-server.properties} (100%) diff --git a/src/main/java/cc/wdcy/domain/dto/AbstractDto.java b/src/main/java/cc/wdcy/domain/dto/AbstractDto.java deleted file mode 100644 index cd58219..0000000 --- a/src/main/java/cc/wdcy/domain/dto/AbstractDto.java +++ /dev/null @@ -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; - } -} \ No newline at end of file diff --git a/src/main/java/cc/wdcy/domain/dto/user/UserDto.java b/src/main/java/cc/wdcy/domain/dto/user/UserDto.java deleted file mode 100644 index e7d21a1..0000000 --- a/src/main/java/cc/wdcy/domain/dto/user/UserDto.java +++ /dev/null @@ -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 toDtos(List users) { - List dtoList = new ArrayList<>(users.size()); - for (User user : users) { - dtoList.add(new UserDto(user)); - } - return dtoList; - } -} \ No newline at end of file diff --git a/src/main/java/cc/wdcy/domain/dto/user/UserFormDto.java b/src/main/java/cc/wdcy/domain/dto/user/UserFormDto.java deleted file mode 100644 index 1272cdd..0000000 --- a/src/main/java/cc/wdcy/domain/dto/user/UserFormDto.java +++ /dev/null @@ -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; - } -} \ No newline at end of file diff --git a/src/main/resources/mybatis.xml b/src/main/resources/mybatis.xml index d680a45..9056921 100644 --- a/src/main/resources/mybatis.xml +++ b/src/main/resources/mybatis.xml @@ -15,8 +15,8 @@ - - + + diff --git a/src/main/resources/database.properties b/src/main/resources/spring-oauth-server.properties similarity index 100% rename from src/main/resources/database.properties rename to src/main/resources/spring-oauth-server.properties diff --git a/src/main/resources/spring/context.xml b/src/main/resources/spring/context.xml index d226e4a..57781ce 100644 --- a/src/main/resources/spring/context.xml +++ b/src/main/resources/spring/context.xml @@ -16,7 +16,7 @@ - classpath:database.properties + classpath:spring-oauth-server.properties diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index d4d7bb8..5147823 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -23,6 +23,20 @@

spring-oauth is work!

Logout + +
+ 操作说明: +
    +
  1. + 菜单 User 是不需要Oauth 验证即可访问的,
    + 但菜单 Unity 与 Mobile 需要Oauth 验证后才能访问. +
  2. +
  3. + 在项目的 others目录里有 oauth_test.txt文件, 里面有测试的URL地址(包括浏览器与客户端的), + 若想访问 Unity 与 Mobile, 则先用基于浏览器的测试URL 访问,等验证通过后即可访问. +
  4. +
+