Compare commits
4 Commits
feature/ad
...
1b551eeb4c
Author | SHA1 | Date | |
---|---|---|---|
1b551eeb4c | |||
1611bf38e8 | |||
17273b0bc6 | |||
2d02899372 |
@@ -33,4 +33,4 @@ indent_size=4
|
|||||||
indent_size=2
|
indent_size=2
|
||||||
|
|
||||||
[*.java]
|
[*.java]
|
||||||
indent_size=4
|
indent_size = 4
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception.handler;
|
package xyz.zhouxy.plusone.exception.handler;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception.handler;
|
package xyz.zhouxy.plusone.exception.handler;
|
||||||
|
|
||||||
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
||||||
@@ -27,7 +11,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
|||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认异常的处理器
|
* 默认异常的处理器
|
||||||
|
@@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception.handler;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
|
||||||
import xyz.zhouxy.plusone.exception.SysException;
|
|
||||||
|
|
||||||
@RestControllerAdvice
|
|
||||||
@Slf4j
|
|
||||||
public class SysExceptionHandler extends BaseExceptionHandler {
|
|
||||||
|
|
||||||
public SysExceptionHandler(ExceptionInfoHolder exceptionInfoHolder) {
|
|
||||||
super(exceptionInfoHolder);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ExceptionHandler({ SysException.class })
|
|
||||||
public ResponseEntity<RestfulResult> handleException(@Nonnull Exception e) {
|
|
||||||
log.error(e.getMessage(), e);
|
|
||||||
HttpStatus httpStatus = getHttpStatus(e);
|
|
||||||
return new ResponseEntity<>(RestfulResult.error(getErrorCode(e), "系统错误"), httpStatus);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -39,17 +39,17 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xyz.zhouxy.plusone</groupId>
|
<groupId>xyz.zhouxy.plusone</groupId>
|
||||||
<artifactId>plusone-commons</artifactId>
|
<artifactId>plusone-commons</artifactId>
|
||||||
<version>0.1.0-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xyz.zhouxy.plusone</groupId>
|
<groupId>xyz.zhouxy.plusone</groupId>
|
||||||
<artifactId>plusone-validator</artifactId>
|
<artifactId>plusone-validator</artifactId>
|
||||||
<version>0.1.3-SNAPSHOT</version>
|
<version>0.1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xyz.zhouxy.plusone</groupId>
|
<groupId>xyz.zhouxy.plusone</groupId>
|
||||||
<artifactId>plusone-exception-handler</artifactId>
|
<artifactId>plusone-exception-handler</artifactId>
|
||||||
<version>0.0.8-SNAPSHOT</version>
|
<version>0.0.6-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -1,25 +1,5 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.constant;
|
package xyz.zhouxy.plusone.constant;
|
||||||
|
|
||||||
public class ErrorCodeConsts {
|
public class ErrorCodeConsts {
|
||||||
public static final int DEFAULT_ERROR_CODE = 9999999;
|
public static final int DEFAULT_ERROR_CODE = 9999999;
|
||||||
|
|
||||||
private ErrorCodeConsts() {
|
|
||||||
throw new IllegalStateException("Utility class");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception;
|
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.exception.BaseException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务异常
|
|
||||||
*
|
|
||||||
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
|
||||||
*/
|
|
||||||
public class BizException extends BaseException {
|
|
||||||
@java.io.Serial
|
|
||||||
private static final long serialVersionUID = -5524759033245815405L;
|
|
||||||
|
|
||||||
public static final int DEFAULT_ERROR_CODE = 4000000;
|
|
||||||
|
|
||||||
public BizException(int code, String msg) {
|
|
||||||
super(code, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BizException(int code, Throwable cause) {
|
|
||||||
super(code, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BizException(int code, String msg, Throwable cause) {
|
|
||||||
super(code, msg, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BizException(String msg) {
|
|
||||||
super(DEFAULT_ERROR_CODE, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BizException(Throwable cause) {
|
|
||||||
super(DEFAULT_ERROR_CODE, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BizException(String msg, Throwable cause) {
|
|
||||||
super(DEFAULT_ERROR_CODE, msg, cause);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception;
|
package xyz.zhouxy.plusone.exception;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -25,7 +9,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
|||||||
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
||||||
*/
|
*/
|
||||||
@ResponseStatus(HttpStatus.NOT_FOUND)
|
@ResponseStatus(HttpStatus.NOT_FOUND)
|
||||||
public class DataNotExistException extends BizException {
|
public class DataNotExistException extends PlusoneException {
|
||||||
|
|
||||||
@java.io.Serial
|
@java.io.Serial
|
||||||
private static final long serialVersionUID = 6536955800679703111L;
|
private static final long serialVersionUID = 6536955800679703111L;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception;
|
package xyz.zhouxy.plusone.exception;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -24,12 +8,13 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
|||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* 暂时先这样,后续完善异常体系时可能会更改。
|
* 暂时先这样,后续完善异常体系时可能会更改。
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
||||||
* @see xyz.zhouxy.plusone.util.AssertResult
|
* @see xyz.zhouxy.plusone.util.AssertResult
|
||||||
*/
|
*/
|
||||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||||
public class DataOperationResultException extends SysException {
|
public class DataOperationResultException extends PlusoneException {
|
||||||
|
|
||||||
@java.io.Serial
|
@java.io.Serial
|
||||||
private static final long serialVersionUID = -9220765735990318186L;
|
private static final long serialVersionUID = -9220765735990318186L;
|
||||||
|
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception;
|
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.exception.BaseException;
|
|
||||||
|
|
||||||
public class SysException extends BaseException {
|
|
||||||
@java.io.Serial
|
|
||||||
private static final long serialVersionUID = 8821240827443168118L;
|
|
||||||
|
|
||||||
public static final int DEFAULT_ERROR_CODE = 5000000;
|
|
||||||
|
|
||||||
public SysException(int code, String msg) {
|
|
||||||
super(code, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysException(int code, Throwable cause) {
|
|
||||||
super(code, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysException(int code, String msg, Throwable cause) {
|
|
||||||
super(code, msg, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysException(String msg) {
|
|
||||||
super(DEFAULT_ERROR_CODE, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysException(Throwable cause) {
|
|
||||||
super(DEFAULT_ERROR_CODE, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysException(String msg, Throwable cause) {
|
|
||||||
super(DEFAULT_ERROR_CODE, msg, cause);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception;
|
package xyz.zhouxy.plusone.exception;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -25,7 +9,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
|||||||
* @author ZhouXY
|
* @author ZhouXY
|
||||||
*/
|
*/
|
||||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||||
public class UserOperationException extends BizException {
|
public class UserOperationException extends PlusoneException {
|
||||||
|
|
||||||
@java.io.Serial
|
@java.io.Serial
|
||||||
private static final long serialVersionUID = 4371055414421991940L;
|
private static final long serialVersionUID = 4371055414421991940L;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.util;
|
package xyz.zhouxy.plusone.util;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.exception.DataNotExistException;
|
import xyz.zhouxy.plusone.exception.DataNotExistException;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.util;
|
package xyz.zhouxy.plusone.util;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
package xyz.zhouxy.plusone.util;
|
|
||||||
|
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
|
||||||
|
|
||||||
public final class RandomUtil {
|
|
||||||
private RandomUtil() {
|
|
||||||
throw new IllegalStateException("Utility class");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String randomStr(char[] sourceCharacters, int length) {
|
|
||||||
ThreadLocalRandom random = ThreadLocalRandom.current();
|
|
||||||
char[] result = new char[length];
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
result[i] = sourceCharacters[random.nextInt(sourceCharacters.length)];
|
|
||||||
}
|
|
||||||
return String.valueOf(result);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,23 +0,0 @@
|
|||||||
package xyz.zhouxy.plusone.util;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
class RandomUtilTests {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testRandom() {
|
|
||||||
String[] s = new String[20];
|
|
||||||
for (int i = 0; i < 20; i++) {
|
|
||||||
s[i] = RandomUtil.randomStr(
|
|
||||||
"0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM~`!@#$%^&*()_-+={[\\|/:;\"',.<>?]}"
|
|
||||||
.toCharArray(),
|
|
||||||
28);
|
|
||||||
}
|
|
||||||
log.info("{}", Arrays.toString(s));
|
|
||||||
}
|
|
||||||
}
|
|
@@ -15,6 +15,11 @@
|
|||||||
<groupId>xyz.zhouxy</groupId>
|
<groupId>xyz.zhouxy</groupId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
@@ -23,10 +28,12 @@
|
|||||||
<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>
|
||||||
</dependency>
|
<version>2.13.4</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@@ -1,52 +1,32 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.constant;
|
package xyz.zhouxy.plusone.constant;
|
||||||
|
|
||||||
import java.util.Collection;
|
import xyz.zhouxy.plusone.util.Enumeration;
|
||||||
|
import xyz.zhouxy.plusone.util.EnumerationValuesHolder;
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.util.Enumeration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实体状态
|
* 实体状态
|
||||||
*
|
*
|
||||||
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
||||||
*/
|
*/
|
||||||
public final class EntityStatus extends Enumeration<EntityStatus> {
|
public class EntityStatus extends Enumeration<EntityStatus> {
|
||||||
|
|
||||||
private EntityStatus(int id, @Nonnull String name) {
|
private EntityStatus(int value, String name) {
|
||||||
super(id, name);
|
super(value, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 常量
|
// 常量
|
||||||
public static final EntityStatus AVAILABLE = new EntityStatus(0, "正常");
|
public static final EntityStatus AVAILABLE = new EntityStatus(0, "正常");
|
||||||
public static final EntityStatus DISABLED = new EntityStatus(1, "禁用");
|
public static final EntityStatus DISABLED = new EntityStatus(1, "禁用");
|
||||||
|
|
||||||
private static final ValueSet<EntityStatus> VALUE_SET = new ValueSet<>(
|
private static final EnumerationValuesHolder<EntityStatus> ENUMERATION_VALUES = new EnumerationValuesHolder<>(
|
||||||
AVAILABLE, DISABLED);
|
new EntityStatus[] { AVAILABLE, DISABLED });
|
||||||
|
|
||||||
@Nonnull
|
public static EntityStatus of(int value) {
|
||||||
public static EntityStatus of(int id) {
|
return ENUMERATION_VALUES.get(value);
|
||||||
return VALUE_SET.get(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Override
|
||||||
public static Collection<EntityStatus> constants() {
|
public String toString() {
|
||||||
return VALUE_SET.getValues();
|
return "EntityStatus" + super.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,27 @@
|
|||||||
|
package xyz.zhouxy.plusone.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正则表达式常量
|
||||||
|
*
|
||||||
|
* @author <a href="https://gitee.com/zhouxy108">ZhouXY</a>
|
||||||
|
*/
|
||||||
|
public final class RegexConsts {
|
||||||
|
|
||||||
|
public static final String DATE = "^\\d{4}-\\d{2}-\\d{2}";
|
||||||
|
|
||||||
|
public static final String PASSWORD = "^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[\\w\\\\!#$%&'*\\+\\-/=?^`{|}~@\\(\\)\\[\\]\",\\.;':><]{8,32}$";
|
||||||
|
|
||||||
|
public static final String CAPTCHA = "^[0-9A-Za-z]{4,6}$";
|
||||||
|
|
||||||
|
public static final String EMAIL = "^\\w+([-+.]\\w+)*@[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*(\\.(?![0-9]+$)[a-zA-Z0-9][-0-9A-Za-z]{0,62})$";
|
||||||
|
|
||||||
|
public static final String MOBILE_PHONE = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$";
|
||||||
|
|
||||||
|
public static final String USERNAME = "^[\\da-zA-Z_.@\\\\]{4,36}$";
|
||||||
|
|
||||||
|
public static final String NICKNAME = "^[\\da-zA-Z_.@\\\\]{4,36}$";
|
||||||
|
|
||||||
|
private RegexConsts() {
|
||||||
|
throw new IllegalStateException("Utility class");
|
||||||
|
}
|
||||||
|
}
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@@ -1,23 +1,6 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
import java.util.UUID;
|
import cn.hutool.core.lang.UUID;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +20,7 @@ public abstract class DomainEvent {
|
|||||||
private long happenedAt;
|
private long happenedAt;
|
||||||
|
|
||||||
protected DomainEvent() {
|
protected DomainEvent() {
|
||||||
this.identifier = UUID.randomUUID().toString();
|
this.identifier = UUID.randomUUID().toString(true);
|
||||||
this.happenedAt = System.currentTimeMillis();
|
this.happenedAt = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,23 +1,6 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.domain;
|
package xyz.zhouxy.plusone.domain;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
@@ -30,15 +13,15 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||||||
public abstract class ValidatableStringRecord implements IValueObject {
|
public abstract class ValidatableStringRecord implements IValueObject {
|
||||||
|
|
||||||
protected String value;
|
protected String value;
|
||||||
protected final Pattern format;
|
protected final String format;
|
||||||
|
|
||||||
protected ValidatableStringRecord(Pattern format) {
|
protected ValidatableStringRecord(String format) {
|
||||||
this.format = format;
|
this.format = format;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
protected boolean isValid() {
|
protected boolean isValid() {
|
||||||
return format.matcher(value).matches();
|
return value.matches(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonValue
|
@JsonValue
|
||||||
@@ -52,6 +35,6 @@ public abstract class ValidatableStringRecord implements IValueObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getValueOrNull(Optional<? extends ValidatableStringRecord> s) {
|
public static String getValueOrNull(Optional<? extends ValidatableStringRecord> s) {
|
||||||
return s.isPresent() ? s.get().value() : null;
|
return s.map(ValidatableStringRecord::value).orElse(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,36 @@
|
|||||||
|
package xyz.zhouxy.plusone.util;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class RegexUtil {
|
||||||
|
|
||||||
|
private RegexUtil() {
|
||||||
|
throw new IllegalStateException("Utility class");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean matches(CharSequence input, String regex) {
|
||||||
|
return Pattern.matches(regex, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean matchesOr(CharSequence input, String... regexs) {
|
||||||
|
boolean isMatched;
|
||||||
|
for (var regex : regexs) {
|
||||||
|
isMatched = Pattern.matches(regex, input);
|
||||||
|
if (isMatched) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean matchesAnd(CharSequence input, String... regexs) {
|
||||||
|
boolean isMatched;
|
||||||
|
for (var regex : regexs) {
|
||||||
|
isMatched = Pattern.matches(regex, input);
|
||||||
|
if (!isMatched) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.config;
|
package xyz.zhouxy.plusone.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.exception.config;
|
package xyz.zhouxy.plusone.exception.config;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.infrastructure.pojo;
|
package xyz.zhouxy.plusone.infrastructure.pojo;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc;
|
package xyz.zhouxy.plusone.jdbc;
|
||||||
|
|
||||||
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
|
import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc;
|
package xyz.zhouxy.plusone.jdbc;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc;
|
package xyz.zhouxy.plusone.jdbc;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc;
|
package xyz.zhouxy.plusone.jdbc;
|
||||||
|
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc;
|
package xyz.zhouxy.plusone.jdbc;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc;
|
package xyz.zhouxy.plusone.jdbc;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -30,10 +14,9 @@ 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.exception.DataOperationResultException;
|
import xyz.zhouxy.plusone.exception.DataOperationResultException;
|
||||||
|
import xyz.zhouxy.plusone.util.NumberUtil;
|
||||||
|
|
||||||
public abstract class PlusoneJdbcDaoSupport {
|
public abstract class PlusoneJdbcDaoSupport {
|
||||||
protected final NamedParameterJdbcTemplate jdbc;
|
protected final NamedParameterJdbcTemplate jdbc;
|
||||||
@@ -85,13 +68,13 @@ public abstract class PlusoneJdbcDaoSupport {
|
|||||||
return queryForStream(sql, new MapSqlParameterSource(paramName, value), elementType);
|
return queryForStream(sql, new MapSqlParameterSource(paramName, value), elementType);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final boolean queryForBool(String sql, SqlParameterSource parameterSource) {
|
protected final boolean queryExists(String sql, SqlParameterSource parameterSource) {
|
||||||
Boolean result = this.jdbc.queryForObject(sql, parameterSource, Boolean.TYPE);
|
Boolean isExists = this.jdbc.queryForObject(sql, parameterSource, Boolean.TYPE);
|
||||||
return Boolean.TRUE.equals(result);
|
return Boolean.TRUE.equals(isExists);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final boolean queryForBool(String sql, String paramName, Object value) {
|
protected final boolean queryExists(String sql, String paramName, Object value) {
|
||||||
return queryForBool(sql, new MapSqlParameterSource(paramName, value));
|
return queryExists(sql, new MapSqlParameterSource(paramName, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final int update(String sql, SqlParameterSource parameterSource) {
|
protected final int update(String sql, SqlParameterSource parameterSource) {
|
||||||
@@ -102,18 +85,18 @@ public abstract class PlusoneJdbcDaoSupport {
|
|||||||
return update(sql, new MapSqlParameterSource(paramName, value));
|
return update(sql, new MapSqlParameterSource(paramName, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final long batchUpdate(String sql, SqlParameterSource[] batchArgs) {
|
protected final int batchUpdate(String sql, SqlParameterSource[] batchArgs) {
|
||||||
int[] i = this.jdbc.batchUpdate(sql, batchArgs);
|
int[] i = this.jdbc.batchUpdate(sql, batchArgs);
|
||||||
return NumberUtil.sum(i);
|
return NumberUtil.sum(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <T> long batchUpdate(String sql, Stream<T> c,
|
protected final <T> int batchUpdate(String sql, Stream<T> c,
|
||||||
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
||||||
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
||||||
return NumberUtil.sum(i);
|
return NumberUtil.sum(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <T> long batchUpdate(String sql, Collection<T> c,
|
protected final <T> int batchUpdate(String sql, Collection<T> c,
|
||||||
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
||||||
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
||||||
return NumberUtil.sum(i);
|
return NumberUtil.sum(i);
|
||||||
@@ -173,7 +156,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 (CollectionUtils.isEmpty(c)) {
|
if (c == null || c.isEmpty()) {
|
||||||
return new SqlParameterSource[] {};
|
return new SqlParameterSource[] {};
|
||||||
}
|
}
|
||||||
return buildSqlParameterSourceArray(c.stream(), paramSourceBuilder);
|
return buildSqlParameterSourceArray(c.stream(), paramSourceBuilder);
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc.common;
|
package xyz.zhouxy.plusone.jdbc.common;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc.common;
|
package xyz.zhouxy.plusone.jdbc.common;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc.converter;
|
package xyz.zhouxy.plusone.jdbc.converter;
|
||||||
|
|
||||||
import org.springframework.core.convert.converter.Converter;
|
import org.springframework.core.convert.converter.Converter;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.jdbc.converter;
|
package xyz.zhouxy.plusone.jdbc.converter;
|
||||||
|
|
||||||
import org.springframework.core.convert.converter.Converter;
|
import org.springframework.core.convert.converter.Converter;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.mail;
|
package xyz.zhouxy.plusone.mail;
|
||||||
|
|
||||||
import org.springframework.mail.SimpleMailMessage;
|
import org.springframework.mail.SimpleMailMessage;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.mail;
|
package xyz.zhouxy.plusone.mail;
|
||||||
|
|
||||||
import javax.mail.MessagingException;
|
import javax.mail.MessagingException;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.mail;
|
package xyz.zhouxy.plusone.mail;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.mail;
|
package xyz.zhouxy.plusone.mail;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.mail;
|
package xyz.zhouxy.plusone.mail;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.mybatis;
|
package xyz.zhouxy.plusone.mybatis;
|
||||||
|
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.mybatis;
|
package xyz.zhouxy.plusone.mybatis;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.oss;
|
package xyz.zhouxy.plusone.oss;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.oss;
|
package xyz.zhouxy.plusone.oss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22,7 +6,6 @@ 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() {
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.oss;
|
package xyz.zhouxy.plusone.oss;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.oss;
|
package xyz.zhouxy.plusone.oss;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.redis;
|
package xyz.zhouxy.plusone.redis;
|
||||||
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.redis;
|
package xyz.zhouxy.plusone.redis;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.sms;
|
package xyz.zhouxy.plusone.sms;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.sms;
|
package xyz.zhouxy.plusone.sms;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.sms;
|
package xyz.zhouxy.plusone.sms;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.sms;
|
package xyz.zhouxy.plusone.sms;
|
||||||
|
|
||||||
import com.tencentcloudapi.common.Credential;
|
import com.tencentcloudapi.common.Credential;
|
||||||
@@ -28,7 +12,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import xyz.zhouxy.plusone.constant.ErrorCodeConsts;
|
import xyz.zhouxy.plusone.constant.ErrorCodeConsts;
|
||||||
import xyz.zhouxy.plusone.exception.BizException;
|
import xyz.zhouxy.plusone.exception.PlusoneException;
|
||||||
import xyz.zhouxy.plusone.sms.SmsProperties.SmsCredentialProperties;
|
import xyz.zhouxy.plusone.sms.SmsProperties.SmsCredentialProperties;
|
||||||
import xyz.zhouxy.plusone.sms.SmsProperties.SmsHttpProperties;
|
import xyz.zhouxy.plusone.sms.SmsProperties.SmsHttpProperties;
|
||||||
import xyz.zhouxy.plusone.sms.SmsProperties.SmsProxyProperties;
|
import xyz.zhouxy.plusone.sms.SmsProperties.SmsProxyProperties;
|
||||||
@@ -85,7 +69,7 @@ public class TencentSmsServiceImpl implements SmsService {
|
|||||||
|
|
||||||
} catch (TencentCloudSDKException e) {
|
} catch (TencentCloudSDKException e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
throw new BizException(ErrorCodeConsts.DEFAULT_ERROR_CODE, e);
|
throw new PlusoneException(ErrorCodeConsts.DEFAULT_ERROR_CODE, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.spring;
|
package xyz.zhouxy.plusone.spring;
|
||||||
|
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.validator;
|
package xyz.zhouxy.plusone.validator;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.validator;
|
package xyz.zhouxy.plusone.validator;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.validator;
|
package xyz.zhouxy.plusone.validator;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.web.config;
|
package xyz.zhouxy.plusone.web.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.web.config;
|
package xyz.zhouxy.plusone.web.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@@ -1,29 +1,11 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.validatortest;
|
package xyz.zhouxy.plusone.validatortest;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import xyz.zhouxy.plusone.commons.constant.PatternConsts;
|
import xyz.zhouxy.plusone.constant.RegexConsts;
|
||||||
import xyz.zhouxy.plusone.validator.BaseValidator;
|
import xyz.zhouxy.plusone.validator.BaseValidator;
|
||||||
|
|
||||||
class BaseValidatorTest {
|
class BaseValidatorTest {
|
||||||
@@ -52,11 +34,11 @@ class LoginCommandValidator extends BaseValidator<LoginCommand> {
|
|||||||
private LoginCommandValidator() {
|
private LoginCommandValidator() {
|
||||||
ruleForString(LoginCommand::getAccount)
|
ruleForString(LoginCommand::getAccount)
|
||||||
.notNull("邮箱地址不能为空")
|
.notNull("邮箱地址不能为空")
|
||||||
.matchesOr(new Pattern[] { PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE },
|
.matchesOr(new String[] { RegexConsts.EMAIL, RegexConsts.MOBILE_PHONE },
|
||||||
value -> new RuntimeException('"' + value + "\" 不是邮箱地址或手机号"));
|
value -> new RuntimeException('"' + value + "\" 不是邮箱地址或手机号"));
|
||||||
ruleForString(LoginCommand::getPwd)
|
ruleForString(LoginCommand::getPwd)
|
||||||
.notNull("密码不能为空")
|
.notNull("密码不能为空")
|
||||||
.notEmpty("密码不能为空")
|
.notEmpty("密码不能为空")
|
||||||
.matches(PatternConsts.PASSWORD, "密码格式错误");
|
.matches(RegexConsts.PASSWORD, "密码格式错误");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,9 @@
|
|||||||
<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>
|
||||||
|
|
||||||
|
@@ -7,7 +7,10 @@
|
|||||||
<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>
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone;
|
package xyz.zhouxy.plusone;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone;
|
package xyz.zhouxy.plusone;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone;
|
package xyz.zhouxy.plusone;
|
||||||
|
|
||||||
import java.io.ObjectStreamClass;
|
import java.io.ObjectStreamClass;
|
||||||
@@ -21,14 +5,14 @@ import java.io.ObjectStreamClass;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import xyz.zhouxy.plusone.exception.*;
|
import xyz.zhouxy.plusone.exception.PlusoneException;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
class SerialTests {
|
class SerialTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSerialVersionUID() {
|
void testSerialVersionUID() {
|
||||||
var cl = SysException.class;
|
var cl = PlusoneException.class;
|
||||||
var c = ObjectStreamClass.lookup(cl);
|
var c = ObjectStreamClass.lookup(cl);
|
||||||
var uid = c.getSerialVersionUID();
|
var uid = c.getSerialVersionUID();
|
||||||
log.info("\n @java.io.Serial" +
|
log.info("\n @java.io.Serial" +
|
||||||
|
@@ -1,23 +1,5 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone;
|
package xyz.zhouxy.plusone;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -43,7 +25,6 @@ class TestAop {
|
|||||||
command.setPrincipal("Code108");
|
command.setPrincipal("Code108");
|
||||||
command.setPassword("2333");
|
command.setPassword("2333");
|
||||||
command.setRememberMe(false);
|
command.setRememberMe(false);
|
||||||
assertNotNull(service);
|
|
||||||
LoginInfoViewObject loginInfo = service.loginByPassword(command);
|
LoginInfoViewObject loginInfo = service.loginByPassword(command);
|
||||||
System.err.println(loginInfo);
|
System.err.println(loginInfo);
|
||||||
}
|
}
|
||||||
|
@@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.common.exception;
|
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.exception.BizException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 不支持的 Principal 类型出现时抛出的异常
|
|
||||||
*
|
|
||||||
* @author <a href="https://zhouxy.xyz:3000/ZhouXY108">ZhouXY</a>
|
|
||||||
*/
|
|
||||||
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, DEFAULT_ERROR_MSG);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsupportedPrincipalTypeException(String msg) {
|
|
||||||
super(ERR_CODE, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsupportedPrincipalTypeException(Throwable cause) {
|
|
||||||
super(ERR_CODE, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsupportedPrincipalTypeException(String msg, Throwable cause) {
|
|
||||||
super(ERR_CODE, msg, cause);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.common.util;
|
package xyz.zhouxy.plusone.system.application.common.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@@ -1,36 +1,18 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.common.util;
|
package xyz.zhouxy.plusone.system.application.common.util;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import xyz.zhouxy.plusone.commons.constant.PatternConsts;
|
import xyz.zhouxy.plusone.constant.RegexConsts;
|
||||||
|
|
||||||
public enum PrincipalType {
|
public enum PrincipalType {
|
||||||
EMAIL(PatternConsts.EMAIL),
|
EMAIL(RegexConsts.EMAIL),
|
||||||
MOBILE_PHONE(PatternConsts.MOBILE_PHONE),
|
MOBILE_PHONE(RegexConsts.MOBILE_PHONE),
|
||||||
USERNAME(PatternConsts.USERNAME)
|
USERNAME(RegexConsts.USERNAME)
|
||||||
;
|
;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Pattern regex;
|
private final String regex;
|
||||||
|
|
||||||
PrincipalType(Pattern regex) {
|
PrincipalType(String regex) {
|
||||||
this.regex = regex;
|
this.regex = regex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,28 +1,12 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.common.util;
|
package xyz.zhouxy.plusone.system.application.common.util;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.system.application.common.exception.UnsupportedPrincipalTypeException;
|
|
||||||
import xyz.zhouxy.plusone.system.domain.model.account.Email;
|
import xyz.zhouxy.plusone.system.domain.model.account.Email;
|
||||||
import xyz.zhouxy.plusone.system.domain.model.account.MobilePhone;
|
import xyz.zhouxy.plusone.system.domain.model.account.MobilePhone;
|
||||||
import xyz.zhouxy.plusone.system.domain.model.account.Principal;
|
import xyz.zhouxy.plusone.system.domain.model.account.Principal;
|
||||||
import xyz.zhouxy.plusone.system.domain.model.account.Username;
|
import xyz.zhouxy.plusone.system.domain.model.account.Username;
|
||||||
|
import xyz.zhouxy.plusone.validator.InvalidInputException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据字面值,判断并生成 {@link Principal} 值对象。
|
* 根据字面值,判断并生成 {@link Principal} 值对象。
|
||||||
@@ -32,7 +16,7 @@ import xyz.zhouxy.plusone.system.domain.model.account.Username;
|
|||||||
* @see Username
|
* @see Username
|
||||||
* @see Email
|
* @see Email
|
||||||
* @see MobilePhone
|
* @see MobilePhone
|
||||||
* @see UnsupportedPrincipalTypeException
|
* @see InvalidInputException
|
||||||
*/
|
*/
|
||||||
public class PrincipalUtil {
|
public class PrincipalUtil {
|
||||||
|
|
||||||
@@ -46,11 +30,11 @@ public class PrincipalUtil {
|
|||||||
}
|
}
|
||||||
PrincipalType[] principalTypes = PrincipalType.values();
|
PrincipalType[] principalTypes = PrincipalType.values();
|
||||||
for (var principalType : principalTypes) {
|
for (var principalType : principalTypes) {
|
||||||
if (principalType.getRegex().matcher(principal).matches()) {
|
if (principal.matches(principalType.getRegex())) {
|
||||||
return principalType;
|
return principalType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new UnsupportedPrincipalTypeException();
|
throw InvalidInputException.unsupportedPrincipalTypeException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Principal getPrincipal(@Nullable String principal) {
|
public static Principal getPrincipal(@Nullable String principal) {
|
||||||
@@ -64,7 +48,7 @@ public class PrincipalUtil {
|
|||||||
if (principalType == PrincipalType.USERNAME) {
|
if (principalType == PrincipalType.USERNAME) {
|
||||||
return Username.of(principal);
|
return Username.of(principal);
|
||||||
}
|
}
|
||||||
throw new UnsupportedPrincipalTypeException();
|
throw InvalidInputException.unsupportedPrincipalTypeException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Principal getEmailOrMobilePhone(@Nullable String principal) {
|
public static Principal getEmailOrMobilePhone(@Nullable String principal) {
|
||||||
@@ -75,6 +59,6 @@ public class PrincipalUtil {
|
|||||||
if (principalType == PrincipalType.MOBILE_PHONE) {
|
if (principalType == PrincipalType.MOBILE_PHONE) {
|
||||||
return MobilePhone.of(principal);
|
return MobilePhone.of(principal);
|
||||||
}
|
}
|
||||||
throw new UnsupportedPrincipalTypeException("输入邮箱地址或手机号");
|
throw InvalidInputException.unsupportedPrincipalTypeException("输入邮箱地址或手机号");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.controller;
|
package xyz.zhouxy.plusone.system.application.controller;
|
||||||
|
|
||||||
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
||||||
@@ -23,10 +7,10 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
|
||||||
import xyz.zhouxy.plusone.system.application.service.AccountContextService;
|
import xyz.zhouxy.plusone.system.application.service.AccountContextService;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.ChangePasswordCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.ChangePasswordCommand;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.ChangePasswordWithoutLoginCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.ChangePasswordWithoutLoginCommand;
|
||||||
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号查询本身相关信息
|
* 账号查询本身相关信息
|
||||||
|
@@ -1,23 +1,7 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.controller;
|
package xyz.zhouxy.plusone.system.application.controller;
|
||||||
|
|
||||||
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
||||||
import static xyz.zhouxy.plusone.commons.util.RestfulResult.success;
|
import static xyz.zhouxy.plusone.util.RestfulResult.success;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -32,11 +16,11 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
|
||||||
import xyz.zhouxy.plusone.system.application.query.params.AccountQueryParams;
|
import xyz.zhouxy.plusone.system.application.query.params.AccountQueryParams;
|
||||||
import xyz.zhouxy.plusone.system.application.service.AccountManagementService;
|
import xyz.zhouxy.plusone.system.application.service.AccountManagementService;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.CreateAccountCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.CreateAccountCommand;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.UpdateAccountCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.UpdateAccountCommand;
|
||||||
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号管理
|
* 账号管理
|
||||||
|
@@ -1,22 +1,6 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.controller;
|
package xyz.zhouxy.plusone.system.application.controller;
|
||||||
|
|
||||||
import static xyz.zhouxy.plusone.commons.util.RestfulResult.success;
|
import static xyz.zhouxy.plusone.util.RestfulResult.success;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -28,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import xyz.zhouxy.plusone.system.application.service.AdminLoginService;
|
import xyz.zhouxy.plusone.system.application.service.AdminLoginService;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.LoginByOtpCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.LoginByOtpCommand;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.LoginByPasswordCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.LoginByPasswordCommand;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin 账号登录
|
* Admin 账号登录
|
||||||
|
@@ -1,23 +1,7 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.controller;
|
package xyz.zhouxy.plusone.system.application.controller;
|
||||||
|
|
||||||
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
||||||
import static xyz.zhouxy.plusone.commons.util.RestfulResult.success;
|
import static xyz.zhouxy.plusone.util.RestfulResult.success;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -36,7 +20,7 @@ import xyz.zhouxy.plusone.system.application.query.params.DictQueryParams;
|
|||||||
import xyz.zhouxy.plusone.system.application.service.DictManagementService;
|
import xyz.zhouxy.plusone.system.application.service.DictManagementService;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.CreateDictCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.CreateDictCommand;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.UpdateDictCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.UpdateDictCommand;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据字典管理
|
* 数据字典管理
|
||||||
|
@@ -1,23 +1,7 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.controller;
|
package xyz.zhouxy.plusone.system.application.controller;
|
||||||
|
|
||||||
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
import static xyz.zhouxy.plusone.system.constant.AuthLogic.adminAuthLogic;
|
||||||
import static xyz.zhouxy.plusone.commons.util.RestfulResult.success;
|
import static xyz.zhouxy.plusone.util.RestfulResult.success;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@@ -34,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import xyz.zhouxy.plusone.system.application.service.MenuManagementService;
|
import xyz.zhouxy.plusone.system.application.service.MenuManagementService;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.CreateMenuCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.CreateMenuCommand;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.UpdateMenuCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.UpdateMenuCommand;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单管理
|
* 菜单管理
|
||||||
|
@@ -1,22 +1,6 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.controller;
|
package xyz.zhouxy.plusone.system.application.controller;
|
||||||
|
|
||||||
import static xyz.zhouxy.plusone.commons.util.RestfulResult.success;
|
import static xyz.zhouxy.plusone.util.RestfulResult.success;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -27,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import xyz.zhouxy.plusone.system.application.service.RegisterAccountService;
|
import xyz.zhouxy.plusone.system.application.service.RegisterAccountService;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.RegisterAccountCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.RegisterAccountCommand;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册账号服务
|
* 注册账号服务
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.controller;
|
package xyz.zhouxy.plusone.system.application.controller;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@@ -33,7 +17,7 @@ import xyz.zhouxy.plusone.system.application.query.params.RoleQueryParams;
|
|||||||
import xyz.zhouxy.plusone.system.application.service.RoleManagementService;
|
import xyz.zhouxy.plusone.system.application.service.RoleManagementService;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.CreateRoleCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.CreateRoleCommand;
|
||||||
import xyz.zhouxy.plusone.system.application.service.command.UpdateRoleCommand;
|
import xyz.zhouxy.plusone.system.application.service.command.UpdateRoleCommand;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色管理服务
|
* 角色管理服务
|
||||||
|
@@ -1,28 +1,12 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.exception;
|
package xyz.zhouxy.plusone.system.application.exception;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.exception.BizException;
|
import xyz.zhouxy.plusone.exception.PlusoneException;
|
||||||
|
|
||||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||||
public class AccountLoginException extends BizException {
|
public class AccountLoginException extends PlusoneException {
|
||||||
@java.io.Serial
|
@java.io.Serial
|
||||||
private static final long serialVersionUID = -3040996790739138556L;
|
private static final long serialVersionUID = -3040996790739138556L;
|
||||||
|
|
||||||
|
@@ -1,28 +1,12 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.exception;
|
package xyz.zhouxy.plusone.system.application.exception;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.exception.BizException;
|
import xyz.zhouxy.plusone.exception.PlusoneException;
|
||||||
|
|
||||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||||
public class AccountRegisterException extends BizException {
|
public class AccountRegisterException extends PlusoneException {
|
||||||
|
|
||||||
@java.io.Serial
|
@java.io.Serial
|
||||||
private static final long serialVersionUID = 7580245181633370195L;
|
private static final long serialVersionUID = 7580245181633370195L;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.exception;
|
package xyz.zhouxy.plusone.system.application.exception;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.validator.InvalidInputException;
|
import xyz.zhouxy.plusone.validator.InvalidInputException;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.exception.handler;
|
package xyz.zhouxy.plusone.system.application.exception.handler;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
@@ -24,7 +8,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|||||||
|
|
||||||
import xyz.zhouxy.plusone.exception.handler.BaseExceptionHandler;
|
import xyz.zhouxy.plusone.exception.handler.BaseExceptionHandler;
|
||||||
import xyz.zhouxy.plusone.system.application.exception.AccountLoginException;
|
import xyz.zhouxy.plusone.system.application.exception.AccountLoginException;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class AccountLoginExceptionHandler extends BaseExceptionHandler {
|
public class AccountLoginExceptionHandler extends BaseExceptionHandler {
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.exception.handler;
|
package xyz.zhouxy.plusone.system.application.exception.handler;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -31,7 +15,7 @@ import cn.dev33.satoken.exception.SaTokenException;
|
|||||||
import cn.dev33.satoken.exception.SameTokenInvalidException;
|
import cn.dev33.satoken.exception.SameTokenInvalidException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import xyz.zhouxy.plusone.exception.handler.BaseExceptionHandler;
|
import xyz.zhouxy.plusone.exception.handler.BaseExceptionHandler;
|
||||||
import xyz.zhouxy.plusone.commons.util.RestfulResult;
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sa-Token 异常处理器
|
* Sa-Token 异常处理器
|
||||||
|
@@ -1,29 +1,13 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query;
|
package xyz.zhouxy.plusone.system.application.query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.util.PageDTO;
|
|
||||||
import xyz.zhouxy.plusone.system.application.query.params.AccountQueryParams;
|
import xyz.zhouxy.plusone.system.application.query.params.AccountQueryParams;
|
||||||
import xyz.zhouxy.plusone.system.application.query.result.AccountDetails;
|
import xyz.zhouxy.plusone.system.application.query.result.AccountDetails;
|
||||||
import xyz.zhouxy.plusone.system.application.query.result.AccountOverview;
|
import xyz.zhouxy.plusone.system.application.query.result.AccountOverview;
|
||||||
|
import xyz.zhouxy.plusone.util.PageDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号信息查询器
|
* 账号信息查询器
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query;
|
package xyz.zhouxy.plusone.system.application.query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query;
|
package xyz.zhouxy.plusone.system.application.query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query;
|
package xyz.zhouxy.plusone.system.application.query;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query.params;
|
package xyz.zhouxy.plusone.system.application.query.params;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -21,7 +5,7 @@ import java.time.LocalDate;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import xyz.zhouxy.plusone.commons.util.PagingAndSortingQueryParams;
|
import xyz.zhouxy.plusone.util.PagingAndSortingQueryParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号信息查询参数
|
* 账号信息查询参数
|
||||||
|
@@ -1,26 +1,10 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query.params;
|
package xyz.zhouxy.plusone.system.application.query.params;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import xyz.zhouxy.plusone.commons.util.PagingAndSortingQueryParams;
|
import xyz.zhouxy.plusone.util.PagingAndSortingQueryParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据字典查询参数
|
* 数据字典查询参数
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query.params;
|
package xyz.zhouxy.plusone.system.application.query.params;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -21,7 +5,7 @@ import java.time.LocalDate;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import xyz.zhouxy.plusone.commons.util.PagingAndSortingQueryParams;
|
import xyz.zhouxy.plusone.util.PagingAndSortingQueryParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色信息查询参数
|
* 角色信息查询参数
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query.result;
|
package xyz.zhouxy.plusone.system.application.query.result;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query.result;
|
package xyz.zhouxy.plusone.system.application.query.result;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
@@ -1,19 +1,3 @@
|
|||||||
/*
|
|
||||||
* Copyright 2022-2023 the original author or authors.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package xyz.zhouxy.plusone.system.application.query.result;
|
package xyz.zhouxy.plusone.system.application.query.result;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user