synchronizers separate

This commit is contained in:
MaxKey 2022-01-23 08:12:25 +08:00
parent 2444351ef7
commit 757c3861d9
43 changed files with 92 additions and 69 deletions

View File

@ -47,12 +47,12 @@ def libjarsmapper=[
'maxkey-identity-rest' :'maxkey_mgt', 'maxkey-identity-rest' :'maxkey_mgt',
'maxkey-identity-scim' :'maxkey_mgt', 'maxkey-identity-scim' :'maxkey_mgt',
'maxkey-web-mgt' :'maxkey_mgt', 'maxkey-web-mgt' :'maxkey_mgt',
'maxkey-synchronizers' :'maxkey_mgt', 'maxkey-synchronizer' :'maxkey_mgt',
'maxkey-synchronizers-activedirectory' :'maxkey_mgt', 'maxkey-synchronizer-activedirectory' :'maxkey_mgt',
'maxkey-synchronizers-ldap' :'maxkey_mgt', 'maxkey-synchronizer-ldap' :'maxkey_mgt',
'maxkey-synchronizers-dingtalk' :'maxkey_mgt', 'maxkey-synchronizer-dingtalk' :'maxkey_mgt',
'maxkey-synchronizers-workweixin' :'maxkey_mgt', 'maxkey-synchronizer-workweixin' :'maxkey_mgt',
'maxkey-synchronizers-reorgdept' :'maxkey_mgt', 'maxkey-synchronizer-reorgdept' :'maxkey_mgt',
'maxkey-boot-monitor' :'maxkey_monitor' 'maxkey-boot-monitor' :'maxkey_monitor'
] ]

View File

@ -47,12 +47,12 @@ def libjarsmapper=[
'maxkey-identity-rest' :'maxkey_mgt', 'maxkey-identity-rest' :'maxkey_mgt',
'maxkey-identity-scim' :'maxkey_mgt', 'maxkey-identity-scim' :'maxkey_mgt',
'maxkey-web-mgt' :'maxkey_mgt', 'maxkey-web-mgt' :'maxkey_mgt',
'maxkey-synchronizers' :'maxkey_mgt', 'maxkey-synchronizer' :'maxkey_mgt',
'maxkey-synchronizers-activedirectory' :'maxkey_mgt', 'maxkey-synchronizer-activedirectory' :'maxkey_mgt',
'maxkey-synchronizers-ldap' :'maxkey_mgt', 'maxkey-synchronizer-ldap' :'maxkey_mgt',
'maxkey-synchronizers-dingtalk' :'maxkey_mgt', 'maxkey-synchronizer-dingtalk' :'maxkey_mgt',
'maxkey-synchronizers-workweixin' :'maxkey_mgt', 'maxkey-synchronizer-workweixin' :'maxkey_mgt',
'maxkey-synchronizers-reorgdept' :'maxkey_mgt', 'maxkey-synchronizer-reorgdept' :'maxkey_mgt',
'maxkey-boot-monitor' :'maxkey_monitor' 'maxkey-boot-monitor' :'maxkey_monitor'
] ]

View File

