// Path: acmeair-customer-service/src/main/java/com/acmeair/config/CustomerConfiguration.java
// @RestSchema(schemaId = "customer_configuration")
// @Path("/info/config")
// @Api(value = "Customer Service Configuration Information Service", produces = MediaType.APPLICATION_JSON)
// public class CustomerConfiguration {
//     @Autowired
//     private CustomerService customerService;
// 
//     @GET
//     @Path("/countCustomers")
//     @Produces(MediaType.APPLICATION_JSON)
//     @ApiOperation(value = "Get the Customer Resource.",produces=MediaType.APPLICATION_JSON, response = Long.class)
//     @ApiResponses(value = {
//             @ApiResponse(code = 200, message = "CustomerCount Resource is found"),
//             @ApiResponse(code = 404, message = "CustomerCount Resource cannot be found")
//     
//     })
//     public long countCustomer() {
//         try {
//           return  customerService.count();
//         } catch (Exception e) {
//             e.printStackTrace();
//             return  -1;
//         }
//     }
// 
//     @GET
//     @Path("/countSessions")
//     @Produces(MediaType.APPLICATION_JSON)
//     @ApiOperation(value = "Get the Customer SessionCount Resource.",produces=MediaType.APPLICATION_JSON, response = Long.class)
//     @ApiResponses(value = {
//         @ApiResponse(code = 200, message = "CustomerSessionCount Resource is found"),
//         @ApiResponse(code = 404, message = "CustomerSessionCount Resource cannot be found")
//     
//     })
//     public long countCustomerSessions() {
//         try {
// 
//             return customerService.countSessions();
//         } catch (Exception e) {
//             e.printStackTrace();
//             return -1;
//         }
//     }
// }
// 
// Path: acmeair-common/src/main/java/com/acmeair/problems/ProblemInjectFilter.java
// public class ProblemInjectFilter implements ContainerRequestFilter {
//     private ProblemInjector problemInjector = new ProblemInjector();
//     
//     @Override
//     public void filter(ContainerRequestContext requestContext) throws IOException {
//         problemInjector.handleRequest(new ContainerRequest(requestContext));
//     }
//     
//     class ContainerRequest implements Request {
//         private ContainerRequestContext requestContext;
//         
//         ContainerRequest(ContainerRequestContext requestContext) {
//              this.requestContext = requestContext;
//         }
//     
//     
//         @Override
//         public String getHeader(String header) {
//             return requestContext.getHeaderString(header);
//         }
//     }
// }


import com.acmeair.config.CustomerConfiguration;
import com.acmeair.loader.CustomerLoaderREST;
import com.acmeair.problems.ProblemInjectFilter;
import io.servicecomb.swagger.invocation.exception.InvocationException;
import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.jaxrs.listing.ApiListingResource;
import io.swagger.jaxrs.listing.SwaggerSerializers;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import javax.annotation.PostConstruct;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
package com.acmeair.web;





@Configuration
public class CustomerServiceApp extends ResourceConfig {

    @Value("${spring.jersey.application-path:/}")
    private String apiPath;

    @PostConstruct
    @Profile("!SpringCloud")
    public void init() {
        // Add the problem inject
// Path: acmeair-customer-service/src/main/java/com/acmeair/config/CustomerConfiguration.java
// @RestSchema(schemaId = "customer_configuration")
// @Path("/info/config")
// @Api(value = "Customer Service Configuration Information Service", produces = MediaType.APPLICATION_JSON)
// public class CustomerConfiguration {
//     @Autowired
//     private CustomerService customerService;
// 
//     @GET
//     @Path("/countCustomers")
//     @Produces(MediaType.APPLICATION_JSON)
//     @ApiOperation(value = "Get the Customer Resource.",produces=MediaType.APPLICATION_JSON, response = Long.class)
//     @ApiResponses(value = {
//             @ApiResponse(code = 200, message = "CustomerCount Resource is found"),
//             @ApiResponse(code = 404, message = "CustomerCount Resource cannot be found")
//     
//     })
//     public long countCustomer() {
//         try {
//           return  customerService.count();
//         } catch (Exception e) {
//             e.printStackTrace();
//             return  -1;
//         }
//     }
// 
//     @GET
//     @Path("/countSessions")
//     @Produces(MediaType.APPLICATION_JSON)
//     @ApiOperation(value = "Get the Customer SessionCount Resource.",produces=MediaType.APPLICATION_JSON, response = Long.class)
//     @ApiResponses(value = {
//         @ApiResponse(code = 200, message = "CustomerSessionCount Resource is found"),
//         @ApiResponse(code = 404, message = "CustomerSessionCount Resource cannot be found")
//     
//     })
//     public long countCustomerSessions() {
//         try {
// 
//             return customerService.countSessions();
//         } catch (Exception e) {
//             e.printStackTrace();
//             return -1;
//         }
//     }
// }
// 
// Path: acmeair-common/src/main/java/com/acmeair/problems/ProblemInjectFilter.java
// public class ProblemInjectFilter implements ContainerRequestFilter {
//     private ProblemInjector problemInjector = new ProblemInjector();
//     
//     @Override
//     public void filter(ContainerRequestContext requestContext) throws IOException {
//         problemInjector.handleRequest(new ContainerRequest(requestContext));
//     }
//     
//     class ContainerRequest implements Request {
//         private ContainerRequestContext requestContext;
//         
//         ContainerRequest(ContainerRequestContext requestContext) {
//              this.requestContext = requestContext;
//         }
//     
//     
//         @Override
//         public String getHeader(String header) {
//             return requestContext.getHeaderString(header);
//         }
//     }
// }


// Path: acmeair-customer-service/src/main/java/com/acmeair/web/CustomerServiceApp.java
import com.acmeair.config.CustomerConfiguration;
import com.acmeair.loader.CustomerLoaderREST;
import com.acmeair.problems.ProblemInjectFilter;
import io.servicecomb.swagger.invocation.exception.InvocationException;
import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.jaxrs.listing.ApiListingResource;
import io.swagger.jaxrs.listing.SwaggerSerializers;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import javax.annotation.PostConstruct;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

package com.acmeair.web;





@Configuration
public class CustomerServiceApp extends ResourceConfig {

    @Value("${spring.jersey.application-path:/}")
    private String apiPath;

    @PostConstruct
    @Profile("!SpringCloud")
    public void init() {
        // Add the problem inject
        register(ProblemInjectFilter.class);