search-service/src/main/java/com/stackroute/pie/controller/SearchController.java
//to get policyList based on searchvalue
to get policyList based on searchvalue
to get policyList based on searchvalue
@GetMapping(value="policies/{value}")
    public ResponseEntity<?> tokeniseString(@PathVariable(value = "value")String value)
    { ResponseEntity responseEntity;
        try {
            List<Policy> alltokens = searchService.tokenString(value);
            responseEntity= new ResponseEntity<List<Policy>>(alltokens, HttpStatus.OK);
        }
        catch(Exception ex){
            responseEntity = new ResponseEntity<String>(ex.getMessage(), HttpStatus.CONFLICT);
        }
        return responseEntity;
    }
@ GetMapping ( value = "policies/{value}" ) public ResponseEntity < ? > tokeniseString ( @ PathVariable ( value = "value" ) String value ) { ResponseEntity responseEntity ; try { List < Policy > alltokens = searchService . tokenString ( value ) ; responseEntity = new ResponseEntity < List < Policy > > ( alltokens , HttpStatus . OK ) ; } catch ( Exception ex ) { responseEntity = new ResponseEntity < String > ( ex . getMessage ( ) , HttpStatus . CONFLICT ) ; } return responseEntity ; }
to get policyList based on searchvalue
to get policyList based on searchvalue