@ -143,6 +143,7 @@ public class SocialSignOnEndpoint extends AbstractSocialSignOnEndpoint{
socialsAssociate =new SocialsAssociate(); socialsAssociate =new SocialsAssociate();
socialsAssociate.setProvider(provider); socialsAssociate.setProvider(provider);
socialsAssociate.setSocialUserId(this.accountId); socialsAssociate.setSocialUserId(this.accountId);
socialsAssociate.setInstId(WebContext.getInst(WebContext.getRequest()));
//for login //for login
String socialSignOnType= String socialSignOnType=

View File

@ -32,13 +32,13 @@ import org.springframework.jdbc.core.RowMapper;
public class JdbcSocialsAssociateService implements SocialsAssociateService{ public class JdbcSocialsAssociateService implements SocialsAssociateService{
private static final Logger _logger = LoggerFactory.getLogger(JdbcSocialsAssociateService.class); private static final Logger _logger = LoggerFactory.getLogger(JdbcSocialsAssociateService.class);
private static final String DEFAULT_DEFAULT_INSERT_STATEMENT = "insert into mxk_socials_associate(id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute )values( ? , ? , ? , ? , ?, ? , ? , ?)"; private static final String DEFAULT_DEFAULT_INSERT_STATEMENT = "insert into mxk_socials_associate(id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute , instid)values( ? , ? , ? , ? , ?, ? , ? , ?, ?)";
private static final String DEFAULT_DEFAULT_INSERT_STATEMENT_ORACLE = "insert into mxk_socials_associate(id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute )values( ? , ? , ? , ? , ?, ? , ? , ?)"; private static final String DEFAULT_DEFAULT_INSERT_STATEMENT_ORACLE = "insert into mxk_socials_associate(id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute , instid)values( ? , ? , ? , ? , ?, ? , ? , ?, ?)";
private static final String DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT = "select id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute , createddate , updateddate from mxk_socials_associate where provider = ? and socialuserid = ?"; private static final String DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT = "select id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute , createddate , updateddate , instid from mxk_socials_associate where provider = ? and socialuserid = ?";
private static final String DEFAULT_DEFAULT_BIND_SELECT_STATEMENT = "select id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute , createddate , updateddate from mxk_socials_associate where userid = ?" ; private static final String DEFAULT_DEFAULT_BIND_SELECT_STATEMENT = "select id, userid , username , provider , socialuserid , accesstoken , socialuserinfo , exattribute , createddate , updateddate , instid from mxk_socials_associate where userid = ?" ;
private static final String DEFAULT_DEFAULT_DELETE_STATEMENT = "delete from mxk_socials_associate where userid = ? and provider = ?"; private static final String DEFAULT_DEFAULT_DELETE_STATEMENT = "delete from mxk_socials_associate where userid = ? and provider = ?";
@ -64,10 +64,13 @@ public class JdbcSocialsAssociateService implements SocialsAssociateService{
socialsAssociate.getSocialUserId(), socialsAssociate.getSocialUserId(),
socialsAssociate.getAccessToken(), socialsAssociate.getAccessToken(),
socialsAssociate.getSocialUserInfo(), socialsAssociate.getSocialUserInfo(),
socialsAssociate.getExAttribute()}, socialsAssociate.getExAttribute(),
socialsAssociate.getInstId()
},
new int[] { new int[] {
Types.VARCHAR, Types.VARCHAR,Types.VARCHAR,Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,Types.VARCHAR,Types.VARCHAR,
Types.VARCHAR,Types.VARCHAR, Types.VARCHAR,Types.VARCHAR Types.VARCHAR,Types.VARCHAR, Types.VARCHAR,Types.VARCHAR,
Types.VARCHAR
}); });
return true; return true;
} }
@ -135,6 +138,7 @@ public class JdbcSocialsAssociateService implements SocialsAssociateService{
socialsAssociate.setExAttribute(rs.getString(8)); socialsAssociate.setExAttribute(rs.getString(8));
socialsAssociate.setCreatedDate(rs.getString(9)); socialsAssociate.setCreatedDate(rs.getString(9));
socialsAssociate.setUpdatedDate(rs.getString(10)); socialsAssociate.setUpdatedDate(rs.getString(10));
socialsAssociate.setInstId(rs.getString(11));
return socialsAssociate; return socialsAssociate;
} }
} }

View File

@ -39,6 +39,7 @@ public class SocialsAssociate extends JpaBaseEntity {
private String exAttribute; private String exAttribute;
private String createdDate; private String createdDate;
private String updatedDate; private String updatedDate;
private String instId;
public SocialsAssociate() {} public SocialsAssociate() {}
@ -128,7 +129,15 @@ public class SocialsAssociate extends JpaBaseEntity {
this.updatedDate = updatedDate; this.updatedDate = updatedDate;
} }
@Override public String getInstId() {
return instId;
}
public void setInstId(String instId) {
this.instId = instId;
}
@Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("SocialsAssociate [id="); builder.append("SocialsAssociate [id=");

View File

@ -1,14 +0,0 @@
description = "maxkey-synchronizers-workweixin"
apply plugin: 'java'
dependencies {
//local jars
implementation fileTree(dir: '../maxkey-lib/*/', include: '*.jar')
implementation project(":maxkey-common")
implementation project(":maxkey-core")
implementation project(":maxkey-persistence")
implementation project(":maxkey-identitys:maxkey-synchronizers")
}

View File

