This commit is contained in:
parent
523c4789a3
commit
fc1b732dfd
27
API/src/main/java/me/braydon/profanity/config/AppConfig.java
Normal file
27
API/src/main/java/me/braydon/profanity/config/AppConfig.java
Normal file
@ -0,0 +1,27 @@
|
||||
package me.braydon.profanity.config;
|
||||
|
||||
import lombok.NonNull;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* @author Braydon
|
||||
*/
|
||||
@Configuration
|
||||
public class AppConfig {
|
||||
@Bean
|
||||
public WebMvcConfigurer configureCors() {
|
||||
return new WebMvcConfigurer() {
|
||||
@Override
|
||||
public void addCorsMappings(@NonNull CorsRegistry registry) {
|
||||
// Allow all origins to access the API
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*") // Allow all origins
|
||||
.allowedMethods("*") // Allow all methods
|
||||
.allowedHeaders("*"); // Allow all headers
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -13,6 +13,10 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public final class ModerationService {
|
||||
public void handleAlerts(@NonNull ContentProcessResponse response) {
|
||||
// Likely safe content, no need to alert anyone
|
||||
if (response.getScore() < 0.6D) {
|
||||
return;
|
||||
}
|
||||
// TODO: handle alerting of the content to the appropriate parties
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user