Skip to content

Commit

Permalink
Implemented and tested #141
Browse files Browse the repository at this point in the history
  • Loading branch information
jeaf-anaptecs committed Apr 26, 2024
1 parent 8c7963d commit 3be71c3
Show file tree
Hide file tree
Showing 30 changed files with 11,973 additions and 12,013 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@
## Role `Advanced User`
### Service `AccountingBasicDataService`

| Operation | REST Resource Path |
|------------------|---------------|
| `createResponsibilityType(ResponsibilityType)` | |

| Operation | REST Resource Path |
|------------------|---------------|
| `createBank(Bank)` | |

| Operation | REST Resource Path |
|------------------|---------------|
| `createEmployee(Person, ResponsibilityType, Bank)` | |

| Operation | REST Resource Path |
|------------------|---------------|
| `createAccount(Customer, Person)` | |
Expand Down Expand Up @@ -104,8 +92,6 @@
|------------------|---------------|
| `searchCustomers(CustomerQuery)` | |

### Service `AccountingService`

| Operation | REST Resource Path |
|------------------|---------------|
| `createResponsibilityType(ResponsibilityType)` | |
Expand All @@ -118,6 +104,8 @@
|------------------|---------------|
| `createEmployee(Person, ResponsibilityType, Bank)` | |

### Service `AccountingService`

| Operation | REST Resource Path |
|------------------|---------------|
| `createAccount(Customer, Person)` | |
Expand Down Expand Up @@ -154,6 +142,18 @@
|------------------|---------------|
| `searchCustomers(CustomerQuery)` | |

| Operation | REST Resource Path |
|------------------|---------------|
| `createResponsibilityType(ResponsibilityType)` | |

| Operation | REST Resource Path |
|------------------|---------------|
| `createBank(Bank)` | |

| Operation | REST Resource Path |
|------------------|---------------|
| `createEmployee(Person, ResponsibilityType, Bank)` | |

## Role `Customer`
### Service `RESTProductService`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@
import com.anaptecs.spring.service.LocalBeanParamType;
import com.anaptecs.spring.service.ProductService;

