Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public FilterRegistrationBean<AuthFilter> loggingFilter(){
authBean.setFilter(new AuthFilter());
authBean.addUrlPatterns("/JwtAuth/*");
return authBean;





}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
package com.test5.test5.controllers;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.test5.test5.models.HotelInput;
import com.test5.test5.models.hotels;
import com.test5.test5.repo.hotelrespository;

@RestController
@RequestMapping("/api")
@CrossOrigin("http://localhost:4200")

public class hotelcontroller {


@Autowired
private hotelrespository repo;


// retrival of all hotels
@GetMapping("/gethotels")
public List<hotels> getAllHotels(){
return repo.findAll();
}


//retrival of location based hotel
@PostMapping(path="/getHotel/" ,consumes = "application/json" , produces = "application/json")
public List<hotels> getHotels(@RequestBody HotelInput hi)
{
// System.out.println("hii");
List<hotels> hotelList=repo.findAll();

Iterator<hotels> hotelIter=hotelList.iterator();
List<hotels> selectedList=new ArrayList<hotels>();
while(hotelIter.hasNext()) {
hotels f1=hotelIter.next();
if(f1.getHotel_place().equals(hi.getHotel_place())){
selectedList.add(f1);
}


}

return selectedList;

}

//hotel insertion in to database
@PostMapping(path="/addhotel/" ,consumes = "application/json" , produces = "application/json")
public boolean addhotel(@RequestBody HotelInput hi)
{
try {
//System.out.println("hekllcvbhccccccccccccccccccccccj");
hotels hotel = new hotels();
System.out.println(hi.getHotel_name());
hotel.setHotel_name(hi.getHotel_name());
hotel.setHotel_place(hi.getHotel_place());
hotel.setPrice(hi.getPrice());
hotel.setHotel_description(hi.getHotel_description());
hotel.setHotel_image(hi.getHotel_image());
/*
hotel.setHotel_name("ddh");
hotel.setHotel_place("dhdh");
hotel.setPrice(12345);
hotel.setHotel_description("dhdhh");
hotel.setHotel_image("dddjdj");
*/
repo.save(hotel);

return true;
}
catch(Exception ex)
{
ex.printStackTrace();
return false;
}


}



@GetMapping("/getf")
public boolean getAll(){
/*
HotelInput hi = new HotelInput();
hi.setHotel_place("chennai");
List<hotels> hotelList=repo.findAll();
Iterator<hotels> hotelIter=hotelList.iterator();
List<hotels> selectedList=new ArrayList<hotels>();
while(hotelIter.hasNext()) {
hotels f1=hotelIter.next();
if(f1.getHotel_place().equals(hi.getHotel_place())){
selectedList.add(f1);
}

}

return selectedList;

*/
System.out.println("hekllcvbhccccccccccccccccccccccj");
hotels hotel = new hotels();
hotel.setHotel_name("castle rock");
hotel.setHotel_place("bangalore");
hotel.setPrice(12345);
hotel.setHotel_description("nice one");
hotel.setHotel_image("dddjdj");
repo.save(hotel);
return true;

}



}



60 changes: 60 additions & 0 deletions hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
# <local ref> <local sha1> <remote ref> <remote sha1>
#
# This sample shows how to prevent push of commits where the log message starts
# with "WIP" (work in progress).

remote="$1"
url="$2"
BASEDIR=$(eval 'realpath ./tools/pre-commit.py')
ROOTDIR=$(eval 'realpath .')
result=$(eval 'python $BASEDIR "$ROOTDIR" ')

if [ "$result" == "0" ]; then
exit 1
fi

z40=0000000000000000000000000000000000000000

while read local_ref local_sha remote_ref remote_sha
do
if [ "$local_sha" = $z40 ]
then
# Handle delete
:
else
if [ "$remote_sha" = $z40 ]
then
# New branch, examine all commits
range="$local_sha"
else
# Update to existing branch, examine new commits
range="$remote_sha..$local_sha"
fi

# Check for WIP commit
commit=`git rev-list -n 1 --grep '^WIP' "$range"`
if [ -n "$commit" ]
then
echo >&2 "Found WIP commit in $local_ref, not pushing"
exit 1
fi
fi
done

exit 0
2 changes: 0 additions & 2 deletions proj1/src/app/components/userlogin/userlogin.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ export class UserloginComponent implements OnInit {
}
}



20 changes: 9 additions & 11 deletions proj1/src/app/services/addhotel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,28 @@ import { map, catchError, tap } from 'rxjs/operators';
})
export class AddhotelService {

endpoint = 'http://localhost:3000/api/v1/';
httpOptions = {
endpoint = 'http://localhost:3000/api/v1/';
httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json'
'Content-Type': 'application/json'
})
};
result;
constructor(private http:HttpClient) { }
constructor(private http: HttpClient) { }
private extractData(res: Response) {
let body = res;
return body || { };
const body = res;
return body || {};
}

getProducts(): Observable<any> {
return this.http.get('http://localhost:8080/api/gethotels').pipe(
map(this.extractData));
}
public postUser(data){
console.log(data)
this.http.post("http://localhost:8080/api/addhotel/",data).subscribe(res=>{this.result=res;console.log(this.result);});
public postUser(data) {
this.http.post('http://localhost:8080/api/addhotel/', data).subscribe(res => { this.result = res; console.log(this.result); });
}

getProduct(data): Observable<any> {
console.log(data)
return this.http.post("http://localhost:8080/api/getHotel/",data)
return this.http.post('http://localhost:8080/api/getHotel/', data);
}
}
20 changes: 10 additions & 10 deletions proj1/src/app/services/book-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ import { HttpClientModule, HttpClient, HttpHeaders } from '@angular/common/http'
})
export class BookServiceService {

private details:any;
private details: any;

token:any;
token: any;

constructor(private http:HttpClient) { }
constructor(private http: HttpClient) { }

setDetails(details:any){
setDetails(details: any) {
console.log(details);
this.details = details;
}

getDetails(){
getDetails() {
return this.details;
}

bookTicket(bookDetails:any){
bookTicket(bookDetails: any) {
this.token = localStorage.getItem('token');
const headers= new HttpHeaders({
'token':this.token
})
return this.http.post("http://localhost:8080/JwtAuth/book/",bookDetails,{headers:headers,observe:'response' as 'body'});
const headers = new HttpHeaders({
'token': this.token
});
return this.http.post('http://localhost:8080/JwtAuth/book/', bookDetails, { headers: headers, observe: 'response' as 'body' });
}
}
10 changes: 5 additions & 5 deletions proj1/src/app/services/flight.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Injectable } from "@angular/core";
import { HttpClient, HttpHeaders } from "@angular/common/http";
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

@Injectable({
providedIn: "root"
providedIn: 'root'
})
export class FlightService {
constructor(private http: HttpClient) { }
Expand All @@ -12,11 +12,11 @@ export class FlightService {

getFlights(searchDetails: any) {
console.log('input' + searchDetails);
return this.http.post("http://localhost:8080/api/getFlight/", searchDetails);
return this.http.post('http://localhost:8080/api/getFlight/', searchDetails);
}

getHotDeals() {
return this.http.get("http://localhost:8080/api/getFlights");
return this.http.get('http://localhost:8080/api/getFlights');
}
}

Expand Down
82 changes: 0 additions & 82 deletions proj1/src/app/services/hot-deals.service.ts

This file was deleted.

Loading