@ -1,4 +1,4 @@
description = "maxkey-synchronizers" description = "maxkey-synchronizer"
apply plugin: 'java' apply plugin: 'java'
@ -9,6 +9,6 @@ dependencies {
implementation project(":maxkey-common") implementation project(":maxkey-common")
implementation project(":maxkey-core") implementation project(":maxkey-core")
implementation project(":maxkey-persistence") implementation project(":maxkey-persistence")
implementation project(":maxkey-identitys:maxkey-synchronizers") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
} }

View File

@ -1,4 +1,4 @@
description = "maxkey-synchronizers-dingtalk" description = "maxkey-synchronizer-dingtalk"
apply plugin: 'java' apply plugin: 'java'
@ -9,6 +9,6 @@ dependencies {
implementation project(":maxkey-common") implementation project(":maxkey-common")
implementation project(":maxkey-core") implementation project(":maxkey-core")
implementation project(":maxkey-persistence") implementation project(":maxkey-persistence")
implementation project(":maxkey-identitys:maxkey-synchronizers") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
} }

View File

@ -1,4 +1,4 @@
description = "maxkey-synchronizers-ldap" description = "maxkey-synchronizer-ldap"
apply plugin: 'java' apply plugin: 'java'
@ -9,6 +9,6 @@ dependencies {
implementation project(":maxkey-common") implementation project(":maxkey-common")
implementation project(":maxkey-core") implementation project(":maxkey-core")
implementation project(":maxkey-persistence") implementation project(":maxkey-persistence")
implementation project(":maxkey-identitys:maxkey-synchronizers") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
} }

View File

@ -1,4 +1,4 @@
description = "maxkey-synchronizers-reorgdept" description = "maxkey-synchronizer-reorgdept"
apply plugin: 'java' apply plugin: 'java'
@ -9,6 +9,6 @@ dependencies {
implementation project(":maxkey-common") implementation project(":maxkey-common")
implementation project(":maxkey-core") implementation project(":maxkey-core")
implementation project(":maxkey-persistence") implementation project(":maxkey-persistence")
implementation project(":maxkey-identitys:maxkey-synchronizers") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
} }

View File

@ -0,0 +1,14 @@
description = "maxkey-synchronizer-workweixin"
apply plugin: 'java'
dependencies {
//local jars
implementation fileTree(dir: '../maxkey-lib/*/', include: '*.jar')
implementation project(":maxkey-common")
implementation project(":maxkey-core")
implementation project(":maxkey-persistence")
implementation project(":maxkey-synchronizers:maxkey-synchronizer")
}

View File

@ -1,4 +1,4 @@
description = "maxkey-synchronizers" description = "maxkey-synchronizer"
apply plugin: 'java' apply plugin: 'java'

View File

@ -17,12 +17,14 @@ dependencies {
//identity //identity
implementation project(":maxkey-identitys:maxkey-identity-scim") implementation project(":maxkey-identitys:maxkey-identity-scim")
implementation project(":maxkey-identitys:maxkey-identity-rest") implementation project(":maxkey-identitys:maxkey-identity-rest")
implementation project(":maxkey-identitys:maxkey-synchronizers")
implementation project(":maxkey-identitys:maxkey-synchronizers-activedirectory") //synchronizers
implementation project(":maxkey-identitys:maxkey-synchronizers-ldap") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
implementation project(":maxkey-identitys:maxkey-synchronizers-workweixin") implementation project(":maxkey-synchronizers:maxkey-synchronizer-activedirectory")
implementation project(":maxkey-identitys:maxkey-synchronizers-dingtalk") implementation project(":maxkey-synchronizers:maxkey-synchronizer-ldap")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-workweixin")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-dingtalk")
implementation project(":maxkey-webs:maxkey-web-resources") implementation project(":maxkey-webs:maxkey-web-resources")
} }

View File

