提交 452db1e3 authored 作者:  狄熙卜's avatar 狄熙卜

修改错误拼写

上级 f5c2ec91
......@@ -28,17 +28,17 @@ public class CryptProperties {
//entity中全局加解密字段的例外(在例外中不加解密)
private List<Map> globalDisableMapFields;
//sql加解密字段
private List<Map> sqlFileds;
private List<Map> sqlFields;
//sql仅加密字段
private List<Map> sqlEncryptFileds;
private List<Map> sqlEncryptFields;
//sql仅解密字段
private List<Map> sqlDecryptFileds;
private List<Map> sqlDecryptFields;
//实体加解密字段
private List<Map> entityFileds;
private List<Map> entityFields;
//sql参数为单独的string,对参数加密(等价于注解)
private List<String> sqlSingleEncryptFileds;
private List<String> sqlSingleEncryptFields;
//sql返回值为单独的string,对返回值加密(等价于注解)
private List<String> sqlSingleDecryptFileds;
private List<String> sqlSingleDecryptFields;
public CryptProperties(boolean cryptEnable) {
this.cryptEnable = cryptEnable;
}
......@@ -47,20 +47,20 @@ public class CryptProperties {
this.cryptType = cryptType;
}
public List<String> getSqlSingleEncryptFileds() {
return sqlSingleEncryptFileds;
public List<String> getSqlSingleEncryptFields() {
return sqlSingleEncryptFields;
}
public void setSqlSingleEncryptFileds(List<String> sqlSingleEncryptFileds) {
this.sqlSingleEncryptFileds = sqlSingleEncryptFileds;
public void setSqlSingleEncryptFields(List<String> sqlSingleEncryptFields) {
this.sqlSingleEncryptFields = sqlSingleEncryptFields;
}
public List<String> getSqlSingleDecryptFileds() {
return sqlSingleDecryptFileds;
public List<String> getSqlSingleDecryptFields() {
return sqlSingleDecryptFields;
}
public void setSqlSingleDecryptFileds(List<String> sqlSingleDecryptFileds) {
this.sqlSingleDecryptFileds = sqlSingleDecryptFileds;
public void setSqlSingleDecryptFields(List<String> sqlSingleDecryptFields) {
this.sqlSingleDecryptFields = sqlSingleDecryptFields;
}
public boolean isUserSm4KeyEnable() {
......@@ -144,36 +144,36 @@ public class CryptProperties {
this.globalDisableMapFields = globalDisableMapFields;
}
public List<Map> getSqlFileds() {
return sqlFileds;
public List<Map> getSqlFields() {
return sqlFields;
}
public void setSqlFileds(List<Map> sqlFileds) {
this.sqlFileds = sqlFileds;
public void setSqlFields(List<Map> sqlFields) {
this.sqlFields = sqlFields;
}
public List<Map> getSqlEncryptFileds() {
return sqlEncryptFileds;
public List<Map> getSqlEncryptFields() {
return sqlEncryptFields;
}
public void setSqlEncryptFileds(List<Map> sqlEncryptFileds) {
this.sqlEncryptFileds = sqlEncryptFileds;
public void setSqlEncryptFields(List<Map> sqlEncryptFields) {
this.sqlEncryptFields = sqlEncryptFields;
}
public List<Map> getSqlDecryptFileds() {
return sqlDecryptFileds;
public List<Map> getSqlDecryptFields() {
return sqlDecryptFields;
}
public void setSqlDecryptFileds(List<Map> sqlDecryptFileds) {
this.sqlDecryptFileds = sqlDecryptFileds;
public void setSqlDecryptFields(List<Map> sqlDecryptFields) {
this.sqlDecryptFields = sqlDecryptFields;
}
public List<Map> getEntityFileds() {
return entityFileds;
public List<Map> getEntityFields() {
return entityFields;
}
public void setEntityFileds(List<Map> entityFileds) {
this.entityFileds = entityFileds;
public void setEntityFields(List<Map> entityFields) {
this.entityFields = entityFields;
}
public boolean isEncryptDecryptEntityField(String entityName, String fieldName) {
......@@ -183,8 +183,8 @@ public class CryptProperties {
if(isGlobalFields(null, entityName, fieldName)){
return true;
}else{
List<Map> entityFileds = getEntityFileds();
if(getEntityContainsField(entityFileds,entityName,fieldName)){
List<Map> entityFields = getEntityFields();
if(getEntityContainsField(entityFields,entityName,fieldName)){
return true;
}else{
return false;
......@@ -199,9 +199,9 @@ public class CryptProperties {
if(isGlobalFields(mapid,null, fieldName)){
return true;
}else{
List<Map> sqlFileds = getSqlFileds();
List<Map> sqlEncryptFileds = getSqlEncryptFileds();
if(getMapContainsField(sqlFileds,mapid,fieldName) || getMapContainsField(sqlEncryptFileds,mapid,fieldName)){
List<Map> sqlFields = getSqlFields();
List<Map> sqlEncryptFields = getSqlEncryptFields();
if(getMapContainsField(sqlFields,mapid,fieldName) || getMapContainsField(sqlEncryptFields,mapid,fieldName)){
return true;
}else{
return false;
......@@ -216,9 +216,9 @@ public class CryptProperties {
if(isGlobalFields(mapid,null, fieldName)){
return true;
}else{
List<Map> sqlFileds = getSqlFileds();
List<Map> sqlDecryptFileds = getSqlDecryptFileds();
if(getMapContainsField(sqlFileds,mapid,fieldName) || getMapContainsField(sqlDecryptFileds,mapid,fieldName)){
List<Map> sqlFields = getSqlFields();
List<Map> sqlDecryptFields = getSqlDecryptFields();
if(getMapContainsField(sqlFields,mapid,fieldName) || getMapContainsField(sqlDecryptFields,mapid,fieldName)){
return true;
}else{
return false;
......
......@@ -122,10 +122,10 @@ public class EncryptAdapterBuilder {
}
}
}
if(CollectionUtils.isNotEmpty(cryptProperties.getSqlSingleEncryptFileds())){
for (String filed : cryptProperties.getSqlSingleEncryptFileds()) {
if(CollectionUtils.isNotEmpty(cryptProperties.getSqlSingleEncryptFields())){
for (String field : cryptProperties.getSqlSingleEncryptFields()) {
String name = method.getDeclaringClass().getName()+"."+method.getName();
if(StringUtils.isNotBlank(name) && name.endsWith(filed)){
if(StringUtils.isNotBlank(name) && name.endsWith(field)){
return true;
}
}
......@@ -166,10 +166,10 @@ public class EncryptAdapterBuilder {
if(annotation != null){
return true;
}
if(CollectionUtils.isNotEmpty(cryptProperties.getSqlSingleDecryptFileds())){
for (String filed : cryptProperties.getSqlSingleDecryptFileds()) {
if(CollectionUtils.isNotEmpty(cryptProperties.getSqlSingleDecryptFields())){
for (String field : cryptProperties.getSqlSingleDecryptFields()) {
String name = method.getDeclaringClass().getName()+"."+method.getName();
if(StringUtils.isNotBlank(name) && name.endsWith(filed)){
if(StringUtils.isNotBlank(name) && name.endsWith(field)){
return true;
}
}
......
......@@ -126,24 +126,24 @@ public class EncryptInterceptor implements Interceptor {
dbEncryptXmlConfig.getGlobalEnableFields();
dbEncryptXmlConfig.getGlobalDisableMapFields();
dbEncryptXmlConfig.getGlobalDisableEntityFields();
dbEncryptXmlConfig.getSqlFileds();
dbEncryptXmlConfig.getSqlEncryptFileds();
dbEncryptXmlConfig.getSqlDecryptFileds();
dbEncryptXmlConfig.getEntityFileds();
dbEncryptXmlConfig.getSqlSingleEncryptFileds();
dbEncryptXmlConfig.getSqlSingleDecryptFileds();
dbEncryptXmlConfig.getSqlFields();
dbEncryptXmlConfig.getSqlEncryptFields();
dbEncryptXmlConfig.getSqlDecryptFields();
dbEncryptXmlConfig.getEntityFields();
dbEncryptXmlConfig.getSqlSingleEncryptFields();
dbEncryptXmlConfig.getSqlSingleDecryptFields();
//添加预置的字段
dbEncryptXmlConfig.addBaseConfigFileds();
dbEncryptXmlConfig.addBaseConfigFields();
//根据注解获取加解密配置
dbEncryptXmlConfig.addAnnotationConfigFileds();
dbEncryptXmlConfig.addAnnotationConfigFields();
this.cryptProperties.setGlobalEnableFields(dbEncryptXmlConfig.getGlobalEnableFields());
this.cryptProperties.setGlobalDisableMapFields(dbEncryptXmlConfig.getGlobalDisableMapFields());
this.cryptProperties.setGlobalDisableEntityFields(dbEncryptXmlConfig.getGlobalDisableEntityFields());
this.cryptProperties.setSqlFileds(dbEncryptXmlConfig.getSqlFileds());
this.cryptProperties.setSqlEncryptFileds(dbEncryptXmlConfig.getSqlEncryptFileds());
this.cryptProperties.setSqlDecryptFileds(dbEncryptXmlConfig.getSqlDecryptFileds());
this.cryptProperties.setEntityFileds(dbEncryptXmlConfig.getEntityFileds());
this.cryptProperties.setSqlSingleEncryptFileds(dbEncryptXmlConfig.getSqlSingleEncryptFileds());
this.cryptProperties.setSqlSingleDecryptFileds(dbEncryptXmlConfig.getSqlSingleDecryptFileds());
this.cryptProperties.setSqlFields(dbEncryptXmlConfig.getSqlFields());
this.cryptProperties.setSqlEncryptFields(dbEncryptXmlConfig.getSqlEncryptFields());
this.cryptProperties.setSqlDecryptFields(dbEncryptXmlConfig.getSqlDecryptFields());
this.cryptProperties.setEntityFields(dbEncryptXmlConfig.getEntityFields());
this.cryptProperties.setSqlSingleEncryptFields(dbEncryptXmlConfig.getSqlSingleEncryptFields());
this.cryptProperties.setSqlSingleDecryptFields(dbEncryptXmlConfig.getSqlSingleDecryptFields());
}
}
......@@ -108,8 +108,8 @@ public class CommonEncryptAdapter implements EncryptAdapter {
if (MapUtils.isEmpty(cryptFieldMap)) {
return param;
}
Map<String, Crypt> needCryptFiledMap = this.getNeedCryptFiledMap(cryptFieldMap, example);
if (MapUtils.isEmpty(needCryptFiledMap)) {
Map<String, Crypt> needCryptFieldMap = this.getNeedCryptFieldMap(cryptFieldMap, example);
if (MapUtils.isEmpty(needCryptFieldMap)) {
return param;
}*/
List<String> cryptFieldList = this.getCryptFieldList(fields,entityclass);
......
......@@ -11,13 +11,13 @@ public @interface Encrypt {
//分组 分组之后才能进行加解密
String group();
//方法上使用的字段 对sql中的字段进行加解密
String fileds() default "";
String fields() default "";
//方法上使用的字段 对sql中入参的字段进行加密
String encodeFileds() default "";
String encodeFields() default "";
//方法上使用的字段 对sql中返回值的字段进行解密
String decodeFileds() default "";
String decodeFields() default "";
//方法上使用的字段 在只有一个参数时加密
boolean singleEncryptFileds() default false;
boolean singleEncryptFields() default false;
//方法上使用的字段 在只有一个参数时解密
boolean singleDecryptFileds() default false;
boolean singleDecryptFields() default false;
}
......@@ -11,17 +11,17 @@ public interface BaseConfig {
//全局加密字段 正向
List<String> getGlobalEnableFields();
//sql加解密字段 正向
List<Map> getSqlFileds();
List<Map> getSqlFields();
//sql加密字段 正向
List<Map> getSqlEncryptFileds();
List<Map> getSqlEncryptFields();
//sql解密字段 正向
List<Map> getSqlDecryptFileds();
List<Map> getSqlDecryptFields();
//实体加解密字段 正向
List<Map> getEntityFileds();
List<Map> getEntityFields();
//单一string作为参数加密 正向
List<String> getSqlSingleEncryptFileds();
List<String> getSqlSingleEncryptFields();
//单一string作为返回值解密 正向
List<String> getSqlSingleDecryptFileds();
List<String> getSqlSingleDecryptFields();
//全局加密字段在sql中的反向配置(配置在其中的不进行加解密处理) 反向
List<Map> getGlobalDisableMapFields();
......
......@@ -19,22 +19,22 @@ public class QlrConfig implements BaseConfig {
}
@Override
public List<Map> getSqlFileds() {
public List<Map> getSqlFields() {
return null;
}
@Override
public List<Map> getSqlEncryptFileds() {
public List<Map> getSqlEncryptFields() {
return null;
}
@Override
public List<Map> getSqlDecryptFileds() {
public List<Map> getSqlDecryptFields() {
return null;
}
@Override
public List<Map> getEntityFileds() {
public List<Map> getEntityFields() {
List<Map> result = new ArrayList<Map>();
Map map = new HashMap<String,Object>();
map.put("entity","cn.gtmap.bdcdj.core.entity.BdcZs");
......@@ -44,12 +44,12 @@ public class QlrConfig implements BaseConfig {
}
@Override
public List<String> getSqlSingleEncryptFileds() {
public List<String> getSqlSingleEncryptFields() {
return null;
}
@Override
public List<String> getSqlSingleDecryptFileds() {
public List<String> getSqlSingleDecryptFields() {
return null;
}
......
......@@ -16,32 +16,32 @@ public class QlrlxdhConfig implements BaseConfig{
}
@Override
public List<Map> getSqlFileds() {
public List<Map> getSqlFields() {
return null;
}
@Override
public List<Map> getSqlEncryptFileds() {
public List<Map> getSqlEncryptFields() {
return null;
}
@Override
public List<Map> getSqlDecryptFileds() {
public List<Map> getSqlDecryptFields() {
return null;
}
@Override
public List<Map> getEntityFileds() {
public List<Map> getEntityFields() {
return null;
}
@Override
public List<String> getSqlSingleEncryptFileds() {
public List<String> getSqlSingleEncryptFields() {
return null;
}
@Override
public List<String> getSqlSingleDecryptFileds() {
public List<String> getSqlSingleDecryptFields() {
return null;
}
......
......@@ -16,32 +16,32 @@ public class ZlConfig implements BaseConfig{
}
@Override
public List<Map> getSqlFileds() {
public List<Map> getSqlFields() {
return null;
}
@Override
public List<Map> getSqlEncryptFileds() {
public List<Map> getSqlEncryptFields() {
return null;
}
@Override
public List<Map> getSqlDecryptFileds() {
public List<Map> getSqlDecryptFields() {
return null;
}
@Override
public List<Map> getEntityFileds() {
public List<Map> getEntityFields() {
return null;
}
@Override
public List<String> getSqlSingleEncryptFileds() {
public List<String> getSqlSingleEncryptFields() {
return null;
}
@Override
public List<String> getSqlSingleDecryptFileds() {
public List<String> getSqlSingleDecryptFields() {
return null;
}
......
......@@ -31,11 +31,11 @@ public class BeanCryptHandler implements CryptHandler<Object> {
LOGGER.error("BeanCryptHandler.encrypt.getresult"+var11.getMessage());
}
List<Field> filedList = this.getEncryptDecryptFields(result.getClass(),cryptProperties);
if (CollectionUtils.isEmpty(filedList)) {
List<Field> fieldList = this.getEncryptDecryptFields(result.getClass(),cryptProperties);
if (CollectionUtils.isEmpty(fieldList)) {
return bean;
} else {
for (Field field : filedList) {
for (Field field : fieldList) {
try {
field.setAccessible(true);
Object o = field.get(result);
......@@ -60,9 +60,9 @@ public class BeanCryptHandler implements CryptHandler<Object> {
if (param == null) {
return null;
} else {
List<Field> filedList = this.getEncryptDecryptFields(param.getClass(),cryptProperties);
if(CollectionUtils.isNotEmpty(filedList)){
for (Field field : filedList) {
List<Field> fieldList = this.getEncryptDecryptFields(param.getClass(),cryptProperties);
if(CollectionUtils.isNotEmpty(fieldList)){
for (Field field : fieldList) {
try {
field.setAccessible(true);
Object o = field.get(param);
......@@ -83,9 +83,9 @@ public class BeanCryptHandler implements CryptHandler<Object> {
//对bean来说,加密字段和解密字段应该一致
private List<Field> getEncryptDecryptFields(Class clazz, CryptProperties cryptProperties) {
List<Field> filedList = new ArrayList();
List<Field> fieldList = new ArrayList();
if (clazz == null) {
return filedList;
return fieldList;
} else {
Field[] fields = clazz.getDeclaredFields();
String fieldName = "";
......@@ -94,11 +94,11 @@ public class BeanCryptHandler implements CryptHandler<Object> {
for (Field field : fields) {
fieldName = field.getName();
if(cryptProperties.isEncryptDecryptEntityField(className,fieldName)){
filedList.add(field);
fieldList.add(field);
}
}
}
return filedList;
return fieldList;
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论