pull/1/head
ZhouXY108 2023-03-12 13:29:15 +08:00
commit 920971c640
10 changed files with 13 additions and 17 deletions

View File

@ -28,12 +28,10 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.13.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.13.4</version> </dependency>
</dependency>
</dependencies> </dependencies>
</project> </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.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource; import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.util.CollectionUtils;
import xyz.zhouxy.plusone.commons.util.NumberUtil; import xyz.zhouxy.plusone.commons.util.NumberUtil;
import xyz.zhouxy.plusone.exception.DataOperationResultException; import xyz.zhouxy.plusone.exception.DataOperationResultException;
@ -156,7 +157,7 @@ public abstract class PlusoneJdbcDaoSupport {
protected static final <T> SqlParameterSource[] buildSqlParameterSourceArray( protected static final <T> SqlParameterSource[] buildSqlParameterSourceArray(
Collection<T> c, Collection<T> c,
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) { @Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
if (c == null || c.isEmpty()) { if (CollectionUtils.isEmpty(c)) {
return new SqlParameterSource[] {}; return new SqlParameterSource[] {};
} }
return buildSqlParameterSourceArray(c.stream(), paramSourceBuilder); 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> * @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
*/ */
public class FastDFSException extends Exception { public class FastDFSException extends Exception {
private static final long serialVersionUID = 7871031982887742468L;
public FastDFSException() { public FastDFSException() {
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,7 +27,7 @@
<spring-boot.version>2.7.9</spring-boot.version> <spring-boot.version>2.7.9</spring-boot.version>
<sa-token.version>1.34.0</sa-token.version> <sa-token.version>1.34.0</sa-token.version>
<hutool.version>5.8.12</hutool.version> <hutool.version>5.8.14</hutool.version>
<mybatis-starter.version>3.0.1</mybatis-starter.version> <mybatis-starter.version>3.0.1</mybatis-starter.version>
<mybatis-plus.version>3.5.3.1</mybatis-plus.version> <mybatis-plus.version>3.5.3.1</mybatis-plus.version>
<commons-io.version>2.11.0</commons-io.version> <commons-io.version>2.11.0</commons-io.version>