mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 20:57:23 +08:00
refactor: 优化字符串模板方法 API 使用
This commit is contained in:
@@ -102,7 +102,7 @@ public class DataPermissionHandlerImpl implements DataPermissionHandler {
|
||||
case DEPT -> expression = this.buildDeptExpression(dataPermission, currentUser, expression);
|
||||
case SELF -> expression = this.buildSelfExpression(dataPermission, currentUser, expression);
|
||||
case CUSTOM -> expression = this.buildCustomExpression(dataPermission, role, expression);
|
||||
default -> throw new IllegalArgumentException(String.format("暂不支持 [%s] 数据权限", dataScope));
|
||||
default -> throw new IllegalArgumentException("暂不支持 [%s] 数据权限".formatted(dataScope));
|
||||
}
|
||||
}
|
||||
return null != where ? new AndExpression(where, new Parenthesis(expression)) : expression;
|
||||
@@ -227,7 +227,7 @@ public class DataPermissionHandlerImpl implements DataPermissionHandler {
|
||||
*/
|
||||
private Column buildColumn(String tableAlias, String columnName) {
|
||||
if (StringUtils.isNotEmpty(tableAlias)) {
|
||||
return new Column(String.format("%s.%s", tableAlias, columnName));
|
||||
return new Column("%s.%s".formatted(tableAlias, columnName));
|
||||
}
|
||||
return new Column(columnName);
|
||||
}
|
||||
|
@@ -182,7 +182,7 @@ public class QueryWrapperHelper {
|
||||
}
|
||||
case IS_NULL -> consumers.add(q -> q.isNull(columnName));
|
||||
case IS_NOT_NULL -> consumers.add(q -> q.isNotNull(columnName));
|
||||
default -> throw new IllegalArgumentException(String.format("暂不支持 [%s] 查询类型", queryType));
|
||||
default -> throw new IllegalArgumentException("暂不支持 [%s] 查询类型".formatted(queryType));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user