7 changed files with 46 additions and 18 deletions
-
13.idea/libraries/Maven__org_javassist_javassist_3_21_0_GA.xml
-
5.idea/xm-backend.iml
-
3xm-bootstrap/xm-bootstrap.iml
-
2xm-core/src/main/java/com/xm/core/ctrl/XmTaskOrderController.java
-
34xm-core/src/main/java/com/xm/core/service/sensitive/SensitiveWordConfig.java
-
4xm-core/src/main/resources/application-dev.properties
-
3xm-core/xm-core.iml
@ -1,13 +0,0 @@ |
|||||
<component name="libraryTable"> |
|
||||
<library name="Maven: org.javassist:javassist:3.21.0-GA"> |
|
||||
<CLASSES> |
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA.jar!/" /> |
|
||||
</CLASSES> |
|
||||
<JAVADOC> |
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA-javadoc.jar!/" /> |
|
||||
</JAVADOC> |
|
||||
<SOURCES> |
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.21.0-GA/javassist-3.21.0-GA-sources.jar!/" /> |
|
||||
</SOURCES> |
|
||||
</library> |
|
||||
</component> |
|
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.xm.core.service.sensitive; |
||||
|
|
||||
|
import com.mdp.sensitive.SensitiveWordService; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
|
||||
|
import java.util.HashSet; |
||||
|
import java.util.Set; |
||||
|
|
||||
|
@Configuration |
||||
|
public class SensitiveWordConfig { |
||||
|
|
||||
|
@Value("mdp.sensitive-word.words:") |
||||
|
String sensitiveWords=""; |
||||
|
|
||||
|
@Bean |
||||
|
SensitiveWordService xmSensitiveWordInit(){ |
||||
|
Set<String> sensitiveWordSet=new HashSet<>(); |
||||
|
SensitiveWordService xmSensitiveWordService=new SensitiveWordService(); |
||||
|
if(StringUtils.hasText(sensitiveWords)){ |
||||
|
String[] words=sensitiveWords.split(","); |
||||
|
for (String word : words) { |
||||
|
sensitiveWordSet.add(word); |
||||
|
} |
||||
|
xmSensitiveWordService.init(sensitiveWordSet); |
||||
|
}else{ |
||||
|
xmSensitiveWordService.init(sensitiveWordSet); |
||||
|
} |
||||
|
return xmSensitiveWordService; |
||||
|
} |
||||
|
|
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue