BUGFIX: format;

This commit is contained in:
shahaibo
2023-10-20 14:47:18 +08:00
parent f18c27fe02
commit 9fa605f83e
134 changed files with 1345 additions and 1203 deletions

View File

@@ -20,25 +20,26 @@ public class FileProperties {
private String linuxDomain;
public ElPath getSys(){
public ElPath getSys() {
String os = System.getProperty("os.name");
if(os.toLowerCase().startsWith("win")) {
if (os.toLowerCase().startsWith("win")) {
return windows;
} else if(os.toLowerCase().startsWith("mac")){
} else if (os.toLowerCase().startsWith("mac")) {
return mac;
}
return linux;
}
public String getLinuxDomain(){
public String getLinuxDomain() {
String os = System.getProperty("os.name");
if((!os.toLowerCase().startsWith("win") )&& (!os.toLowerCase().startsWith("mac"))) {
if ((!os.toLowerCase().startsWith("win")) && (!os.toLowerCase().startsWith("mac"))) {
return linuxDomain;
}
return null;
}
@Data
public static class ElPath{
public static class ElPath {
private String path;
}
}

View File

@@ -18,10 +18,11 @@ public class MinIoClientConfig {
/**
* 注入minio 客户端
*
* @return
*/
@Bean
public MinioClient minioClient(){
public MinioClient minioClient() {
return MinioClient.builder()
.endpoint(endpoint)

View File

@@ -14,7 +14,7 @@ public class BusinessException extends RuntimeException {
private Integer code;
private String msg;
public BusinessException(ResultEnum resultEnum){
public BusinessException(ResultEnum resultEnum) {
super(resultEnum.getMsg());
this.code = resultEnum.getCode();
this.msg = resultEnum.getMsg();

View File

@@ -51,11 +51,12 @@ public class ExceptionCatch {
return Response.error(resultEnum.getCode(), resultEnum.getMsg());
}
}
return Response.error(ResultEnum.ERROR.getCode(), e.getMessage()==null?ResultEnum.ERROR.getMsg():e.getMessage());
return Response.error(ResultEnum.ERROR.getCode(), e.getMessage() == null ? ResultEnum.ERROR.getMsg() : e.getMessage());
}
/**
* 处理参数校验异常
*
* @param e
* @return ResponseData
*/
@@ -68,6 +69,7 @@ public class ExceptionCatch {
/**
* 处理参数校验异常
*
* @param e
* @return ResponseData
*/

View File

@@ -22,7 +22,7 @@ import java.util.function.Function;
**/
@Data
@Slf4j
public abstract class QueryCriteria<T,E> {
public abstract class QueryCriteria<T, E> {
private long page = 1;
private long limit = 10;
@@ -36,12 +36,12 @@ public abstract class QueryCriteria<T,E> {
this.mapper = mapper;
}
public QueryWrapper<T> buildWrapper(){
public QueryWrapper<T> buildWrapper() {
QueryWrapper<T> wrapper = new QueryWrapper<>();
Field[] fields = this.getClass().getDeclaredFields();
for (Field field : fields) {
Condition condition = field.getAnnotation(Condition.class);
if(condition != null){
if (condition != null) {
field.setAccessible(true);
Object value = null;
try {
@@ -49,27 +49,27 @@ public abstract class QueryCriteria<T,E> {
} catch (IllegalAccessException e) {
log.warn("reflection anomaly!");
}
if(!StrUtil.isEmptyIfStr(value)){
switch (condition.type()){
if (!StrUtil.isEmptyIfStr(value)) {
switch (condition.type()) {
case EQ:
wrapper.eq(ConvertUtil.humpToLine2(field.getName()), value);
break;
case LIKE:
wrapper.like(ConvertUtil.humpToLine2(field.getName()), value);
case BETWEEN:
if(value instanceof Collection && ((List) value).size() >= 2){
wrapper.between(ConvertUtil.humpToLine2(field.getName()), ((List)value).get(0), ((List)value).get(1));
if (value instanceof Collection && ((List) value).size() >= 2) {
wrapper.between(ConvertUtil.humpToLine2(field.getName()), ((List) value).get(0), ((List) value).get(1));
}
default:
}
}else if(condition.isNull()){
} else if (condition.isNull()) {
wrapper.isNull(ConvertUtil.humpToLine2(field.getName()));
}
}
Order order = field.getAnnotation(Order.class);
if(order != null){
if(!StrUtil.isEmptyIfStr(order.order())){
switch (order.order()){
if (order != null) {
if (!StrUtil.isEmptyIfStr(order.order())) {
switch (order.order()) {
case DESC:
wrapper.orderByDesc(ConvertUtil.humpToLine2(field.getName()));
break;

View File

@@ -16,9 +16,9 @@ public class AidaConfiguration {
@Bean(value = "IntelligentCurtainApis")
public Docket gxyd5aThemeApis() {
Contact contact = new Contact("Mr.Y","","136");
Contact contact = new Contact("Mr.Y", "", "136");
Docket docket=new Docket(DocumentationType.SWAGGER_2)
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(new ApiInfoBuilder()
.description("aida接口文档")
.contact(contact)