-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
252 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'base' | ||
|
||
sourceCompatibility = 1.8 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apply from: "../../common.gradle" | ||
|
||
dependencies { | ||
compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") | ||
compile("org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion") | ||
compile('commons-lang:commons-lang:2.4') | ||
} |
93 changes: 93 additions & 0 deletions
93
components/flights/src/main/java/com/pcf/tripit/flights/Flight.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package com.pcf.tripit.flights; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
|
||
@Entity | ||
public class Flight implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private long id; | ||
|
||
private String airlinesName; | ||
private String flightNumber; | ||
private String arrival; | ||
private String departure; | ||
private int cost; | ||
boolean booked; | ||
|
||
public Flight() { | ||
|
||
} | ||
|
||
public Flight(String airlinesName, String flightNumber, String arrival, String departure, int cost, boolean booked) { | ||
this.airlinesName = airlinesName; | ||
this.flightNumber = flightNumber; | ||
this.arrival = arrival; | ||
this.departure = departure; | ||
this.cost = cost; | ||
this.booked = booked; | ||
} | ||
|
||
public long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getAirlinesName() { | ||
return airlinesName; | ||
} | ||
|
||
public void setAirlinesName(String airlinesName) { | ||
this.airlinesName = airlinesName; | ||
} | ||
|
||
public String getFlightNumber() { | ||
return flightNumber; | ||
} | ||
|
||
public void setFlightNumber(String flightNumber) { | ||
this.flightNumber = flightNumber; | ||
} | ||
|
||
public String getArrival() { | ||
return arrival; | ||
} | ||
|
||
public void setArrival(String arrival) { | ||
this.arrival = arrival; | ||
} | ||
|
||
public String getDeparture() { | ||
return departure; | ||
} | ||
|
||
public void setDeparture(String departure) { | ||
this.departure = departure; | ||
} | ||
|
||
public int getCost() { | ||
return cost; | ||
} | ||
|
||
public void setCost(int cost) { | ||
this.cost = cost; | ||
} | ||
|
||
public boolean isBooked() { | ||
return booked; | ||
} | ||
|
||
public void setBooked(boolean booked) { | ||
this.booked = booked; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
components/flights/src/main/java/com/pcf/tripit/flights/FlightController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.pcf.tripit.flights; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequestMapping("/flights") | ||
|
||
public class FlightController { | ||
|
||
private FlightRepository flightRepository; | ||
|
||
public FlightController(FlightRepository flightRepository) { | ||
this.flightRepository = flightRepository; | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
components/flights/src/main/java/com/pcf/tripit/flights/FlightRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.pcf.tripit.flights; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
|
||
public interface FlightRepository extends CrudRepository<Flight, Long> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apply from: "../../common.gradle" | ||
|
||
dependencies { | ||
compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion") | ||
compile("org.springframework.boot:spring-boot-starter-data-jpa:$springBootVersion") | ||
compile('commons-lang:commons-lang:2.4') | ||
} |
94 changes: 94 additions & 0 deletions
94
components/hotels/src/main/java/com/pcf/tripit/hotels/Hotel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package com.pcf.tripit.hotels; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
|
||
@Entity | ||
public class Hotel { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private long id; | ||
|
||
private String hotelName; | ||
private String hotelAddress; | ||
private String hotelCity; | ||
private String capacity; | ||
private String available; | ||
private int price; | ||
|
||
public Hotel() { | ||
} | ||
|
||
public Hotel(String hotelName, String hotelAddress, String hotelCity, String capacity, String available, int price) { | ||
this.hotelName = hotelName; | ||
this.hotelAddress = hotelAddress; | ||
this.hotelCity = hotelCity; | ||
this.capacity = capacity; | ||
this.available = available; | ||
this.price = price; | ||
} | ||
|
||
public long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getHotelName() { | ||
return hotelName; | ||
} | ||
|
||
public void setHotelName(String hotelName) { | ||
this.hotelName = hotelName; | ||
} | ||
|
||
public String getHotelAddress() { | ||
return hotelAddress; | ||
} | ||
|
||
public void setHotelAddress(String hotelAddress) { | ||
this.hotelAddress = hotelAddress; | ||
} | ||
|
||
public String getHotelCity() { | ||
return hotelCity; | ||
} | ||
|
||
public void setHotelCity(String hotelCity) { | ||
this.hotelCity = hotelCity; | ||
} | ||
|
||
public String getCapacity() { | ||
return capacity; | ||
} | ||
|
||
public void setCapacity(String capacity) { | ||
this.capacity = capacity; | ||
} | ||
|
||
public String getAvailable() { | ||
return available; | ||
} | ||
|
||
public void setAvailable(String available) { | ||
this.available = available; | ||
} | ||
|
||
public int getPrice() { | ||
return price; | ||
} | ||
|
||
public void setPrice(int price) { | ||
this.price = price; | ||
} | ||
} | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
components/hotels/src/main/java/com/pcf/tripit/hotels/HotelController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.pcf.tripit.hotels; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequestMapping("/hotels") | ||
|
||
public class HotelController { | ||
|
||
private HotelRepository hotelRepository; | ||
|
||
public HotelController(HotelRepository hotelRepository) { | ||
this.hotelRepository = hotelRepository; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
components/hotels/src/main/java/com/pcf/tripit/hotels/HotelRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.pcf.tripit.hotels; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
|
||
public interface HotelRepository extends CrudRepository<Hotel, Long> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
rootProject.name = 'tripit' | ||
include "applications:tripit" | ||
include "applications:tripit" | ||
include "components:flights" | ||
include "components:hotels" |