Skip to content

Commit

Permalink
#642 #627 初始化数据脚本补充,查询用户时不返回密码
Browse files Browse the repository at this point in the history
  • Loading branch information
xuxuzhesi committed Jan 16, 2020
1 parent 19878f1 commit a6a5a0e
Show file tree
Hide file tree
Showing 5 changed files with 4,143 additions and 6 deletions.
1 change: 0 additions & 1 deletion cmdb-core/src/main/java/com/webank/cmdb/dto/UserDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public UserDto(Integer userId, @NotEmpty String username, String fullName, Strin
this.username = username;
this.fullName = fullName;
this.description = description;
this.password = password;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,16 @@ private String getValueFromEnumCode(List<AutoFillIntegrationQueryDto> routines,

private String queryValueByRule(String rootGuid, AdmCiTypeAttr attrWithGuid, Object autoFillRuleValue, StringBuilder sb) {
List<AutoFillItem> autoRuleItems = parserRule(autoFillRuleValue);
boolean isPreviousExpressionValue = true;
for (AutoFillItem item : autoRuleItems) {
if (AutoFillType.Rule.getCode().equals(item.getType())) {
try {
List<AutoFillIntegrationQueryDto> routines = JsonUtil.toList(item.getValue(), AutoFillIntegrationQueryDto.class);
QueryResponse response = queryIntegrateWithRoutines(rootGuid, attrWithGuid, routines);
List<String> targetValues = getValueFromResponse(response, routines);
if(isPreviousExpressionValue && targetValues.isEmpty()) {
return null;
}
for (int i = 0; i < targetValues.size(); i++) {
String value = targetValues.get(i);
if (checkExpression(value)) {
Expand All @@ -435,6 +439,7 @@ private String queryValueByRule(String rootGuid, AdmCiTypeAttr attrWithGuid, Obj
}
} else {
sb.append(item.getValue());
isPreviousExpressionValue=false;
}
}
return sb.toString();
Expand Down
7 changes: 2 additions & 5 deletions cmdb-core/src/main/resources/application-ch-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ spring:
url: jdbc:h2:mem:cmdb;MODE=MYSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=true;MV_STORE=FALSE;INIT=CREATE SCHEMA IF NOT EXISTS wecmdb_dev\;SET SCHEMA wecmdb_dev
username: sa
password:
schema: classpath:/database/ch/01.cmdb.schema_ch.sql
data:
- classpath:/database/ch/02.cmdb.system.data_ch.sql
- classpath:/local/ch/03.cmdb.system.data.h2_ch.sql
- classpath:/database/ch/04.cmdb.experience.data_ch.sql
schema: classpath:/database/ch/05.cmdb.create_table_ch.sql
data: classpath:/database/ch/06.cmdb.insert_data_ch.sql
sql-script-encoding: utf-8


Expand Down
Loading

0 comments on commit a6a5a0e

Please sign in to comment.