mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-24 01:48:13 +08:00
kaptcha
This commit is contained in:
@@ -141,6 +141,9 @@ public class Apps extends JpaBaseEntity implements Serializable {
|
||||
@Column
|
||||
private String adapter;
|
||||
|
||||
@Column
|
||||
private String frequently;
|
||||
|
||||
@Column
|
||||
protected int sortIndex;
|
||||
@Column
|
||||
@@ -157,7 +160,7 @@ public class Apps extends JpaBaseEntity implements Serializable {
|
||||
protected String description;
|
||||
@Column
|
||||
private String instId;
|
||||
|
||||
|
||||
private String instName;
|
||||
|
||||
protected String loginDateTime;
|
||||
@@ -248,7 +251,16 @@ public class Apps extends JpaBaseEntity implements Serializable {
|
||||
this.secret = secret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
public String getFrequently() {
|
||||
return frequently;
|
||||
}
|
||||
|
||||
public void setFrequently(String frequently) {
|
||||
this.frequently = frequently;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the icon
|
||||
*/
|
||||
public byte[] getIcon() {
|
||||
|
||||
@@ -106,6 +106,7 @@ public class AppsOAuth20Details extends Apps {
|
||||
this.setAdapter(application.getAdapter());
|
||||
this.setAdapterId(application.getAdapterId());
|
||||
this.setAdapterName(application.getAdapterName());
|
||||
this.setFrequently(application.getFrequently());
|
||||
|
||||
this.clientSecret = baseClientDetails.getClientSecret();
|
||||
this.scope = StringUtils
|
||||
|
||||
@@ -37,6 +37,8 @@ public class InstitutionsRepository {
|
||||
|
||||
private static final String SELECT_STATEMENT =
|
||||
"select * from mxk_institutions where id = ? or domain = ? " ;
|
||||
|
||||
private static final String DEFAULT_INSTID = "1";
|
||||
|
||||
protected static final Cache<String, Institutions> institutionsStore =
|
||||
Caffeine.newBuilder()
|
||||
@@ -54,7 +56,17 @@ public class InstitutionsRepository {
|
||||
|
||||
public Institutions get(String instIdOrDomain) {
|
||||
_logger.trace(" instId {}" , instIdOrDomain);
|
||||
Institutions inst = institutionsStore.getIfPresent(mapper.get(instIdOrDomain)==null ? "1" : mapper.get(instIdOrDomain) );
|
||||
Institutions inst = getByInstIdOrDomain(instIdOrDomain);
|
||||
if(inst == null) {//use default inst
|
||||
inst = getByInstIdOrDomain(DEFAULT_INSTID);
|
||||
institutionsStore.put(instIdOrDomain, inst);
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
private Institutions getByInstIdOrDomain(String instIdOrDomain) {
|
||||
_logger.trace(" instId {}" , instIdOrDomain);
|
||||
Institutions inst = institutionsStore.getIfPresent(mapper.get(instIdOrDomain)==null ? DEFAULT_INSTID : mapper.get(instIdOrDomain) );
|
||||
if(inst == null) {
|
||||
List<Institutions> institutions =
|
||||
jdbcTemplate.query(SELECT_STATEMENT,new InstitutionsRowMapper(),instIdOrDomain,instIdOrDomain);
|
||||
@@ -62,8 +74,10 @@ public class InstitutionsRepository {
|
||||
if (institutions != null && institutions.size() > 0) {
|
||||
inst = institutions.get(0);
|
||||
}
|
||||
institutionsStore.put(inst.getDomain(), inst);
|
||||
mapper.put(inst.getId(), inst.getDomain());
|
||||
if(inst != null ) {
|
||||
institutionsStore.put(inst.getDomain(), inst);
|
||||
mapper.put(inst.getId(), inst.getDomain());
|
||||
}
|
||||
}
|
||||
|
||||
return inst;
|
||||
|
||||
Reference in New Issue
Block a user