数据源表添加数据源状态字段,删除统一接口权限认证

This commit is contained in:
lvleigang 2024-05-27 14:21:42 +08:00
parent 1b1723afec
commit f9f5f5e23f
3 changed files with 7 additions and 4 deletions

View File

@ -1,2 +1,3 @@
ALTER TABLE sys_data_source ADD COLUMN data_state char(1) DEFAULT NULL COMMENT '数据源状态 0校验失败 1校验成功';
UPDATE sys_data_source SET data_state = '1';
COMMIT;

View File

@ -31,7 +31,7 @@ public class SysDataSourceEntity extends BaseEntity {
/** 使用状态1启用0锁定 */
private Integer useState;
/** 数据源状态 1校验成功0校验失败 */
private Integer dataState;
private String dataState;
public String getSourceCode() {
return sourceCode;
@ -157,11 +157,11 @@ public class SysDataSourceEntity extends BaseEntity {
return sourceTypeName;
}
public Integer getDataState() {
public String getDataState() {
return dataState;
}
public void setDataState(Integer dataState) {
public void setDataState(String dataState) {
this.dataState = dataState;
}
}

View File

@ -127,8 +127,10 @@ public class SysDataSourceServiceImpl extends BaseService<SysDataSourceEntity, S
if(entity.getUseState() == 1){
try {
dsDataSourceUtil.addDataSource(entity);
entity.setDataState("1");
} catch (Exception e) {
return BaseResult.getFailureMessageEntity("初始化数据源失败,请检查数据源配置是否正确");
entity.setDataState("0");
//return BaseResult.getFailureMessageEntity("初始化数据源失败,请检查数据源配置是否正确");
}
}
entity.setPassword(AESUtil.encrypt(entity.getPassword()));