SocialsAssociate

上级 1e76c267
......@@ -33,9 +33,9 @@ public class JdbcSocialsAssociateService implements SocialsAssociateService{
private static final String DEFAULT_DEFAULT_INSERT_STATEMENT = "INSERT INTO MXK_SOCIALS_ASSOCIATE(ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE )VALUES( ? , ? , ? , ? , ?, ? , ? , ?)";
private static final String DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT = "SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE FROM MXK_SOCIALS_ASSOCIATE WHERE PROVIDER = ? AND SOCIALUID = ?";
private static final String DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT = "SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE , CREATEDDATE , UPDATEDDATE FROM MXK_SOCIALS_ASSOCIATE WHERE PROVIDER = ? AND SOCIALUID = ?";
private static final String DEFAULT_DEFAULT_BIND_SELECT_STATEMENT = "SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE FROM MXK_SOCIALS_ASSOCIATE WHERE UID = ?" ;
private static final String DEFAULT_DEFAULT_BIND_SELECT_STATEMENT = "SELECT ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE , CREATEDDATE , UPDATEDDATE FROM MXK_SOCIALS_ASSOCIATE WHERE UID = ?" ;
private static final String DEFAULT_DEFAULT_DELETE_STATEMENT = "DELETE FROM MXK_SOCIALS_ASSOCIATE WHERE UID = ? AND PROVIDER = ?";
......@@ -119,6 +119,8 @@ public class JdbcSocialsAssociateService implements SocialsAssociateService{
socialsAssociate.setAccessToken(rs.getString(6));
socialsAssociate.setSocialUserInfo(rs.getString(7));
socialsAssociate.setExAttribute(rs.getString(8));
socialsAssociate.setCreatedDate(rs.getString(9));
socialsAssociate.setUpdatedDate(rs.getString(10));
return socialsAssociate;
}
}
......
......@@ -31,6 +31,7 @@ public class SocialSignOnProvider {
private String accountId;
private String bindTime;
private String unBindTime;
private String lastLoginTime;
private int sortOrder;
......@@ -125,11 +126,41 @@ public class SocialSignOnProvider {
this.unBindTime = unBindTime;
}
public String getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(String lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
@Override
public String toString() {
return "SocialSignOnProvider [provider=" + provider + ", providerName=" + providerName + ", icon=" + icon
+ ", clientId=" + clientId + ", clientSecret=" + clientSecret + ", accountId=" + accountId
+ ", sortOrder=" + sortOrder + ", userBind=" + userBind + "]";
StringBuilder builder = new StringBuilder();
builder.append("SocialSignOnProvider [provider=");
builder.append(provider);
builder.append(", providerName=");
builder.append(providerName);
builder.append(", icon=");
builder.append(icon);
builder.append(", clientId=");
builder.append(clientId);
builder.append(", clientSecret=");
builder.append(clientSecret);
builder.append(", accountId=");
builder.append(accountId);
builder.append(", bindTime=");
builder.append(bindTime);
builder.append(", unBindTime=");
builder.append(unBindTime);
builder.append(", lastLoginTime=");
builder.append(lastLoginTime);
builder.append(", sortOrder=");
builder.append(sortOrder);
builder.append(", userBind=");
builder.append(userBind);
builder.append("]");
return builder.toString();
}
......
......@@ -37,6 +37,8 @@ public class SocialsAssociate extends JpaBaseDomain {
private String socialUserInfo;
private String accessToken;
private String exAttribute;
private String createdDate;
private String updatedDate;
public SocialsAssociate() {}
......@@ -110,11 +112,46 @@ public class SocialsAssociate extends JpaBaseDomain {
this.exAttribute = exAttribute;
}
@Override
public String toString() {
return "SocialSignOnUserToken [provider=" + provider + ", uid=" + uid
+ ", socialuid=" + socialuid + ", socialUserInfo="
+ socialUserInfo + ", accessToken=" + accessToken
+ ", exAttribute=" + exAttribute + "]";
}
public String getCreatedDate() {
return createdDate;
}
public void setCreatedDate(String createdDate) {
this.createdDate = createdDate;
}
public String getUpdatedDate() {
return updatedDate;
}
public void setUpdatedDate(String updatedDate) {
this.updatedDate = updatedDate;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("SocialsAssociate [id=");
builder.append(id);
builder.append(", provider=");
builder.append(provider);
builder.append(", uid=");
builder.append(uid);
builder.append(", username=");
builder.append(username);
builder.append(", socialuid=");
builder.append(socialuid);
builder.append(", socialUserInfo=");
builder.append(socialUserInfo);
builder.append(", accessToken=");
builder.append(accessToken);
builder.append(", exAttribute=");
builder.append(exAttribute);
builder.append(", createdDate=");
builder.append(createdDate);
builder.append(", updatedDate=");
builder.append(updatedDate);
builder.append("]");
return builder.toString();
}
}
......@@ -72,6 +72,8 @@ public class SocialSignOnListController {
for(SocialsAssociate ssout :listSocialSignOnUserToken){
if(ssout.getProvider().equals(ssop.getProvider())){
socialSignOnProvider.setUserBind(true);
socialSignOnProvider.setBindTime(ssout.getCreatedDate());
socialSignOnProvider.setLastLoginTime(ssout.getUpdatedDate());
_logger.debug("binded provider : "+ssout.getProvider());
}
}
......
......@@ -76,6 +76,7 @@ login.social.icon=\u56fe\u6807
login.social.provider=\u4f9b\u5e94\u5546
login.social.bindtime=\u7ed1\u5b9a\u65f6\u95f4
login.social.unbindtime=\u89e3\u9664\u65f6\u95f4
login.social.lastLoginTime=\u6700\u8fd1\u767b\u5f55\u65f6\u95f4
login.social.action=\u64cd\u4f5c
userinfo.displayName=\u7528\u6237\u540d
......
......@@ -75,6 +75,7 @@ login.social.icon=Icon
login.social.provider=Provider
login.social.bindtime=BindTime
login.social.unbindtime=unBindTime
login.social.lastLoginTime=LastLoginTime
login.social.action=Action
userinfo.displayName=displayName
......
......@@ -76,6 +76,7 @@ login.social.icon=\u56fe\u6807
login.social.provider=\u4f9b\u5e94\u5546
login.social.bindtime=\u7ed1\u5b9a\u65f6\u95f4
login.social.unbindtime=\u89e3\u9664\u65f6\u95f4
login.social.lastLoginTime=\u6700\u8fd1\u767b\u5f55\u65f6\u95f4
login.social.action=\u64cd\u4f5c
userinfo.displayName=\u7528\u6237\u540d
......
......@@ -14,6 +14,8 @@
<th><@locale code="login.social.sortorder" /></th>
<th><@locale code="login.social.icon" /></th>
<th><@locale code="login.social.provider" /></th>
<th><@locale code="login.social.bindtime" /></th>
<th><@locale code="login.social.lastLoginTime" /></th>
<th><@locale code="login.social.action" /></th>
</tr>
</thead>
......@@ -22,7 +24,9 @@
<tr>
<td>${socialSignOnProvider.sortOrder}</td>
<td><img src="<@base />/static/${socialSignOnProvider.icon}" title="${socialSignOnProvider.providerName}" width="32px;" height="32px;"/></td>
<td>${socialSignOnProvider.providerName}</td>
<td>${socialSignOnProvider.providerName}</td>
<td>${socialSignOnProvider.bindTime!}</td>
<td>${socialSignOnProvider.lastLoginTime!}</td>
<td>
<#if false==socialSignOnProvider.userBind>
<a href="<@base/>/logon/oauth20/bind/${socialSignOnProvider.provider}"><@locale code="login.social.link" /></a>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册