// Path: acmeair-booking-service/src/main/java/com/acmeair/web/dto/BookingReceiptInfo.java
// public class BookingReceiptInfo {
// 
//     private String departBookingId;
// 
//     private String returnBookingId;
// 
//     private boolean oneWay;
// 
//     public BookingReceiptInfo(String departBookingId, String returnBookingId, boolean oneWay) {
//         this.departBookingId = departBookingId;
//         this.returnBookingId = returnBookingId;
//         this.oneWay = oneWay;
//     }
// 
//     public BookingReceiptInfo() {
//     }
// 
//     public String getDepartBookingId() {
//         return departBookingId;
//     }
// 
//     public void setDepartBookingId(String departBookingId) {
//         this.departBookingId = departBookingId;
//     }
// 
//     public String getReturnBookingId() {
//         return returnBookingId;
//     }
// 
//     public void setReturnBookingId(String returnBookingId) {
//         this.returnBookingId = returnBookingId;
//     }
// 
//     public boolean isOneWay() {
//         return oneWay;
//     }
// 
//     public void setOneWay(boolean oneWay) {
//         this.oneWay = oneWay;
//     }
// 
//     @Override
//     public String toString() {
//         return "BookingInfo [departBookingId=" + departBookingId
//                 + ", returnBookingId=" + returnBookingId + ", oneWay=" + oneWay
//                 + "]";
//     }
// }


import java.util.*;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import com.acmeair.entities.Booking;
import com.acmeair.service.BookingService;
import com.acmeair.web.dto.BookingInfo;
import com.acmeair.web.dto.BookingReceiptInfo;
import io.servicecomb.provider.rest.common.RestSchema;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
            bi = new BookingReceiptInfo(bookingIdTo, bookingIdReturn, oneWay);
        else
            bi = new BookingReceiptInfo(bookingIdTo, null, oneWay);

        return bi;
    }

    @GET
    @Path("/bybookingnumber/{userid}/{number}")
    @Produces(MediaType.APPLICATION_JSON)
    public BookingInfo getBookingByNumber(
            @PathParam("number") String number,
            @PathParam("userid") String userid) {
        try {
            Booking b = bs.getBooking(userid, number);
            BookingInfo bi = null;
            if (b != null) {
                bi = new BookingInfo(b);
            }
            return bi;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    @GET
    @Path("/byuser/{user}")
    @Produces(MediaType.APPLICATION_JSON)
    public List<BookingInfo> getBookingsByUser(@PathParam("user") String user) {
// Path: acmeair-booking-service/src/main/java/com/acmeair/web/dto/BookingReceiptInfo.java
// public class BookingReceiptInfo {
// 
//     private String departBookingId;
// 
//     private String returnBookingId;
// 
//     private boolean oneWay;
// 
//     public BookingReceiptInfo(String departBookingId, String returnBookingId, boolean oneWay) {
//         this.departBookingId = departBookingId;
//         this.returnBookingId = returnBookingId;
//         this.oneWay = oneWay;
//     }
// 
//     public BookingReceiptInfo() {
//     }
// 
//     public String getDepartBookingId() {
//         return departBookingId;
//     }
// 
//     public void setDepartBookingId(String departBookingId) {
//         this.departBookingId = departBookingId;
//     }
// 
//     public String getReturnBookingId() {
//         return returnBookingId;
//     }
// 
//     public void setReturnBookingId(String returnBookingId) {
//         this.returnBookingId = returnBookingId;
//     }
// 
//     public boolean isOneWay() {
//         return oneWay;
//     }
// 
//     public void setOneWay(boolean oneWay) {
//         this.oneWay = oneWay;
//     }
// 
//     @Override
//     public String toString() {
//         return "BookingInfo [departBookingId=" + departBookingId
//                 + ", returnBookingId=" + returnBookingId + ", oneWay=" + oneWay
//                 + "]";
//     }
// }


// Path: acmeair-booking-service/src/main/java/com/acmeair/web/BookingsREST.java
import java.util.*;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import com.acmeair.entities.Booking;
import com.acmeair.service.BookingService;
import com.acmeair.web.dto.BookingInfo;
import com.acmeair.web.dto.BookingReceiptInfo;
import io.servicecomb.provider.rest.common.RestSchema;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;

            bi = new BookingReceiptInfo(bookingIdTo, bookingIdReturn, oneWay);
        else
            bi = new BookingReceiptInfo(bookingIdTo, null, oneWay);

        return bi;
    }

    @GET
    @Path("/bybookingnumber/{userid}/{number}")
    @Produces(MediaType.APPLICATION_JSON)
    public BookingInfo getBookingByNumber(
            @PathParam("number") String number,
            @PathParam("userid") String userid) {
        try {
            Booking b = bs.getBooking(userid, number);
            BookingInfo bi = null;
            if (b != null) {
                bi = new BookingInfo(b);
            }
            return bi;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    @GET
    @Path("/byuser/{user}")
    @Produces(MediaType.APPLICATION_JSON)
    public List<BookingInfo> getBookingsByUser(@PathParam("user") String user) {
        try {