Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #8

Open
wants to merge 1 commit into
base: 01_03b
Choose a base branch
from
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
3 changes: 1 addition & 2 deletions tour-service/src/main/java/com/example/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.example.tourservice.SpringBeans;
import com.example.tourservice.TravelAgentService;

public class Application {

public static void main(String[] args) {
ApplicationContext context = new AnnotationConfigApplicationContext(SpringBeans.class);
ApplicationContext context = new AnnotationConfigApplicationContext(Application.class.getPackageName());
TravelAgentService agent = context.getBean(TravelAgentService.class);
System.out.println("\n******Explore California Tour Catalogue******");
agent.displayTours();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.example.tourservice;

import org.springframework.stereotype.Service;

import com.example.tourservice.utilities.TourRepository;

@Service
public class TourManagementService {
private TourRepository tourRepository;

Expand All @@ -14,6 +17,7 @@ public TourManagementService(TourRepository tourRepository) {
createTour("Kids L.A. Tour", 100, true);
createTour("Islands of the Blue Dolphins Tour", 200, true);
createTour("Endangered Specie Expedition", 250, true);

}

public Tour createTour(String title, Integer price, Boolean isKidFriendly) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.example.tourservice;

import org.springframework.stereotype.Service;

import com.example.tourservice.utilities.TourRepository;

@Service
public class TravelAgentService {
private TourRepository tourRepository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package com.example.tourservice.utilities;

import java.util.*;
import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.example.tourservice.Tour;


@Repository
public class TourRepository {
private final List<Tour> tours = new ArrayList<>();

Expand Down