parent
91fbc033e7
commit
04fbf5adea
|
@ -0,0 +1,166 @@
|
|||
package cc.wdcy.domain.dto;
|
||||
|
||||
import cc.wdcy.domain.oauth.OauthClientDetails;
|
||||
import cc.wdcy.infrastructure.DateUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Shengzhao Li
|
||||
*/
|
||||
public class OauthClientDetailsDto implements Serializable {
|
||||
|
||||
|
||||
private String createTime;
|
||||
private boolean archived;
|
||||
|
||||
private String clientId;
|
||||
private String resourceIds;
|
||||
|
||||
private String clientSecret;
|
||||
|
||||
private String scope;
|
||||
|
||||
private String authorizedGrantTypes;
|
||||
|
||||
private String webServerRedirectUri;
|
||||
|
||||
private String authorities;
|
||||
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
// optional
|
||||
private String additionalInformation;
|
||||
|
||||
private boolean trusted;
|
||||
|
||||
public OauthClientDetailsDto() {
|
||||
}
|
||||
|
||||
public OauthClientDetailsDto(OauthClientDetails clientDetails) {
|
||||
this.clientId = clientDetails.clientId();
|
||||
this.clientSecret = clientDetails.clientSecret();
|
||||
this.scope = clientDetails.scope();
|
||||
|
||||
this.createTime = DateUtils.toDateTime(clientDetails.createTime());
|
||||
this.archived = clientDetails.archived();
|
||||
this.resourceIds = clientDetails.resourceIds();
|
||||
|
||||
this.webServerRedirectUri = clientDetails.webServerRedirectUri();
|
||||
this.authorities = clientDetails.authorities();
|
||||
this.accessTokenValidity = clientDetails.accessTokenValidity();
|
||||
|
||||
this.refreshTokenValidity = clientDetails.refreshTokenValidity();
|
||||
this.additionalInformation = clientDetails.additionalInformation();
|
||||
this.trusted = clientDetails.trusted();
|
||||
|
||||
this.authorizedGrantTypes = clientDetails.authorizedGrantTypes();
|
||||
}
|
||||
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public boolean isArchived() {
|
||||
return archived;
|
||||
}
|
||||
|
||||
public void setArchived(boolean archived) {
|
||||
this.archived = archived;
|
||||
}
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getResourceIds() {
|
||||
return resourceIds;
|
||||
}
|
||||
|
||||
public void setResourceIds(String resourceIds) {
|
||||
this.resourceIds = resourceIds;
|
||||
}
|
||||
|
||||
public String getClientSecret() {
|
||||
return clientSecret;
|
||||
}
|
||||
|
||||
public void setClientSecret(String clientSecret) {
|
||||
this.clientSecret = clientSecret;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getAuthorizedGrantTypes() {
|
||||
return authorizedGrantTypes;
|
||||
}
|
||||
|
||||
public void setAuthorizedGrantTypes(String authorizedGrantTypes) {
|
||||
this.authorizedGrantTypes = authorizedGrantTypes;
|
||||
}
|
||||
|
||||
public String getWebServerRedirectUri() {
|
||||
return webServerRedirectUri;
|
||||
}
|
||||
|
||||
public void setWebServerRedirectUri(String webServerRedirectUri) {
|
||||
this.webServerRedirectUri = webServerRedirectUri;
|
||||
}
|
||||
|
||||
public String getAuthorities() {
|
||||
return authorities;
|
||||
}
|
||||
|
||||
public void setAuthorities(String authorities) {
|
||||
this.authorities = authorities;
|
||||
}
|
||||
|
||||
public Integer getAccessTokenValidity() {
|
||||
return accessTokenValidity;
|
||||
}
|
||||
|
||||
public void setAccessTokenValidity(Integer accessTokenValidity) {
|
||||
this.accessTokenValidity = accessTokenValidity;
|
||||
}
|
||||
|
||||
public Integer getRefreshTokenValidity() {
|
||||
return refreshTokenValidity;
|
||||
}
|
||||
|
||||
public void setRefreshTokenValidity(Integer refreshTokenValidity) {
|
||||
this.refreshTokenValidity = refreshTokenValidity;
|
||||
}
|
||||
|
||||
public String getAdditionalInformation() {
|
||||
return additionalInformation;
|
||||
}
|
||||
|
||||
public void setAdditionalInformation(String additionalInformation) {
|
||||
this.additionalInformation = additionalInformation;
|
||||
}
|
||||
|
||||
public boolean isTrusted() {
|
||||
return trusted;
|
||||
}
|
||||
|
||||
public void setTrusted(boolean trusted) {
|
||||
this.trusted = trusted;
|
||||
}
|
||||
}
|
|
@ -1,12 +1,16 @@
|
|||
package cc.wdcy.infrastructure;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author Shengzhao Li
|
||||
*/
|
||||
public abstract class DateUtils {
|
||||
|
||||
public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
|
||||
/**
|
||||
* Private constructor
|
||||
|
@ -18,4 +22,24 @@ public abstract class DateUtils {
|
|||
return new Date();
|
||||
}
|
||||
|
||||
|
||||
//Create new SimpleDateFormat
|
||||
private static SimpleDateFormat newDateFormat(String pattern) {
|
||||
return new SimpleDateFormat(pattern, Locale.SIMPLIFIED_CHINESE);
|
||||
}
|
||||
|
||||
public static String toDateTime(Date date) {
|
||||
return toDateText(date, DEFAULT_DATE_TIME_FORMAT);
|
||||
}
|
||||
|
||||
|
||||
public static String toDateText(Date date, String pattern) {
|
||||
if (date == null || pattern == null) {
|
||||
return null;
|
||||
}
|
||||
SimpleDateFormat dateFormat = newDateFormat(pattern);
|
||||
return dateFormat.format(date);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package cc.wdcy.web.controller;
|
||||
|
||||
import cc.wdcy.service.OauthService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* Handle 'client_details' management
|
||||
*
|
||||
* @author Shengzhao Li
|
||||
*/
|
||||
@Controller
|
||||
public class ClientDetailsController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private OauthService oauthService;
|
||||
|
||||
|
||||
@RequestMapping("client_details")
|
||||
public String clientDetails(Model model) {
|
||||
|
||||
|
||||
return "clientdetails/client_details";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<%--
|
||||
*
|
||||
* @author Shengzhao Li
|
||||
--%>
|
||||
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>client_details</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="../">Home</a>
|
||||
|
||||
<h2>client_details</h2>
|
||||
</body>
|
||||
</html>
|
|
@ -38,6 +38,11 @@
|
|||
若想访问 Unity 与 Mobile, 则先用基于浏览器的测试URL 访问,等验证通过后即可访问(注意不同的账号对应的权限).
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
若需要自定义<code>client_details</code>数据并进行测试, 可进入<a href="client_details">client_details</a>去手动添加<code>client_details</code>或删除已创建的<code>client_details</code>.
|
||||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<br/>
|
||||
|
|
Loading…
Reference in New Issue