【fix sonar】CustomDemoConverter文件
This commit is contained in:
+6
-1
@@ -1,18 +1,22 @@
|
|||||||
|
|
||||||
package com.jero.generater.modules.online.cgform.converter;
|
package com.jero.generater.modules.online.cgform.converter;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component("customDemoConverter")
|
@Component("customDemoConverter")
|
||||||
public class CustomDemoConverter implements FieldCommentConverter {
|
public class CustomDemoConverter implements FieldCommentConverter {
|
||||||
public CustomDemoConverter() {
|
public CustomDemoConverter() {
|
||||||
|
// do other
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String converterToVal(String txt) {
|
public String converterToVal(String txt) {
|
||||||
return txt != null && txt.equals("管理员1") ? "admin" : txt;
|
return txt != null && txt.equals("管理员1") ? "admin" : txt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String converterToTxt(String val) {
|
public String converterToTxt(String val) {
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
if (val.equals("admin")) {
|
if (val.equals("admin")) {
|
||||||
@@ -27,7 +31,8 @@ public class CustomDemoConverter implements FieldCommentConverter {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Map<String, String> getConfig() {
|
public Map<String, String> getConfig() {
|
||||||
return null;
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user