整理代码。

pull/1/head
ZhouXY108 2023-03-08 17:42:04 +08:00
parent 19557734ed
commit f0b6014e77
9 changed files with 12 additions and 16 deletions

View File

@ -28,12 +28,10 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.13.4</version>
</dependency>
</dependency>
</dependencies>
</project>

View File

@ -14,6 +14,7 @@ import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.util.CollectionUtils;
import xyz.zhouxy.plusone.commons.util.NumberUtil;
import xyz.zhouxy.plusone.exception.DataOperationResultException;
@ -156,7 +157,7 @@ public abstract class PlusoneJdbcDaoSupport {
protected static final <T> SqlParameterSource[] buildSqlParameterSourceArray(
Collection<T> c,
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
if (c == null || c.isEmpty()) {
if (CollectionUtils.isEmpty(c)) {
return new SqlParameterSource[] {};
}
return buildSqlParameterSourceArray(c.stream(), paramSourceBuilder);

View File

@ -6,6 +6,7 @@ package xyz.zhouxy.plusone.oss;
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
*/
public class FastDFSException extends Exception {
private static final long serialVersionUID = 7871031982887742468L;
public FastDFSException() {
}

View File

@ -7,9 +7,7 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>xyz.zhouxy</groupId>
<artifactId>plusone-basic</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

View File

@ -7,10 +7,7 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>xyz.zhouxy</groupId>
<artifactId>plusone-start</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>plusone-start</name>
<description>参考 DDD 落地的脚手架</description>

View File

@ -9,10 +9,13 @@ import xyz.zhouxy.plusone.exception.BizException;
*/
public class UnsupportedPrincipalTypeException extends BizException {
private static final long serialVersionUID = 5207757290868470762L;
public static final int ERR_CODE = 4040201;
private static final String DEFAULT_ERROR_MSG = "不支持的 PrincipalType";
public UnsupportedPrincipalTypeException() {
super(ERR_CODE, "不支持的 PrincipalType");
super(ERR_CODE, DEFAULT_ERROR_MSG);
}
public UnsupportedPrincipalTypeException(String msg) {

View File

@ -8,7 +8,6 @@ import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
@ -16,6 +15,7 @@ import javax.annotation.Nonnull;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.util.CollectionUtils;
import cn.hutool.core.util.IdUtil;
import xyz.zhouxy.plusone.jdbc.JdbcEntityDaoSupport;
@ -80,7 +80,7 @@ class ActionDAO extends JdbcEntityDaoSupport<Action, Long> {
}
Collection<Action> selectActionsByIdIn(Collection<Long> actionIds) {
if (Objects.isNull(actionIds) || actionIds.isEmpty()) {
if (CollectionUtils.isEmpty(actionIds)) {
return Collections.emptyList();
}
return queryForList("""

View File

@ -7,7 +7,6 @@ import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nonnull;
@ -15,6 +14,7 @@ import javax.annotation.Nonnull;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.util.CollectionUtils;
import cn.hutool.core.util.IdUtil;
import xyz.zhouxy.plusone.commons.util.EnumUtil;
@ -121,7 +121,7 @@ public class MenuRepositoryImpl extends JdbcRepositorySupport<Menu, Long> implem
@Override
public Collection<Menu> findByIdIn(Collection<Long> ids) {
if (Objects.isNull(ids) || ids.isEmpty()) {
if (CollectionUtils.isEmpty(ids)) {
return Collections.emptyList();
}
return queryForList("""

View File

@ -7,9 +7,7 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>xyz.zhouxy</groupId>
<artifactId>plusone-system</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>plusone-system</name>