3 * * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
5 * * Licensed under the Apache License, Version 2.0 (the "License");
6 * * you may not use this file except in compliance with the License.
7 * * You may obtain a copy of the License at
9 * * http://www.apache.org/licenses/LICENSE-2.0
11 * * Unless required by applicable law or agreed to in writing, software
12 * * distributed under the License is distributed on an "AS IS" BASIS,
13 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * * See the License for the specific language governing permissions and
15 * * limitations under the License.
19 package org.onap.usecaseui.intentanalysis.controller;
21 import org.onap.usecaseui.intentanalysis.bean.models.IntentManagerRegInfo;
22 import org.onap.usecaseui.intentanalysis.intentBaseService.intentFunctionManageService.IntentFunctionManageService;
23 import org.springframework.http.MediaType;
24 import org.springframework.http.ResponseEntity;
25 import org.springframework.web.bind.annotation.*;
27 import javax.annotation.Resource;
28 import java.util.List;
31 @RequestMapping(value = "/intentFunctionManage")
32 public class IntentFunctionManageController {
33 @Resource(name = "intentFunctionManageService")
34 IntentFunctionManageService intentFunctionManageService;
36 @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
37 public ResponseEntity createIntentManage(@RequestBody IntentManagerRegInfo intentManage) {
38 return ResponseEntity.ok(intentFunctionManageService.createFunctionManage(intentManage));
41 @DeleteMapping(produces = MediaType.APPLICATION_JSON_VALUE)
42 public ResponseEntity deleteIntentManage(@PathVariable(value = "id") String id) {
43 return ResponseEntity.ok(intentFunctionManageService.deleteFunctionManage(id));
46 @PutMapping(value = "/{intentId}", produces = MediaType.APPLICATION_JSON_VALUE)
47 public ResponseEntity updateIntentManageById(
48 @PathVariable(value = "id") String id, @RequestBody IntentManagerRegInfo intentManage) {
49 return ResponseEntity.ok(intentFunctionManageService.updateIntentManageById(id, intentManage));
52 @GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE)
53 public ResponseEntity<List<IntentManagerRegInfo>> getIntentManageByID() {
54 return ResponseEntity.ok(intentFunctionManageService.getIntentManage());