Skip to content

Commit

Permalink
feat: splitting REST API controllers to different packages (#233)
Browse files Browse the repository at this point in the history
feat: splitting REST API controllers to different packages

Refs: #232
  • Loading branch information
grigoriev authored Dec 18, 2024
1 parent 66cbed7 commit 91591af
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 30 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ Maven's `pom.xml` should contain following content:
<configuration>
<outputFormat>YAML</outputFormat>
<resourcePackages>
<package>ch.sbb.polarion.extension.generic.rest.controller</package>
<package>ch.sbb.polarion.extension.generic.rest.controller.info</package>
<package>ch.sbb.polarion.extension.generic.rest.controller.settings</package>
<package>ch.sbb.polarion.extension.generic.rest.model</package>
<package>ch.sbb.polarion.extension.pdf.exporter.rest.controller</package>
<package>ch.sbb.polarion.extension.pdf.exporter.rest.model</package>
<package>ch.sbb.polarion.extension.pdf_exporter.rest.controller</package>
<package>ch.sbb.polarion.extension.pdf_exporter.rest.model</package>
</resourcePackages>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import javax.ws.rs.core.Application;

import ch.sbb.polarion.extension.generic.rest.controller.NamedSettingsApiController;
import ch.sbb.polarion.extension.generic.rest.controller.NamedSettingsApiScopeAgnosticController;
import ch.sbb.polarion.extension.generic.rest.controller.NamedSettingsInternalController;
import ch.sbb.polarion.extension.generic.rest.controller.settings.NamedSettingsApiController;
import ch.sbb.polarion.extension.generic.rest.controller.settings.NamedSettingsApiScopeAgnosticController;
import ch.sbb.polarion.extension.generic.rest.controller.settings.NamedSettingsInternalController;
import ch.sbb.polarion.extension.generic.rest.exception.ForbiddenExceptionMapper;
import ch.sbb.polarion.extension.generic.rest.exception.IllegalStateExceptionMapper;
import ch.sbb.polarion.extension.generic.rest.exception.ObjectNotFoundExceptionMapper;
Expand All @@ -19,10 +19,10 @@
import org.glassfish.jersey.jackson.JacksonFeature;
import org.jetbrains.annotations.NotNull;

import ch.sbb.polarion.extension.generic.rest.controller.ExtensionInfoApiController;
import ch.sbb.polarion.extension.generic.rest.controller.ExtensionInfoInternalController;
import ch.sbb.polarion.extension.generic.rest.controller.SwaggerController;
import ch.sbb.polarion.extension.generic.rest.controller.SwaggerDefinitionController;
import ch.sbb.polarion.extension.generic.rest.controller.info.ExtensionInfoApiController;
import ch.sbb.polarion.extension.generic.rest.controller.info.ExtensionInfoInternalController;
import ch.sbb.polarion.extension.generic.rest.controller.swagger.SwaggerController;
import ch.sbb.polarion.extension.generic.rest.controller.swagger.SwaggerDefinitionController;
import ch.sbb.polarion.extension.generic.rest.exception.BadRequestExceptionMapper;
import ch.sbb.polarion.extension.generic.rest.exception.IllegalArgumentExceptionMapper;
import ch.sbb.polarion.extension.generic.rest.exception.InternalServerErrorExceptionMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.rest.controller;
package ch.sbb.polarion.extension.generic.rest.controller.info;

import javax.ws.rs.Path;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package ch.sbb.polarion.extension.generic.rest.controller;
package ch.sbb.polarion.extension.generic.rest.controller.info;

import ch.sbb.polarion.extension.generic.rest.model.Context;
import ch.sbb.polarion.extension.generic.rest.model.Version;
import ch.sbb.polarion.extension.generic.util.ExtensionInfo;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.rest.controller;
package ch.sbb.polarion.extension.generic.rest.controller.settings;

import ch.sbb.polarion.extension.generic.rest.filter.Secured;
import ch.sbb.polarion.extension.generic.settings.Revision;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.rest.controller;
package ch.sbb.polarion.extension.generic.rest.controller.settings;

import ch.sbb.polarion.extension.generic.rest.filter.Secured;
import ch.sbb.polarion.extension.generic.settings.Revision;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.rest.controller;
package ch.sbb.polarion.extension.generic.rest.controller.settings;

import ch.sbb.polarion.extension.generic.service.PolarionService;
import ch.sbb.polarion.extension.generic.settings.GenericNamedSettings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.rest.controller;
package ch.sbb.polarion.extension.generic.rest.controller.swagger;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright 2020 Polarion AG
*/
package ch.sbb.polarion.extension.generic.rest.controller;
package ch.sbb.polarion.extension.generic.rest.controller.swagger;

import java.util.List;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import ch.sbb.polarion.extension.generic.fields.converters.ChainConverter;
import ch.sbb.polarion.extension.generic.fields.model.FieldMetadata;
import ch.sbb.polarion.extension.generic.polarion.CustomExtensionMock;
import ch.sbb.polarion.extension.generic.polarion.PlatformContextMockExtension;
import ch.sbb.polarion.extension.generic.test_extensions.CustomExtensionMock;
import ch.sbb.polarion.extension.generic.test_extensions.PlatformContextMockExtension;
import com.polarion.alm.shared.util.Pair;
import com.polarion.alm.tracker.ITrackerService;
import com.polarion.platform.persistence.IDataService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ch.sbb.polarion.extension.generic.rest.controller;

import ch.sbb.polarion.extension.generic.exception.ObjectNotFoundException;
import ch.sbb.polarion.extension.generic.rest.controller.settings.NamedSettingsInternalController;
import ch.sbb.polarion.extension.generic.service.PolarionService;
import ch.sbb.polarion.extension.generic.settings.GenericNamedSettings;
import ch.sbb.polarion.extension.generic.settings.NamedSettingsRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import ch.sbb.polarion.extension.generic.fields.FieldType;
import ch.sbb.polarion.extension.generic.fields.model.FieldMetadata;
import ch.sbb.polarion.extension.generic.fields.model.Option;
import ch.sbb.polarion.extension.generic.polarion.PlatformContextMockExtension;
import ch.sbb.polarion.extension.generic.polarion.TransactionalExecutorExtension;
import ch.sbb.polarion.extension.generic.test_extensions.PlatformContextMockExtension;
import ch.sbb.polarion.extension.generic.test_extensions.TransactionalExecutorExtension;
import ch.sbb.polarion.extension.generic.util.AssigneeUtils;
import ch.sbb.polarion.extension.generic.util.TestUtils;
import com.polarion.alm.projects.IProjectService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ch.sbb.polarion.extension.generic.settings;

import ch.sbb.polarion.extension.generic.polarion.CustomExtensionMock;
import ch.sbb.polarion.extension.generic.polarion.PlatformContextMockExtension;
import ch.sbb.polarion.extension.generic.polarion.TransactionalExecutorExtension;
import ch.sbb.polarion.extension.generic.test_extensions.CustomExtensionMock;
import ch.sbb.polarion.extension.generic.test_extensions.PlatformContextMockExtension;
import ch.sbb.polarion.extension.generic.test_extensions.TransactionalExecutorExtension;
import com.polarion.alm.projects.IProjectService;
import com.polarion.alm.projects.model.IUser;
import com.polarion.alm.tracker.ITrackerService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.polarion;
package ch.sbb.polarion.extension.generic.test_extensions;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.polarion;
package ch.sbb.polarion.extension.generic.test_extensions;

import org.junit.jupiter.api.extension.ExtensionContext;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.polarion;
package ch.sbb.polarion.extension.generic.test_extensions;

import com.polarion.alm.projects.IProjectService;
import com.polarion.alm.tracker.ITestManagementService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ch.sbb.polarion.extension.generic.polarion;
package ch.sbb.polarion.extension.generic.test_extensions;

import com.polarion.alm.shared.api.transaction.RunnableInReadOnlyTransaction;
import com.polarion.alm.shared.api.transaction.TransactionalExecutor;
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
<markdown2html-maven-plugin.tokenEnvVarName>GITHUB_TOKEN</markdown2html-maven-plugin.tokenEnvVarName>
<markdown2html-maven-plugin.failOnError>false</markdown2html-maven-plugin.failOnError>
<markdown2html-maven-plugin.generateHeadingIds>true</markdown2html-maven-plugin.generateHeadingIds>

<!-- exclude rest controllers from coverage report -->
<sonar.coverage.exclusions>**/rest/controller/**</sonar.coverage.exclusions>
</properties>

<profiles>
Expand Down

0 comments on commit 91591af

Please sign in to comment.