dd6388d8d0fdb360a348fb82e0c5b5e0c8f77455
[vid.git] / vid-app-common / src / main / java / org / onap / vid / controllers / RoleGeneratorController.java
1 package org.onap.vid.controllers;
2
3 import org.onap.vid.services.RoleGeneratorService;
4 import org.onap.portalsdk.core.controller.UnRestrictedBaseController;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.http.HttpStatus;
7 import org.springframework.http.ResponseEntity;
8 import org.springframework.web.bind.annotation.PathVariable;
9 import org.springframework.web.bind.annotation.RequestMapping;
10 import org.springframework.web.bind.annotation.RequestMethod;
11 import org.springframework.web.bind.annotation.RestController;
12
13 @RestController
14 public class RoleGeneratorController extends UnRestrictedBaseController {
15     @Autowired
16     private RoleGeneratorService roleGeneratorService;
17     public static final String GENERATE_ROLE_SCRIPT = "generateRoleScript";
18     @RequestMapping(value =  GENERATE_ROLE_SCRIPT +"/{firstRun}", method = RequestMethod.GET )
19     public ResponseEntity<String> generateRoleScript (@PathVariable("firstRun") boolean firstRun) {
20         ResponseEntity<String> response = null;
21         String query = roleGeneratorService.generateRoleScript(firstRun);
22         response = new ResponseEntity<String>(query, HttpStatus.OK);
23         return response;
24     }
25
26 }