修改模板.
This commit is contained in:
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class VelocityTemplateEngine extends AbstractTemplateEngine {
|
||||
|
||||
private Map<String, String> tableComment;
|
||||
private final Map<String, String> tableComment;
|
||||
|
||||
private VelocityEngine velocityEngine;
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package ${currentPackage};
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* $!{table.comment} 创建请求对象
|
||||
@@ -29,6 +29,7 @@ public class ${type}CreateRequest implements Serializable {
|
||||
#foreach($field in ${table.fields})
|
||||
#if("$!field.propertyName" != "id")
|
||||
#if("$field.propertyType" == "String")
|
||||
@Size(max = $field.metaInfo.length)
|
||||
@NotBlank
|
||||
#else
|
||||
@NotNull
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.orion.ops.framework.common.entity.PageRequest;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -22,6 +23,9 @@ import java.util.*;
|
||||
public class ${type}QueryRequest extends PageRequest {
|
||||
#foreach($field in ${table.fields})
|
||||
|
||||
#if("$field.propertyType" == "String")
|
||||
@Size(max = $field.metaInfo.length)
|
||||
#end
|
||||
#if("$!field.comment" != "")
|
||||
@Schema(description = "${field.comment}")
|
||||
#end
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package ${currentPackage};
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.Serializable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* $!{table.comment} 更新请求对象
|
||||
@@ -28,6 +28,7 @@ public class ${type}UpdateRequest implements Serializable {
|
||||
#foreach($field in ${table.fields})
|
||||
|
||||
#if("$field.propertyType" == "String")
|
||||
@Size(max = $field.metaInfo.length)
|
||||
@NotBlank
|
||||
#else
|
||||
@NotNull
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.orion.ops.framework.security.core.filter;
|
||||
|
||||
import com.orion.lang.exception.argument.HttpWrapperException;
|
||||
import com.orion.lang.utils.Strings;
|
||||
import com.orion.ops.framework.common.constant.ErrorCode;
|
||||
import com.orion.ops.framework.common.security.LoginUser;
|
||||
@@ -45,8 +46,11 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
|
||||
SecurityUtils.setLoginUser(loginUser, request);
|
||||
}
|
||||
}
|
||||
} catch (HttpWrapperException e) {
|
||||
log.error("TokenAuthenticationFilter.doFilterInternal auth error", e);
|
||||
Servlets.writeHttpWrapper(response, e.getWrapper());
|
||||
} catch (Exception e) {
|
||||
log.error("TokenAuthenticationFilter.doFilterInternal error", e);
|
||||
log.error("TokenAuthenticationFilter.doFilterInternal parser error", e);
|
||||
Servlets.writeHttpWrapper(response, ErrorCode.INTERNAL_SERVER_ERROR.getWrapper());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user