Changed package to wahlrecht
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
projectname=template
|
||||
projectname=wahlrecht
|
||||
projectgroup=de.2martens
|
||||
projectSourceCompatibility=17
|
||||
file.encoding=utf-8
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package de.twomartens.template.monitoring.statusprobe;
|
||||
|
||||
|
||||
public enum StatusProbeCriticality {
|
||||
K1, K2, K3
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template;
|
||||
package de.twomartens.wahlrecht;
|
||||
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package de.twomartens.template.configuration;
|
||||
package de.twomartens.wahlrecht.configuration;
|
||||
|
||||
import de.twomartens.template.property.ServiceProperties;
|
||||
import de.twomartens.wahlrecht.property.ServiceProperties;
|
||||
import java.time.Clock;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package de.twomartens.template.configuration;
|
||||
package de.twomartens.wahlrecht.configuration;
|
||||
|
||||
import de.twomartens.template.interceptor.HeaderInterceptorRest;
|
||||
import de.twomartens.template.interceptor.LoggingInterceptorRest;
|
||||
import de.twomartens.wahlrecht.interceptor.HeaderInterceptorRest;
|
||||
import de.twomartens.wahlrecht.interceptor.LoggingInterceptorRest;
|
||||
import java.time.Clock;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.configuration;
|
||||
package de.twomartens.wahlrecht.configuration;
|
||||
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -11,7 +11,7 @@ public class OpenApiConfiguration {
|
||||
public GroupedOpenApi swaggerApi10() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("1.0")
|
||||
.pathsToMatch("/template/v1/**")
|
||||
.pathsToMatch("/wahlrecht/v1/**")
|
||||
.build();
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
package de.twomartens.template.configuration;
|
||||
package de.twomartens.wahlrecht.configuration;
|
||||
|
||||
import de.twomartens.template.interceptor.HeaderInterceptorRest;
|
||||
import de.twomartens.template.interceptor.LoggingInterceptorRest;
|
||||
import de.twomartens.template.property.RestTemplateTimeoutProperties;
|
||||
import de.twomartens.wahlrecht.interceptor.HeaderInterceptorRest;
|
||||
import de.twomartens.wahlrecht.interceptor.LoggingInterceptorRest;
|
||||
import de.twomartens.wahlrecht.property.RestTemplateTimeoutProperties;
|
||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
package de.twomartens.template.configuration;
|
||||
package de.twomartens.wahlrecht.configuration;
|
||||
|
||||
import de.twomartens.template.monitoring.statusprobe.CountBasedStatusProbe;
|
||||
import de.twomartens.template.monitoring.statusprobe.StatusProbe;
|
||||
import de.twomartens.template.monitoring.statusprobe.StatusProbeCriticality;
|
||||
import de.twomartens.template.monitoring.statusprobe.StatusProbeLogger;
|
||||
import de.twomartens.wahlrecht.monitoring.statusprobe.CountBasedStatusProbe;
|
||||
import de.twomartens.wahlrecht.monitoring.statusprobe.StatusProbe;
|
||||
import de.twomartens.wahlrecht.monitoring.statusprobe.StatusProbeCriticality;
|
||||
import de.twomartens.wahlrecht.monitoring.statusprobe.StatusProbeLogger;
|
||||
import java.time.Clock;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package de.twomartens.template.configuration;
|
||||
package de.twomartens.wahlrecht.configuration;
|
||||
|
||||
import de.twomartens.template.interceptor.HeaderInterceptorRest;
|
||||
import de.twomartens.wahlrecht.interceptor.HeaderInterceptorRest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistration;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package de.twomartens.template.controller;
|
||||
package de.twomartens.wahlrecht.controller;
|
||||
|
||||
import de.twomartens.template.exception.HttpStatusException;
|
||||
import de.twomartens.template.model.dto.ErrorMessage;
|
||||
import de.twomartens.wahlrecht.exception.HttpStatusException;
|
||||
import de.twomartens.wahlrecht.model.dto.ErrorMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.controller;
|
||||
package de.twomartens.wahlrecht.controller;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(value = "/vorlage")
|
||||
@RequestMapping(value = "/wahlrecht")
|
||||
public class VersionHtmlController {
|
||||
|
||||
@GetMapping(path = "/html/version.html")
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
package de.twomartens.template.controller.v1;
|
||||
package de.twomartens.wahlrecht.controller.v1;
|
||||
|
||||
import de.twomartens.template.mapper.v1.GreetingMapper;
|
||||
import de.twomartens.template.model.dto.v1.Greeting;
|
||||
import de.twomartens.template.service.GreetingService;
|
||||
import de.twomartens.wahlrecht.mapper.v1.GreetingMapper;
|
||||
import de.twomartens.wahlrecht.model.dto.v1.Greeting;
|
||||
import de.twomartens.wahlrecht.service.GreetingService;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping(value = "/template/v1")
|
||||
@RequestMapping(value = "/wahlrecht/v1")
|
||||
@Tag(name = "Greeting Example", description = "all requests relating to greetings")
|
||||
public class GreetingRestController {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.exception;
|
||||
package de.twomartens.wahlrecht.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package de.twomartens.template.interceptor;
|
||||
package de.twomartens.wahlrecht.interceptor;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.interceptor;
|
||||
package de.twomartens.wahlrecht.interceptor;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.util.Optional;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.interceptor;
|
||||
package de.twomartens.wahlrecht.interceptor;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.interceptor;
|
||||
package de.twomartens.wahlrecht.interceptor;
|
||||
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
package de.twomartens.template.mapper.v1;
|
||||
package de.twomartens.wahlrecht.mapper.v1;
|
||||
|
||||
import de.twomartens.template.model.db.Greeting;
|
||||
import de.twomartens.wahlrecht.model.db.Greeting;
|
||||
import org.mapstruct.CollectionMappingStrategy;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
@@ -12,10 +12,10 @@ import org.mapstruct.ReportingPolicy;
|
||||
unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface GreetingMapper {
|
||||
|
||||
de.twomartens.template.model.dto.v1.Greeting map(Greeting greeting);
|
||||
de.twomartens.wahlrecht.model.dto.v1.Greeting map(Greeting greeting);
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "created", ignore = true)
|
||||
@Mapping(target = "lastModified", ignore = true)
|
||||
Greeting map(de.twomartens.template.model.dto.v1.Greeting greeting);
|
||||
Greeting map(de.twomartens.wahlrecht.model.dto.v1.Greeting greeting);
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.model.db;
|
||||
package de.twomartens.wahlrecht.model.db;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.AccessLevel;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.model.dto;
|
||||
package de.twomartens.wahlrecht.model.dto;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.model.dto.v1;
|
||||
package de.twomartens.wahlrecht.model.dto.v1;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AccessLevel;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.monitoring.actuator;
|
||||
package de.twomartens.wahlrecht.monitoring.actuator;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package de.twomartens.template.monitoring.actuator;
|
||||
package de.twomartens.wahlrecht.monitoring.actuator;
|
||||
|
||||
import de.twomartens.template.monitoring.statusprobe.StatusProbe;
|
||||
import de.twomartens.wahlrecht.monitoring.statusprobe.StatusProbe;
|
||||
import java.time.Clock;
|
||||
import java.util.Optional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.monitoring.actuator;
|
||||
package de.twomartens.wahlrecht.monitoring.actuator;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package de.twomartens.template.monitoring.actuator;
|
||||
package de.twomartens.wahlrecht.monitoring.actuator;
|
||||
|
||||
import de.twomartens.template.interceptor.HeaderInterceptorRest;
|
||||
import de.twomartens.wahlrecht.interceptor.HeaderInterceptorRest;
|
||||
import java.security.SecureRandom;
|
||||
import java.time.Clock;
|
||||
import java.util.Optional;
|
||||
@@ -30,7 +30,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
@Component
|
||||
public class RestHealthIndicator extends AbstractHealthIndicator implements HealthIndicator {
|
||||
|
||||
private static final String URL_PATH = "/template/v1/healthCheck";
|
||||
private static final String URL_PATH = "/wahlrecht/v1/healthCheck";
|
||||
private static final String GET_PARAMETER = "message=";
|
||||
|
||||
private final SecureRandom randomizer = new SecureRandom();
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.monitoring.statusprobe;
|
||||
package de.twomartens.wahlrecht.monitoring.statusprobe;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.monitoring.statusprobe;
|
||||
package de.twomartens.wahlrecht.monitoring.statusprobe;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.Duration;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.monitoring.statusprobe;
|
||||
package de.twomartens.wahlrecht.monitoring.statusprobe;
|
||||
|
||||
import java.time.Duration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.monitoring.statusprobe;
|
||||
package de.twomartens.wahlrecht.monitoring.statusprobe;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.ZonedDateTime;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package de.twomartens.wahlrecht.monitoring.statusprobe;
|
||||
|
||||
|
||||
public enum StatusProbeCriticality {
|
||||
K1, K2, K3
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
package de.twomartens.template.monitoring.statusprobe;
|
||||
package de.twomartens.wahlrecht.monitoring.statusprobe;
|
||||
|
||||
import static de.twomartens.template.monitoring.statusprobe.StatusProbeCriticality.K1;
|
||||
import static de.twomartens.template.monitoring.statusprobe.StatusProbeCriticality.K2;
|
||||
import static de.twomartens.template.monitoring.statusprobe.StatusProbeCriticality.K3;
|
||||
import static de.twomartens.wahlrecht.monitoring.statusprobe.StatusProbeCriticality.K1;
|
||||
import static de.twomartens.wahlrecht.monitoring.statusprobe.StatusProbeCriticality.K2;
|
||||
import static de.twomartens.wahlrecht.monitoring.statusprobe.StatusProbeCriticality.K3;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.ZonedDateTime;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.monitoring.statusprobe;
|
||||
package de.twomartens.wahlrecht.monitoring.statusprobe;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.Duration;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.property;
|
||||
package de.twomartens.wahlrecht.property;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
@@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
|
||||
@EqualsAndHashCode
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ConfigurationProperties(prefix = "resttemplate.timeout")
|
||||
@ConfigurationProperties(prefix = "restwahlrecht.timeout")
|
||||
@Component
|
||||
public class RestTemplateTimeoutProperties {
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.property;
|
||||
package de.twomartens.wahlrecht.property;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.ZoneId;
|
||||
@@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Data
|
||||
@RefreshScope
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "de.twomartens.template")
|
||||
@ConfigurationProperties(prefix = "de.twomartens.wahlrecht")
|
||||
@Schema(description = "Properties, to configure this Application")
|
||||
public class ServiceProperties {
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.property;
|
||||
package de.twomartens.wahlrecht.property;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.Duration;
|
||||
@@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Data
|
||||
@RefreshScope
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "de.twomartens.template.statusprobe")
|
||||
@ConfigurationProperties(prefix = "de.twomartens.wahlrecht.statusprobe")
|
||||
@Schema(description = "Properties, to configure this Application")
|
||||
public class StatusProbeProperties {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package de.twomartens.template.repository;
|
||||
package de.twomartens.wahlrecht.repository;
|
||||
|
||||
import de.twomartens.template.model.db.Greeting;
|
||||
import de.twomartens.wahlrecht.model.db.Greeting;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
|
||||
+6
-6
@@ -1,8 +1,8 @@
|
||||
package de.twomartens.template.service;
|
||||
package de.twomartens.wahlrecht.service;
|
||||
|
||||
import de.twomartens.template.model.db.Greeting;
|
||||
import de.twomartens.template.property.ServiceProperties;
|
||||
import de.twomartens.template.repository.GreetingRepository;
|
||||
import de.twomartens.wahlrecht.model.db.Greeting;
|
||||
import de.twomartens.wahlrecht.property.ServiceProperties;
|
||||
import de.twomartens.wahlrecht.repository.GreetingRepository;
|
||||
import io.micrometer.core.instrument.Counter;
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -23,13 +23,13 @@ public class GreetingService {
|
||||
this.meterRegistry = meterRegistry;
|
||||
this.serviceProperties = serviceProperties;
|
||||
this.greetingRepository = greetingRepository;
|
||||
counter = meterRegistry.counter("template.callCounter");
|
||||
counter = meterRegistry.counter("wahlrecht.callCounter");
|
||||
}
|
||||
|
||||
public Greeting createGreeting(String name) {
|
||||
log.info("Create greeting for '{}'", name);
|
||||
counter.increment();
|
||||
meterRegistry.gauge("template.nameLength", name.length());
|
||||
meterRegistry.gauge("wahlrecht.nameLength", name.length());
|
||||
String greeting = serviceProperties.getGreeting();
|
||||
return Greeting.builder().message(String.format(greeting, name)).build();
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package de.twomartens.template.service;
|
||||
package de.twomartens.wahlrecht.service;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
Reference in New Issue
Block a user