Skip to content

Commit

Permalink
chore: added license header and swagger to parttype endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
eschrewe committed Mar 15, 2024
1 parent 3320d3b commit 4d6325a
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
/*
* Copyright (c) 2024 Volkswagen AG
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

package org.eclipse.tractusx.puris.backend.masterdata.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.puris.backend.common.util.PatternStore;
import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Material;
Expand Down Expand Up @@ -33,6 +56,15 @@ public class PartTypeInformationController {
@Autowired
private PartTypeInformationSammMapper sammMapper;

@Operation(description = "Ednpoint that delivers PartTypeInformation of own products to customer partners. " +
"'bpnl' must be set to the bpnl of the requesting party. 'materialnumber' must be set to the ownMaterialNumber of " +
"the party, that receives the request")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Ok"),
@ApiResponse(responseCode = "400", description = "Invalid request parameters. "),
@ApiResponse(responseCode = "401", description = "Access forbidden. "),
@ApiResponse(responseCode = "404", description = "Product not found for given parameters. ")
})
@GetMapping("/{bpnl}/{materialnumber}")
public ResponseEntity<?> getMapping(@PathVariable String bpnl, @PathVariable String materialnumber) {
if (!bpnlPattern.matcher(bpnl).matches() || !materialNumberPattern.matcher(materialnumber).matches()) {
Expand Down

0 comments on commit 4d6325a

Please sign in to comment.