@ -53,11 +53,13 @@ dependencies {
//identity //identity
implementation project(":maxkey-identitys:maxkey-identity-scim") implementation project(":maxkey-identitys:maxkey-identity-scim")
implementation project(":maxkey-identitys:maxkey-identity-rest") implementation project(":maxkey-identitys:maxkey-identity-rest")
implementation project(":maxkey-identitys:maxkey-synchronizers")
implementation project(":maxkey-identitys:maxkey-synchronizers-activedirectory") //synchronizers
implementation project(":maxkey-identitys:maxkey-synchronizers-ldap") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
implementation project(":maxkey-identitys:maxkey-synchronizers-workweixin") implementation project(":maxkey-synchronizers:maxkey-synchronizer-activedirectory")
implementation project(":maxkey-identitys:maxkey-synchronizers-dingtalk") implementation project(":maxkey-synchronizers:maxkey-synchronizer-ldap")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-workweixin")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-dingtalk")
implementation project(":maxkey-webs:maxkey-web-resources") implementation project(":maxkey-webs:maxkey-web-resources")

View File

@ -54,11 +54,13 @@ dependencies {
//identity //identity
implementation project(":maxkey-identitys:maxkey-identity-scim") implementation project(":maxkey-identitys:maxkey-identity-scim")
implementation project(":maxkey-identitys:maxkey-identity-rest") implementation project(":maxkey-identitys:maxkey-identity-rest")
implementation project(":maxkey-identitys:maxkey-synchronizers")
implementation project(":maxkey-identitys:maxkey-synchronizers-activedirectory") //synchronizers
implementation project(":maxkey-identitys:maxkey-synchronizers-ldap") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
implementation project(":maxkey-identitys:maxkey-synchronizers-workweixin") implementation project(":maxkey-synchronizers:maxkey-synchronizer-activedirectory")
implementation project(":maxkey-identitys:maxkey-synchronizers-dingtalk") implementation project(":maxkey-synchronizers:maxkey-synchronizer-ldap")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-workweixin")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-dingtalk")
implementation project(":maxkey-webs:maxkey-web-resources") implementation project(":maxkey-webs:maxkey-web-resources")
} }

View File

@ -18,11 +18,13 @@ dependencies {
//identity //identity
implementation project(":maxkey-identitys:maxkey-identity-scim") implementation project(":maxkey-identitys:maxkey-identity-scim")
implementation project(":maxkey-identitys:maxkey-identity-rest") implementation project(":maxkey-identitys:maxkey-identity-rest")
implementation project(":maxkey-identitys:maxkey-synchronizers")
implementation project(":maxkey-identitys:maxkey-synchronizers-activedirectory") //synchronizers
implementation project(":maxkey-identitys:maxkey-synchronizers-ldap") implementation project(":maxkey-synchronizers:maxkey-synchronizer")
implementation project(":maxkey-identitys:maxkey-synchronizers-workweixin") implementation project(":maxkey-synchronizers:maxkey-synchronizer-activedirectory")
implementation project(":maxkey-identitys:maxkey-synchronizers-dingtalk") implementation project(":maxkey-synchronizers:maxkey-synchronizer-ldap")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-workweixin")
implementation project(":maxkey-synchronizers:maxkey-synchronizer-dingtalk")
implementation project(":maxkey-webs:maxkey-web-resources") implementation project(":maxkey-webs:maxkey-web-resources")
} }

View File

@ -33,12 +33,13 @@ include (
//identity //identity
'maxkey-identitys:maxkey-identity-scim', 'maxkey-identitys:maxkey-identity-scim',
'maxkey-identitys:maxkey-identity-rest', 'maxkey-identitys:maxkey-identity-rest',
'maxkey-identitys:maxkey-synchronizers', //synchronizers
'maxkey-identitys:maxkey-synchronizers-reorgdept', 'maxkey-synchronizers:maxkey-synchronizer',
'maxkey-identitys:maxkey-synchronizers-activedirectory', 'maxkey-synchronizers:maxkey-synchronizer-reorgdept',
'maxkey-identitys:maxkey-synchronizers-ldap', 'maxkey-synchronizers:maxkey-synchronizer-activedirectory',
'maxkey-identitys:maxkey-synchronizers-dingtalk', 'maxkey-synchronizers:maxkey-synchronizer-ldap',
'maxkey-identitys:maxkey-synchronizers-workweixin', 'maxkey-synchronizers:maxkey-synchronizer-dingtalk',
'maxkey-synchronizers:maxkey-synchronizer-workweixin',
//Protocol //Protocol
'maxkey-protocols:maxkey-protocol-authorize', 'maxkey-protocols:maxkey-protocol-authorize',
'maxkey-protocols:maxkey-protocol-oauth-2.0', 'maxkey-protocols:maxkey-protocol-oauth-2.0',