Skip to content

Commit

Permalink
Fix checkstyle issue
Browse files Browse the repository at this point in the history
  • Loading branch information
paderlol committed Nov 17, 2020
1 parent 22ed8b7 commit 894e3cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public Page<PermissionInfo> getPermissions(String role, int pageNo, int pageSize
String sqlCountRows = "select count(*) from permissions where ";
String sqlFetchRows = "select role,resource,action from permissions where ";


String where = " role= ? ";
List<String> params = new ArrayList<>();
if (StringUtils.isNotBlank(role)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public Page<RoleInfo> getRolesByUserName(String username, int pageNo, int pageSi

String sqlCountRows = "select count(*) from roles where ";
String sqlFetchRows = "select role,username from roles where ";

String where = " username= ? ";
List<String> params = new ArrayList<>();
if (StringUtils.isNotBlank(username)) {
Expand All @@ -98,9 +98,8 @@ public Page<RoleInfo> getRolesByUserName(String username, int pageNo, int pageSi
}

try {
return helper
.fetchPage(sqlCountRows + where, sqlFetchRows + where, params.toArray(), pageNo,
pageSize, ROLE_INFO_ROW_MAPPER);
return helper.fetchPage(sqlCountRows + where, sqlFetchRows + where, params.toArray(), pageNo, pageSize,
ROLE_INFO_ROW_MAPPER);
} catch (CannotGetJdbcConnectionException e) {
LogUtil.FATAL_LOG.error("[db-error] " + e.toString(), e);
throw e;
Expand All @@ -110,7 +109,7 @@ public Page<RoleInfo> getRolesByUserName(String username, int pageNo, int pageSi
/**
* Execute add role operation.
*
* @param role role string value.
* @param role role string value.
* @param userName username string value.
*/
public void addRole(String role, String userName) {
Expand Down Expand Up @@ -143,7 +142,7 @@ public void deleteRole(String role) {
/**
* Execute delete role operation.
*
* @param role role string value.
* @param role role string value.
* @param username username string value.
*/
public void deleteRole(String role, String username) {
Expand All @@ -159,7 +158,7 @@ public void deleteRole(String role, String username) {
@Override
public List<String> findRolesLikeRoleName(String role) {
String sql = "SELECT role FROM roles WHERE role like '%' ? '%'";
List<String> users = this.jt.queryForList(sql, new String[]{role}, String.class);
List<String> users = this.jt.queryForList(sql, new String[] {role}, String.class);
return users;
}

Expand Down

0 comments on commit 894e3cd

Please sign in to comment.