@Path("/products")
@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class ProductServiceResource {
/**
* {@link ProductService#getProducts()}
*/
@Path("products/")
@GET
public void getProducts( @Suspended AsyncResponse pAsyncResponse,
@javax.ws.rs.core.Context HttpServletRequest pRequest ) {
Expand Down Expand Up @@ -103,7 +104,7 @@ public void run( ) {
/**
* {@link ProductService#getProduct()}
*/
@Path("{id}")
@Path("products/{id}")
@GET
public Response getProduct( @PathParam("id") String pProductID ) {
// Delegate request to service.
Expand All @@ -115,6 +116,7 @@ public Response getProduct( @PathParam("id") String pProductID ) {
/**
* {@link ProductService#createProduct()}
*/
@Path("products/")
@POST
public Response createProduct( Product pProduct ) {
// Delegate request to service.
Expand All @@ -126,7 +128,7 @@ public Response createProduct( Product pProduct ) {
/**
* {@link ProductService#getSortiment()}
*/
@Path("sortiment/{id}")
@Path("products/sortiment/{id}")
@GET
public Response getSortiment( @BeanParam Context pContext, @javax.ws.rs.core.Context HttpHeaders pHeaders ) {
// Add custom headers.
Expand All @@ -142,7 +144,7 @@ public Response getSortiment( @BeanParam Context pContext, @javax.ws.rs.core.Con
/**
* {@link ProductService#createChannelCode()}
*/
@Path("ChannelCode")
@Path("products/ChannelCode")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
Expand All @@ -156,6 +158,7 @@ public Response createChannelCode( String pChannelCode ) {
/**
* {@link ProductService#ping()}
*/
@Path("products/")
@HEAD
public Response ping( ) {
// Delegate request to service.
Expand All @@ -167,7 +170,7 @@ public Response ping( ) {
/**
* {@link ProductService#deprecatedOperation()}
*/
@Path("deprecated/operation")
@Path("products/deprecated/operation")
@GET
@Deprecated
public Response deprecatedOperation( ) {
Expand All @@ -180,7 +183,7 @@ public Response deprecatedOperation( ) {
/**
* {@link ProductService#deprecatedContext()}
*/
@Path("deprecated/context")
@Path("products/deprecated/context")
@POST
public Response deprecatedContext( @BeanParam DeprecatedContext pContext ) {
// Delegate request to service.
Expand All @@ -192,7 +195,7 @@ public Response deprecatedContext( @BeanParam DeprecatedContext pContext ) {
/**
* {@link ProductService#deprecatedBeanParam()}
*/
@Path("deprecated/beanParams")
@Path("products/deprecated/beanParams")
@POST
public Response deprecatedBeanParam( @BeanParam BeanParameter pBeanParam ) {
// Delegate request to service.
Expand All @@ -204,7 +207,7 @@ public Response deprecatedBeanParam( @BeanParam BeanParameter pBeanParam ) {
/**
* {@link ProductService#deprecatedParams()}
*/
@Path("deprecated/params")
@Path("products/deprecated/params")
@POST
@Deprecated
public Response deprecatedParams( @HeaderParam("param1") @Deprecated int pParam1 ) {
Expand All @@ -217,7 +220,7 @@ public Response deprecatedParams( @HeaderParam("param1") @Deprecated int pParam1
/**
* {@link ProductService#deprecatedBody()}
*/
@Path("deprecated/body")
@Path("products/deprecated/body")
@POST
public Response deprecatedBody( @DefaultValue("Hello World!") @Deprecated String pBody ) {
// Delegate request to service.
Expand All @@ -229,7 +232,7 @@ public Response deprecatedBody( @DefaultValue("Hello World!") @Deprecated String
/**
* {@link ProductService#deprectedComplexRequestBody()}
*/
@Path("deprecated/complexBody")
@Path("products/deprecated/complexBody")
@POST
public Response deprectedComplexRequestBody( @Deprecated Product pProduct ) {
// Delegate request to service.
Expand All @@ -241,7 +244,7 @@ public Response deprectedComplexRequestBody( @Deprecated Product pProduct ) {
/**
* {@link ProductService#deprecatedComplexReturn()}
*/
@Path("deprecated/complexReturn")
@Path("products/deprecated/complexReturn")
@GET
@Deprecated
public Response deprecatedComplexReturn( ) {
Expand All @@ -254,7 +257,7 @@ public Response deprecatedComplexReturn( ) {
/**
* {@link ProductService#loadSpecificThings()}
*/
@Path("specific/{id}")
@Path("products/specific/{id}")
@PATCH
public Response loadSpecificThings( @BeanParam SpecialContext pContext,
@javax.ws.rs.core.Context HttpHeaders pHeaders ) {
Expand All @@ -271,7 +274,7 @@ public Response loadSpecificThings( @BeanParam SpecialContext pContext,
/**
* {@link ProductService#createChannelCodeFromObject()}
*/
@Path("ChannelCodeObject")
@Path("products/ChannelCodeObject")
@POST
public Response createChannelCodeFromObject( ChannelCode pChannelCode ) {
// Delegate request to service.
Expand All @@ -283,7 +286,7 @@ public Response createChannelCodeFromObject( ChannelCode pChannelCode ) {
/**
* {@link ProductService#addCurrencies()}
*/
@Path("currencies")
@Path("products/currencies")
@POST
public Response addCurrencies( List<CurrencyCode> pCurrencies ) {
// Delegate request to service.
Expand All @@ -295,7 +298,7 @@ public Response addCurrencies( List<CurrencyCode> pCurrencies ) {
/**
* {@link ProductService#isCurrencySupported()}
*/
@Path("currencies/valid")
@Path("products/currencies/valid")
@POST
public Response isCurrencySupported( CurrencyCode pCurrency ) {
// Delegate request to service.
Expand All @@ -307,7 +310,7 @@ public Response isCurrencySupported( CurrencyCode pCurrency ) {
/**
* {@link ProductService#testCodeTypeUsage()}
*/
@Path("codeTypeUsages")
@Path("products/codeTypeUsages")
@POST
public Response testCodeTypeUsage( StringCodeType pStringCode ) {
// Delegate request to service.
Expand All @@ -319,7 +322,7 @@ public Response testCodeTypeUsage( StringCodeType pStringCode ) {
/**
* {@link ProductService#testLocalBeanParamType()}
*/
@Path("LocalBeanParam")
@Path("products/LocalBeanParam")
@GET
public Response testLocalBeanParamType( @BeanParam LocalBeanParamType pBeanParam ) {
// Delegate request to service.
Expand All @@ -331,7 +334,7 @@ public Response testLocalBeanParamType( @BeanParam LocalBeanParamType pBeanParam
/**
* {@link ProductService#testExternalBeanParameterType()}
*/
@Path("ExternalBeanParam")
@Path("products/ExternalBeanParam")
@GET
public Response testExternalBeanParameterType( @BeanParam ParentBeanParamType pParent ) {
// Delegate request to service.
Expand All @@ -343,7 +346,7 @@ public Response testExternalBeanParameterType( @BeanParam ParentBeanParamType pP
/**
* {@link ProductService#testChildBeanParameter()}
*/
@Path("ChildBeanParam")
@Path("products/ChildBeanParam")
@GET
public Response testChildBeanParameter( @BeanParam ChildBeanParameterType pChild ) {
// Delegate request to service.
Expand All @@ -355,7 +358,7 @@ public Response testChildBeanParameter( @BeanParam ChildBeanParameterType pChild
/**
* {@link ProductService#testDateQueryParams()}
*/
@Path("test-date-query-params/{path}")
@Path("products/test-date-query-params/{path}")
@GET
public Response testDateQueryParams( @PathParam("path") String pPath,
@QueryParam("startTimestamp") OffsetDateTime pStartTimestamp, @QueryParam("startTime") OffsetTime pStartTime,
Expand All @@ -374,7 +377,7 @@ public Response testDateQueryParams( @PathParam("path") String pPath,
/**
* {@link ProductService#testDateQueryParamsBean()}
*/
@Path("test-date-query-params-beans/{path}")
@Path("products/test-date-query-params-beans/{path}")
@GET
public Response testDateQueryParamsBean( @PathParam("path") String pPath,
@BeanParam DateQueryParamsBean pQueryParams ) {
Expand All @@ -387,7 +390,7 @@ public Response testDateQueryParamsBean( @PathParam("path") String pPath,
/**
* {@link ProductService#testDateHeaderParams()}
*/
@Path("test-date-header-params/{path}")
@Path("products/test-date-header-params/{path}")
@GET
public Response testDateHeaderParams( @PathParam("path") String pPath,
@HeaderParam("Offset-Date-Time") OffsetDateTime pOffsetDateTime,
Expand All @@ -406,7 +409,7 @@ public Response testDateHeaderParams( @PathParam("path") String pPath,
/**
* {@link ProductService#testDateHeaderParamsBean()}
*/
@Path("test-date-header-params-beans/{path}")
@Path("products/test-date-header-params-beans/{path}")
@GET
public Response testDateHeaderParamsBean( @PathParam("path") String pPath,
@BeanParam DateHeaderParamsBean pHeaderParams ) {
Expand All @@ -419,7 +422,7 @@ public Response testDateHeaderParamsBean( @PathParam("path") String pPath,
/**
* {@link ProductService#testTechnicalHeaderParam()}
*/
@Path("technicalHeaderParam")
@Path("products/technicalHeaderParam")
@GET
public Response testTechnicalHeaderParam( @HeaderParam("Reseller") String pReseller ) {
// Delegate request to service.
Expand All @@ -431,7 +434,7 @@ public Response testTechnicalHeaderParam( @HeaderParam("Reseller") String pResel
/**
* {@link ProductService#testTechnicalHeaderBean()}
*/
@Path("technicalHeaderBeanParam")
@Path("products/technicalHeaderBeanParam")
@GET
public Response testTechnicalHeaderBean( @BeanParam TechnicalHeaderContext pContext,
@javax.ws.rs.core.Context HttpHeaders pHeaders ) {
Expand All @@ -448,7 +451,7 @@ public Response testTechnicalHeaderBean( @BeanParam TechnicalHeaderContext pCont
/**
* {@link ProductService#processDataTypes()}
*/
@Path("product-codes")
@Path("products/product-codes")
@GET
public Response processDataTypes( @QueryParam("pCodes") String[] pCodesAsBasicType ) {
// Convert basic type parameters into "real" objects.
Expand Down
Loading

0 comments on commit 3be71c3

Please sign in to comment.