Refactor API structure and enhance logging/debugging.
Modularized OpenAPI definitions by splitting into dedicated files for teams, bans, and errors. Improved backend logging for database connections, CORS configuration, and debugging. Updated application properties to support environment-specific CORS origins and logging levels.
This commit is contained in:
@@ -13,12 +13,9 @@ public class CorsConfig implements WebMvcConfigurer {
|
||||
@Value("${cors.allowed-origins}")
|
||||
private String[] allowedOrigins;
|
||||
|
||||
public CorsConfig() {
|
||||
log.info("test");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
log.info("Registering CORS mappings for {}", String.join(", ", allowedOrigins));
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins(allowedOrigins)
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TeamApiController implements TeamApi {
|
||||
Connection.getConnection(Databases.LUCK_PERMS, configuration -> configuration.addMapper(TeamMemberMapper.class))
|
||||
.thenApply(connection -> {
|
||||
connection.runQuery(sqlSession -> {
|
||||
log.info("Loading team members for group {}", group);
|
||||
log.debug("Loading team members for group {}", group);
|
||||
List<Player> players = sqlSession.getMapper(TeamMemberMapper.class).getTeamMembers("group." + group);
|
||||
playerGroupFuture.complete(players);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user