diff --git a/pom.xml b/pom.xml index e851d444..26b8625a 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,15 @@ Proyecto para Ingeniería del Software - 11 + 8 + + org.projectlombok + lombok + provided + org.springframework.boot spring-boot-starter-web diff --git a/src/main/java/bo/ucb/edu/ingsoft/IngsoftApplication.java b/src/main/java/bo/ucb/edu/ingsoft/IngsoftApplication.java index eb3b233d..95276359 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/IngsoftApplication.java +++ b/src/main/java/bo/ucb/edu/ingsoft/IngsoftApplication.java @@ -1,7 +1,6 @@ package bo.ucb.edu.ingsoft; -import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/bo/ucb/edu/ingsoft/bl/GameBl.java b/src/main/java/bo/ucb/edu/ingsoft/bl/GameBl.java index 62749899..76f0e369 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/bl/GameBl.java +++ b/src/main/java/bo/ucb/edu/ingsoft/bl/GameBl.java @@ -3,8 +3,8 @@ import bo.ucb.edu.ingsoft.dao.*; import bo.ucb.edu.ingsoft.dto.*; import bo.ucb.edu.ingsoft.models.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; @@ -14,39 +14,23 @@ import java.util.List; @Service +@Slf4j +@AllArgsConstructor(onConstructor = @__({@Autowired})) public class GameBl { - private GameDao gameDao; - private TransactionDao transactionDao; - private DeveloperDao developerDao; - private EsrbDao esrbDao; - private GamesDirectxDao gamesDirectxDao; - private GamesLanguagesDao languagesDao; - private GamesOsDao gamesOsDao; - private GenreDao genreDao; - private PhotoDao photoDao; - private PriceDao priceDao; - private UserDao userDao; - private PublisherDao publisherDao; - private GameRequirementDao gameRequirementDao; - - private static final Logger LOGGER = LoggerFactory.getLogger(GameBl.class); - @Autowired - public GameBl(GameDao gameDao, TransactionDao transactionDao, DeveloperDao developerDao, EsrbDao esrbDao, GamesDirectxDao gamesDirectxDao, GamesLanguagesDao languagesDao, GamesOsDao gamesOsDao, GenreDao genreDao, PhotoDao photoDao, PriceDao priceDao, UserDao userDao, PublisherDao publisherDao, GameRequirementDao gameRequirementDao) { - this.gameDao = gameDao; - this.transactionDao = transactionDao; - this.developerDao = developerDao; - this.esrbDao = esrbDao; - this.gamesDirectxDao = gamesDirectxDao; - this.languagesDao = languagesDao; - this.gamesOsDao = gamesOsDao; - this.genreDao = genreDao; - this.photoDao = photoDao; - this.priceDao = priceDao; - this.userDao = userDao; - this.publisherDao = publisherDao; - this.gameRequirementDao = gameRequirementDao; - } + private final GameDao gameDao; + private final TransactionDao transactionDao; + private final DeveloperDao developerDao; + private final EsrbDao esrbDao; + private final GamesDirectxDao gamesDirectxDao; + private final GamesLanguagesDao languagesDao; + private final GamesOsDao gamesOsDao; + private final GenreDao genreDao; + private final PhotoDao photoDao; + private final PriceDao priceDao; + private final UserDao userDao; + private final PublisherDao publisherDao; + private final GameRequirementDao gameRequirementDao; /* POST (/publisher/{id}/game) The publisher create a new game @@ -476,12 +460,12 @@ public GameDetailsRequest getGameInformation(Integer gameId) { throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Unable to find resource"); } - LOGGER.info(game.toString()); + log.info(game.toString()); // Getting the language ids in a list List gamesLanguagesDao = languagesDao.findGameLanguages(gameId); // Print language id - LOGGER.info(gamesLanguagesDao.toString()); + log.info(gamesLanguagesDao.toString()); // Getting the language information in a list List languageList = languagesDao.findByIdLanguage(gamesLanguagesDao); @@ -535,7 +519,7 @@ public GameDetailsRequest getGameInformation(Integer gameId) { gameDetailsRequest.setPrice(price.getPrice()); // Print game details data - LOGGER.info(gameDetailsRequest.toString()); + log.info(gameDetailsRequest.toString()); return gameDetailsRequest; } diff --git a/src/main/java/bo/ucb/edu/ingsoft/bl/PublisherBl.java b/src/main/java/bo/ucb/edu/ingsoft/bl/PublisherBl.java index eca32e77..256ec293 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/bl/PublisherBl.java +++ b/src/main/java/bo/ucb/edu/ingsoft/bl/PublisherBl.java @@ -3,6 +3,7 @@ import bo.ucb.edu.ingsoft.dao.*; import bo.ucb.edu.ingsoft.dto.*; import bo.ucb.edu.ingsoft.models.*; +import lombok.AllArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; @@ -13,36 +14,21 @@ @Service +@AllArgsConstructor(onConstructor = @__({@Autowired})) public class PublisherBl { - private PublisherDao publisherDao; - private UserDao userDao; - private TransactionDao transactionDao; - private OrderDao orderDao; - private GameDao gameDao; - private DeveloperDao developerDao; - private PriceDao priceDao; - private PhotoDao photoDao; - private CountryDao countryDao; - private LanguageDao languageDao; - private GenreDao genreDao; - private EsrbDao esrbDao; - - @Autowired - public PublisherBl(PublisherDao publisherDao, UserDao userDao, TransactionDao transactionDao, OrderDao orderDao, GameDao gameDao, DeveloperDao developerDao, PriceDao priceDao, PhotoDao photoDao, CountryDao countryDao, LanguageDao languageDao, GenreDao genreDao, EsrbDao esrbDao) { - this.publisherDao = publisherDao; - this.userDao = userDao; - this.transactionDao = transactionDao; - this.orderDao = orderDao; - this.gameDao = gameDao; - this.developerDao = developerDao; - this.priceDao = priceDao; - this.photoDao = photoDao; - this.countryDao = countryDao; - this.languageDao = languageDao; - this.genreDao = genreDao; - this.esrbDao = esrbDao; - } + private final PublisherDao publisherDao; + private final UserDao userDao; + private final TransactionDao transactionDao; + private final OrderDao orderDao; + private final GameDao gameDao; + private final DeveloperDao developerDao; + private final PriceDao priceDao; + private final PhotoDao photoDao; + private final CountryDao countryDao; + private final LanguageDao languageDao; + private final GenreDao genreDao; + private final EsrbDao esrbDao; /* POST (/publisher) The admin create a new publisher diff --git a/src/main/java/bo/ucb/edu/ingsoft/bl/StoreBl.java b/src/main/java/bo/ucb/edu/ingsoft/bl/StoreBl.java index 74313fa2..ebea5bec 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/bl/StoreBl.java +++ b/src/main/java/bo/ucb/edu/ingsoft/bl/StoreBl.java @@ -3,6 +3,8 @@ import bo.ucb.edu.ingsoft.dao.*; import bo.ucb.edu.ingsoft.dto.*; import bo.ucb.edu.ingsoft.models.*; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -12,32 +14,24 @@ import java.util.List; @Service +@AllArgsConstructor(onConstructor = @__({@Autowired})) +@Slf4j public class StoreBl { - private GameDao gameDao; - private PriceDao priceDao; - private PhotoDao photoDao; - private UserDao userDao; - private OrderDao orderDao; - private DeveloperDao developerDao; - - private static final Logger LOGGER = LoggerFactory.getLogger(StoreBl.class); - - @Autowired - public StoreBl(GameDao gameDao, PriceDao priceDao, PhotoDao photoDao, UserDao userDao, OrderDao orderDao, DeveloperDao developerDao) { - this.gameDao = gameDao; - this.priceDao = priceDao; - this.photoDao = photoDao; - this.userDao = userDao; - this.orderDao = orderDao; - this.developerDao = developerDao; - } + private final GameDao gameDao; + private final PriceDao priceDao; + private final PhotoDao photoDao; + private final UserDao userDao; + private final OrderDao orderDao; + private final DeveloperDao developerDao; + + /* The user gets a paginated view of the homepage */ public List getGames(Integer page, String query, Boolean highlight, Boolean latest, Boolean sale, String publisher) { List list = new ArrayList(); - LOGGER.info(query); + log.info(query); //Setup the query's page limit fir the SQL query Integer recordsPerPage = 10; Integer offsetValue = (page - 1) * recordsPerPage; @@ -47,7 +41,7 @@ public List getGames(Integer page, String query, Boolean highlight } GameHelper gameHelper = new GameHelper(recordsPerPage, offsetValue, query, highlight, latest, sale, publisher); List games = gameDao.findPage(gameHelper); - LOGGER.info(games.toString()); + log.info(games.toString()); //Verifying the existance of the games. if (!games.isEmpty()) { List ids = new ArrayList(); @@ -70,25 +64,25 @@ public List getGames(Integer page, String query, Boolean highlight public PaymentRequest getGamePayment(PaymentRequest paymentRequest, Transaction transaction) { // Print transaction information - LOGGER.info(transaction.toString()); + log.info(transaction.toString()); // Getting game information by game id Game game = gameDao.getGameInfo(paymentRequest.getIdGame()); // Print game information - LOGGER.info(game.toString()); + log.info(game.toString()); // Getting user information by user id from paymentRequest User user = userDao.findByUserId(paymentRequest.getIdUser()); // Print user information - LOGGER.info(user.toString()); + log.info(user.toString()); // Getting price information by game id Price price = priceDao.findById(game.getIdGame()); // Print price information - LOGGER.info(price.toString()); + log.info(price.toString()); // Loading data from user and transaction into Order Orders orders = new Orders(); @@ -109,7 +103,7 @@ public PaymentRequest getGamePayment(PaymentRequest paymentRequest, Transaction orders.setIdOrder(orderDao.getLastInsertId()); // Print orders information - LOGGER.info(orders.toString()); + log.info(orders.toString()); // Loading data from game, orders and price into order details OrderDetails orderDetails = new OrderDetails(); @@ -128,7 +122,7 @@ public PaymentRequest getGamePayment(PaymentRequest paymentRequest, Transaction orderDao.createOrderDetails(orderDetails); // Print orderDetails information - LOGGER.info(orderDetails.toString()); + log.info(orderDetails.toString()); // Setting data from game, price and user to return the result paymentRequest.setTitle(game.getName()); diff --git a/src/main/java/bo/ucb/edu/ingsoft/bl/TransactionBl.java b/src/main/java/bo/ucb/edu/ingsoft/bl/TransactionBl.java index 01f760a8..32a52b49 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/bl/TransactionBl.java +++ b/src/main/java/bo/ucb/edu/ingsoft/bl/TransactionBl.java @@ -2,18 +2,15 @@ import bo.ucb.edu.ingsoft.dao.TransactionDao; import bo.ucb.edu.ingsoft.dto.Transaction; +import lombok.AllArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service +@AllArgsConstructor(onConstructor = @__({@Autowired})) public class TransactionBl { - private TransactionDao transactionDao; - - @Autowired - public TransactionBl(TransactionDao transactionDao) { - this.transactionDao = transactionDao; - } + private final TransactionDao transactionDao; public Transaction createTransaction (Transaction transaction) { // Registramos la transacción en la Base de Datos diff --git a/src/main/java/bo/ucb/edu/ingsoft/bl/UserBl.java b/src/main/java/bo/ucb/edu/ingsoft/bl/UserBl.java index 6670aa96..5569774a 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/bl/UserBl.java +++ b/src/main/java/bo/ucb/edu/ingsoft/bl/UserBl.java @@ -3,6 +3,8 @@ import bo.ucb.edu.ingsoft.dao.*; import bo.ucb.edu.ingsoft.dto.*; import bo.ucb.edu.ingsoft.models.*; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -14,31 +16,19 @@ import java.util.List; @Service +@AllArgsConstructor(onConstructor = @__({@Autowired})) +@Slf4j public class UserBl { - private UserDao userDao; - private CountryDao countryDao; - private TransactionDao transactionDao; - private GameDao gameDao; - private LibraryDao libraryDao; - private GenreDao genreDao; - private PhotoDao photoDao; - private OrderDao orderDao; - private PriceDao priceDao; - - private static final Logger LOGGER = LoggerFactory.getLogger(UserBl.class); - - @Autowired - public UserBl(UserDao userDao, CountryDao countryDao, TransactionDao transactionDao, GameDao gameDao, LibraryDao libraryDao, GenreDao genreDao, PhotoDao photoDao, OrderDao orderDao, PriceDao priceDao) { - this.userDao = userDao; - this.countryDao = countryDao; - this.transactionDao = transactionDao; - this.gameDao = gameDao; - this.libraryDao = libraryDao; - this.genreDao = genreDao; - this.photoDao = photoDao; - this.orderDao = orderDao; - this.priceDao = priceDao; - } + private final UserDao userDao; + private final CountryDao countryDao; + private final TransactionDao transactionDao; + private final GameDao gameDao; + private final LibraryDao libraryDao; + private final GenreDao genreDao; + private final PhotoDao photoDao; + private final OrderDao orderDao; + private final PriceDao priceDao; + /* POST (/users/signup) The user creates an account @@ -180,7 +170,7 @@ public List getCartByUser(Integer userId) { List detailsRequests = orderDao.getCartUser(userId); // Print cart details information - LOGGER.info(detailsRequests.toString()); + log.info(detailsRequests.toString()); if (detailsRequests.size() > 0) return detailsRequests; @@ -199,7 +189,7 @@ public GameDetailsRequest addGameToCart(Integer userId, Integer gameId, Transact Price price = priceDao.findById(game.getIdGame()); // Print game details information - LOGGER.info(game.toString()); + log.info(game.toString()); // Loading data from user and transaction into Order Orders order = new Orders(); @@ -220,7 +210,7 @@ public GameDetailsRequest addGameToCart(Integer userId, Integer gameId, Transact order.setIdOrder(orderDao.getLastInsertId()); // Print order information - LOGGER.info(order.toString()); + log.info(order.toString()); // Loading data from game, order and price into order details OrderDetails orderDetail = new OrderDetails(); @@ -239,7 +229,7 @@ public GameDetailsRequest addGameToCart(Integer userId, Integer gameId, Transact orderDao.createOrderDetails(orderDetail); // Print orderDetails information - LOGGER.info(orderDetail.toString()); + log.info(orderDetail.toString()); // Setting data from game and price to return the result GameDetailsRequest gameDetailsRequest = new GameDetailsRequest(); @@ -262,10 +252,10 @@ public void deleteGameFromCart(Integer userId, Integer gameId) { integerList.forEach(integer -> orderDao.updateOrder(2, integer)); // Print if the game is deleted from cart - LOGGER.info("Games deleted from cart"); + log.info("Games deleted from cart"); } else { // Print if the game is not deleted from cart - LOGGER.info("Games is not found. Game wasn't deleted"); + log.info("Games is not found. Game wasn't deleted"); } @@ -276,7 +266,7 @@ public List purchaseGamesCart(Integer userId, Transaction tr List detailsRequests = orderDao.getCartUser(userId); // Warn what games are in there - LOGGER.warn(detailsRequests.toString()); + log.warn(detailsRequests.toString()); // Gets rows from order details List integerList = orderDao.getOrderDetailByUser(userId); diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/CountryDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/CountryDao.java index b3108119..a3195ab2 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/CountryDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/CountryDao.java @@ -8,8 +8,8 @@ @Mapper public interface CountryDao { //Get a Country Name - public Country CountryName (Integer idCountry); + Country CountryName (Integer idCountry); //Get a list of countries - public List CountriesList(); + List CountriesList(); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/DeveloperDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/DeveloperDao.java index e0ed4b35..2da4b1ed 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/DeveloperDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/DeveloperDao.java @@ -11,22 +11,22 @@ public interface DeveloperDao { //Create developer - public void createDeveloper(Developer developer); + void createDeveloper(Developer developer); // Finds the developer by its id - public Developer findByIdDeveloper(Integer idDeveloper); + Developer findByIdDeveloper(Integer idDeveloper); // Get developer by publisher - public List findByPublisher(Integer idPublisher); + List findByPublisher(Integer idPublisher); //get last id in developers - public Integer getLastInsertId(); + Integer getLastInsertId(); // Updates the developer info - public void updateDeveloper(Developer developer); + void updateDeveloper(Developer developer); // Finds the developer by its name - public Integer findBydeveloperName(String developer); + Integer findBydeveloperName(String developer); diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/EsrbDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/EsrbDao.java index a0d86260..c30a2ec4 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/EsrbDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/EsrbDao.java @@ -1,8 +1,6 @@ package bo.ucb.edu.ingsoft.dao; -import bo.ucb.edu.ingsoft.models.Developer; import bo.ucb.edu.ingsoft.models.Esrb; -import bo.ucb.edu.ingsoft.models.Genre; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -10,9 +8,9 @@ @Mapper public interface EsrbDao { // get data esrb - public Esrb findEsrbById(Integer idEsrb); + Esrb findEsrbById(Integer idEsrb); //Get a list of esrb - public List EsrbList(); + List EsrbList(); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/GameDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/GameDao.java index b8523b5f..aef7fe94 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/GameDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/GameDao.java @@ -12,50 +12,50 @@ @Mapper public interface GameDao { //Find page for the homepage - public List findPage(GameHelper gameHelper); + List findPage(GameHelper gameHelper); //Create Game - public void createGame(Game game); + void createGame(Game game); //Get game info - public Game getGameInfo(Integer idGame); + Game getGameInfo(Integer idGame); - public ArrayList getPage(@Param("a") Integer limit, @Param("b") Integer offset); + ArrayList getPage(@Param("a") Integer limit, @Param("b") Integer offset); //Search Game for User Library - public List findLibraryGames(List idGame); + List findLibraryGames(List idGame); //Last Id game - public Integer getLastInsertId(); + Integer getLastInsertId(); //Get publisher developer games - public List findGamebyPublisher(List idDeveloper); + List findGamebyPublisher(List idDeveloper); //Update game - public void updateGame(Game game); + void updateGame(Game game); - public Integer findByDeveloperGame(Integer gameId); + Integer findByDeveloperGame(Integer gameId); //delete game - public void deleteGame(Integer idGame); + void deleteGame(Integer idGame); //Get a list of the games by a developer - public List findByPublisher(Integer idPublisher); + List findByPublisher(Integer idPublisher); //Get a list of all the games in the database - public List findAllGames(); + List findAllGames(); //Get a list of the games with a list of ids. - public List listGameNames(List idGame); + List listGameNames(List idGame); //Update Highlight - public void updateHighlight(Game game); + void updateHighlight(Game game); //Get publisher id - public Integer getPublisherId(Integer gameId); + Integer getPublisherId(Integer gameId); //Get a game Requirements - public List getRequirements(Integer gameId); + List getRequirements(Integer gameId); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/GameRequirementDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/GameRequirementDao.java index ef4e0e08..0d3a367e 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/GameRequirementDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/GameRequirementDao.java @@ -12,13 +12,13 @@ public interface GameRequirementDao { //Inserts a requirements into a game_requirements. - public void createGameRequirement(GameRequirements gameRequirements); + void createGameRequirement(GameRequirements gameRequirements); //finds the requirements used by a game - public List findByIdGamesRequirements(Integer idGame); + List findByIdGamesRequirements(Integer idGame); //updates directx per game - public void deleteOldsRequirements(List idGameRequirement); + void deleteOldsRequirements(List idGameRequirement); - public void changeStatus(Integer idGameRequirement); + void changeStatus(Integer idGameRequirement); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/GamesDirectxDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/GamesDirectxDao.java index b8ffce0c..ed980415 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/GamesDirectxDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/GamesDirectxDao.java @@ -11,15 +11,15 @@ public interface GamesDirectxDao { //inserts the directX id with a game - public void createGameDirectx(GameDirectx gameDirectx); + void createGameDirectx(GameDirectx gameDirectx); //finds the direct x versions used by a game - public List findByIdDirectxGame(Integer idGame); + List findByIdDirectxGame(Integer idGame); //updates directx per game - public void deleteOldsDirectx(List idGameDirectx); + void deleteOldsDirectx(List idGameDirectx); - public void changeStatus(Integer idGameDirectx); + void changeStatus(Integer idGameDirectx); } \ No newline at end of file diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/GamesLanguagesDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/GamesLanguagesDao.java index 40eae277..929ce679 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/GamesLanguagesDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/GamesLanguagesDao.java @@ -1,7 +1,6 @@ package bo.ucb.edu.ingsoft.dao; -import bo.ucb.edu.ingsoft.models.Directx; -import bo.ucb.edu.ingsoft.models.GameDirectx; + import bo.ucb.edu.ingsoft.models.Language; import bo.ucb.edu.ingsoft.models.LanguageGame; import org.apache.ibatis.annotations.Mapper; @@ -12,19 +11,19 @@ public interface GamesLanguagesDao { //Inserts a language into a game. - public void createLanguageGame(LanguageGame languageGame); + void createLanguageGame(LanguageGame languageGame); //finds the language name by an id. - public List findByIdLanguage(List idLanguage); + List findByIdLanguage(List idLanguage); //Return a list of ids based on a game id - public List findGameLanguages(Integer gameId); + List findGameLanguages(Integer gameId); //Return a list of ids based on a game id - public List findByIdGamesLanguages(Integer idGame); + List findByIdGamesLanguages(Integer idGame); //Updates languages of a game. - public void deleteOldsLanguages(List idGameLanguages); + void deleteOldsLanguages(List idGameLanguages); - public void changeStatus(Integer idLanguageGame); + void changeStatus(Integer idLanguageGame); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/GamesOsDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/GamesOsDao.java index 8791e36c..a195156b 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/GamesOsDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/GamesOsDao.java @@ -12,20 +12,20 @@ public interface GamesOsDao { //Links a game with operating systems - public void createGameOs( GameOS gameOS); + void createGameOs( GameOS gameOS); //Gets a list of the operating system and logo using the ids - public List findByIdGameOs(List idOperatingSystem); + List findByIdGameOs(List idOperatingSystem); //Gets a list of os ids per game - public List findByGame(Integer gameId); + List findByGame(Integer gameId); //Gets a list of os ids per game - public List findByIdGamesOs(Integer idGame); + List findByIdGamesOs(Integer idGame); //Updates OSs for a game. - public void deleteOldsOs(List idGameOs); + void deleteOldsOs(List idGameOs); - public void changeStatus(Integer idGameDirectx); + void changeStatus(Integer idGameDirectx); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/GenreDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/GenreDao.java index 45056ede..3f5b9dfc 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/GenreDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/GenreDao.java @@ -10,23 +10,23 @@ @Mapper public interface GenreDao { //Get Genre name for User Library - public List genreLibrary (List idGame); + List genreLibrary (List idGame); //Create genres in a game - public void createGenreGame(GenreGame genreGame); + void createGenreGame(GenreGame genreGame); //Get Genre name for one Game - public List gameGenre (Integer idGame); + List gameGenre (Integer idGame); //Find name of genre by Id - public List findByIdGamesGenre(Integer idGame); + List findByIdGamesGenre(Integer idGame); //Delete genres in a game - public void deleteOldsGenreDao(List idGameGenre); + void deleteOldsGenreDao(List idGameGenre); - public void changeStatus(Integer idGenreGame); + void changeStatus(Integer idGenreGame); //Get a list of genres - public List GenresList(); + List GenresList(); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/LanguageDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/LanguageDao.java index bab12c3b..8ca78893 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/LanguageDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/LanguageDao.java @@ -8,5 +8,5 @@ @Mapper public interface LanguageDao { //Get a list of languages - public List LanguagesList(); + List LanguagesList(); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/LibraryDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/LibraryDao.java index 1e20419c..3bc69001 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/LibraryDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/LibraryDao.java @@ -8,8 +8,8 @@ @Mapper public interface LibraryDao { //Check User Library games - public Library getLibraryGames(Integer idUser); + Library getLibraryGames(Integer idUser); //Get User Games - public List UserGames(Integer idUser); + List UserGames(Integer idUser); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/OrderDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/OrderDao.java index 75962f1a..199db600 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/OrderDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/OrderDao.java @@ -10,48 +10,48 @@ @Mapper public interface OrderDao { // Get Game's sold count - public List gameSells(List idGame); + List gameSells(List idGame); // Get Game's sold count by Publisher - public Integer gameSellsPublisher(List idGame); + Integer gameSellsPublisher(List idGame); // Get Game's sold count by Game - public List gameSellsGame(List idGame); + List gameSellsGame(List idGame); // Get Countries by games ordered - public List gameOrderCountry(List idGame); + List gameOrderCountry(List idGame); // Get Count Countries by games ordered - public List gameOrderCountryCount(@Param("a") List idGame, @Param("b") List idCountry); + List gameOrderCountryCount(@Param("a") List idGame, @Param("b") List idCountry); // Get Game's total earnings by publisher - public Double gameEarnings(List idGame); + Double gameEarnings(List idGame); // Get Game's total earnings by month - public List gameEarningsMonth(@Param("a") List idGame, @Param("b") List month); + List gameEarningsMonth(@Param("a") List idGame, @Param("b") List month); //Last Id game - public Integer getLastInsertId(); + Integer getLastInsertId(); // Create order - public void createOrder(Orders orders); + void createOrder(Orders orders); // Create relation between orders and game - public void createOrderDetails(OrderDetails orderDetails); + void createOrderDetails(OrderDetails orderDetails); // Get orders with status 0 - public List getOrdersUser(Integer userIdCart); + List getOrdersUser(Integer userIdCart); // Get orders by user - public List getCartUser(Integer userIdCart); + List getCartUser(Integer userIdCart); // Update status order with user an order id - public void updateOrder(Integer statusUpdate, Integer idOrder); + void updateOrder(Integer statusUpdate, Integer idOrder); // Returns id_order by game and user - public List getOrderDetailGameByUser(Integer gameId, Integer userId); + List getOrderDetailGameByUser(Integer gameId, Integer userId); // Returns id orders by user - public List getOrderDetailByUser(Integer userId); + List getOrderDetailByUser(Integer userId); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/PhotoDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/PhotoDao.java index 622f8ef3..0d09e657 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/PhotoDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/PhotoDao.java @@ -1,39 +1,37 @@ package bo.ucb.edu.ingsoft.dao; -import bo.ucb.edu.ingsoft.models.Game; import bo.ucb.edu.ingsoft.models.Photo; import org.apache.ibatis.annotations.Mapper; -import java.util.ArrayList; import java.util.List; @Mapper public interface PhotoDao { // Get Photo Data - public List findByIdGame(List idGame); + List findByIdGame(List idGame); //Get banner by banner Id - public List findBannerbyId(List idGame); + List findBannerbyId(List idGame); //Get photo_path by game Id - public List findPhotosByGameId(Integer idGame); + List findPhotosByGameId(Integer idGame); //Get banner by game Id - public Photo findBannerbyGame(Integer idGame); + Photo findBannerbyGame(Integer idGame); //Create Banner - public void createPhotoBanner (Photo photo); + void createPhotoBanner (Photo photo); //Create Photo - public void createPhoto (Photo photo); + void createPhoto (Photo photo); //Update Photo Banner - public void updatePhotoBanner (Photo photo); + void updatePhotoBanner (Photo photo); //Update Photo - public void updatePhoto (Photo photo); + void updatePhoto (Photo photo); //Find Photo by Id game - public List findByPhotos(Integer idGame); + List findByPhotos(Integer idGame); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/PriceDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/PriceDao.java index 03bf4294..9f8d1e9e 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/PriceDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/PriceDao.java @@ -8,15 +8,15 @@ @Mapper public interface PriceDao { // Get Price data - public List findByIdGame(List idGame); + List findByIdGame(List idGame); //Creete Game Price - public void createPrice(Price price); + void createPrice(Price price); //Update Game Price - public void updatePrice(Price price); + void updatePrice(Price price); //Find Price by Id game - public Price findById(Integer idGame); + Price findById(Integer idGame); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/PublisherDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/PublisherDao.java index d582a7a0..b2fe880d 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/PublisherDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/PublisherDao.java @@ -10,21 +10,21 @@ public interface PublisherDao { //Create new publisher; - public void createPublisher(Publisher publisher); + void createPublisher(Publisher publisher); //Get publisher data - public Publisher findByPublisherId(Integer idUser); + Publisher findByPublisherId(Integer idUser); //Update publisher data; - public void updatePublisher(Publisher publisher); + void updatePublisher(Publisher publisher); //Get publisher list - public List listPublisher(@Param("a") Integer page, @Param("b") String query ,@Param("c") List idUser, @Param("d") Integer offset); + List listPublisher(@Param("a") Integer page, @Param("b") String query ,@Param("c") List idUser, @Param("d") Integer offset); //delete publisher - public void deletePublisher(Integer idUser); + void deletePublisher(Integer idUser); //get userId - public Integer findUserIdByIdPublisher(Integer idPublisher); + Integer findUserIdByIdPublisher(Integer idPublisher); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/TransactionDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/TransactionDao.java index c79d8cfc..d3b0f91e 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/TransactionDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/TransactionDao.java @@ -9,14 +9,14 @@ @Mapper public interface TransactionDao { //Create a new Transaction - public Integer create(Transaction transaction); + Integer create(Transaction transaction); //Get the last Id - public Integer getLastInsertId(); + Integer getLastInsertId(); //Update de user's transaction - public void updateUserTransaction(@Param("idUser") Integer idUser, @Param("txId") Integer txId, @Param("txHost") String txHost, @Param("txUserId") Integer txUserId, @Param("txDate") Date txDate); + void updateUserTransaction(@Param("idUser") Integer idUser, @Param("txId") Integer txId, @Param("txHost") String txHost, @Param("txUserId") Integer txUserId, @Param("txDate") Date txDate); //Update table transaction - public void updateTablesTransaction(@Param("tableName") String tableName, @Param("idUser") Integer idUser, @Param("txId") Integer txId, @Param("txHost") String txHost, @Param("txUserId") Integer txUserId, @Param("txDate") Date txDate); + void updateTablesTransaction(@Param("tableName") String tableName, @Param("idUser") Integer idUser, @Param("txId") Integer txId, @Param("txHost") String txHost, @Param("txUserId") Integer txUserId, @Param("txDate") Date txDate); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/dao/UserDao.java b/src/main/java/bo/ucb/edu/ingsoft/dao/UserDao.java index eca7f2db..1654bfc8 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/dao/UserDao.java +++ b/src/main/java/bo/ucb/edu/ingsoft/dao/UserDao.java @@ -9,45 +9,45 @@ @Mapper public interface UserDao { //Create new publisher; - public void createPublisher(User user); + void createPublisher(User user); //Get publisher data - public User findByUserId(Integer idUser); + User findByUserId(Integer idUser); //Update publisher data; - public void updateUser(User user); + void updateUser(User user); //Get publisher mail - public User publisherMail(Integer idUser); + User publisherMail(Integer idUser); //Get publisher list (id_user, email) - public List listUserMails(); + List listUserMails(); //Create new user - public void userSignUp(User user); + void userSignUp(User user); //Get User Profile Info - public User userProfileInfo(Integer idUser); + User userProfileInfo(Integer idUser); //Get User Profile Info for Update - public User userInfo(Integer idUser); + User userInfo(Integer idUser); //Get User Profile Password for Update - public User userPassword(Integer idUser); + User userPassword(Integer idUser); //Get Countries ids for a group of users - public List findUsersCountries(List idUser); + List findUsersCountries(List idUser); //Update User's Info - public void updateUserInfo(User user); + void updateUserInfo(User user); //Update User's Password - public void updateUserPassword(@Param("idUser") Integer idUser, @Param("newPassword") String newPassword); + void updateUserPassword(@Param("idUser") Integer idUser, @Param("newPassword") String newPassword); //Get last id in user - public Integer getLastInsertId(); + Integer getLastInsertId(); //Delete user publisher - public void deleteUserPublisher(Integer idUser); + void deleteUserPublisher(Integer idUser); } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Country.java b/src/main/java/bo/ucb/edu/ingsoft/models/Country.java index ff907918..6cb76bc5 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Country.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Country.java @@ -1,49 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class Country { - private Integer idCountry; - private String name; - private int status; - - public Country() { - } - - public Country(Integer idCountry, String name, int status) { - this.idCountry = idCountry; - this.name = name; - this.status = status; - } - - @Override - public String toString() { - return "Country{" + - "idCountry=" + idCountry + - ", name='" + name + '\'' + - ", status=" + status + - '}'; - } - - public Integer getIdCountry() { - return idCountry; - } - - public void setIdCountry(Integer idCountry) { - this.idCountry = idCountry; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } -} \ No newline at end of file +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Country implements Serializable { + private Integer idCountry; + private String name; + private int status; +} diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Developer.java b/src/main/java/bo/ucb/edu/ingsoft/models/Developer.java index 4a05c305..9c6dcd5d 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Developer.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Developer.java @@ -1,54 +1,18 @@ package bo.ucb.edu.ingsoft.models; -public class Developer extends Transactions { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Developer extends Transactions implements Serializable { private Integer idDeveloper; private Integer idPublisher; private String developer; private Integer status; - public Developer() { - - } - - @Override - public String toString() { - return "Developer{" + - "idDeveloper=" + idDeveloper + - ", idPublisher=" + idPublisher + - ", developer='" + developer + '\'' + - ", status=" + status + - '}'; - } - - public Integer getIdDeveloper() { - return idDeveloper; - } - - public void setIdDeveloper(Integer idDeveloper) { - this.idDeveloper = idDeveloper; - } - - public Integer getIdPublisher() { - return idPublisher; - } - - public void setIdPublisher(Integer idPublisher) { - this.idPublisher = idPublisher; - } - - public String getDeveloper() { - return developer; - } - - public void setDeveloper(String developer) { - this.developer = developer; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Directx.java b/src/main/java/bo/ucb/edu/ingsoft/models/Directx.java index 912e6722..80eaa6de 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Directx.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Directx.java @@ -1,36 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class Directx { +import lombok.*; - private Integer idDirectx; - private String version; +import java.io.Serializable; - public Directx(Integer idDirectx, String version) { - this.idDirectx = idDirectx; - this.version = version; - } +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Directx implements Serializable { - @Override - public String toString() { - return "Directx{" + - "idDirectx=" + idDirectx + - ", version='" + version + '\'' + - '}'; - } - - public Integer getIdDirectx() { - return idDirectx; - } - - public void setIdDirectx(Integer idDirectx) { - this.idDirectx = idDirectx; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } + private Integer idDirectx; + private String version; } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Esrb.java b/src/main/java/bo/ucb/edu/ingsoft/models/Esrb.java index 6a009a33..ed9f5955 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Esrb.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Esrb.java @@ -1,43 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class Esrb { - private Integer idEsrb; - private String esrb; - private String logoPath; - - public Esrb() { - } - - @Override - public String toString() { - return "Esrb{" + - "idEsrb=" + idEsrb + - ", esrb='" + esrb + '\'' + - ", logoPath='" + logoPath + '\'' + - '}'; - } - - public Integer getIdEsrb() { - return idEsrb; - } - - public void setIdEsrb(Integer idEsrb) { - this.idEsrb = idEsrb; - } - - public String getEsrb() { - return esrb; - } - - public void setEsrb(String esrb) { - this.esrb = esrb; - } - - public String getLogoPath() { - return logoPath; - } - - public void setLogoPath(String logoPath) { - this.logoPath = logoPath; - } +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Esrb implements Serializable { + private Integer idEsrb; + private String esrb; + private String logoPath; } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Game.java b/src/main/java/bo/ucb/edu/ingsoft/models/Game.java index aacedb68..7b906b37 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Game.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Game.java @@ -1,203 +1,30 @@ package bo.ucb.edu.ingsoft.models; +import lombok.*; + +import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; -public class Game extends Transactions{ - private Integer idGame; - private Integer idEsrb; - private Integer idDeveloper; - private String name; - private String description; - private String size; - private Integer players; - private Timestamp releaseDate; - private String processor; - private String memory; - private String graphics; - private String color; - private Integer highlight; - private String downloadPath; - private Integer status; - - public Game() { - } - - public Game(Integer idGame, Integer idEsrb, Integer idDeveloper, String name, String description, String size, Integer players, Timestamp releaseDate, String processor, String memory, String graphics, String color, Integer highlight, String downloadPath, Integer status) { - this.idGame = idGame; - this.idEsrb = idEsrb; - this.idDeveloper = idDeveloper; - this.name = name; - this.description = description; - this.size = size; - this.players = players; - this.releaseDate = releaseDate; - this.processor = processor; - this.memory = memory; - this.graphics = graphics; - this.color = color; - this.highlight = highlight; - this.downloadPath = downloadPath; - this.status = status; - } - - public Game(Integer txId, String txHost, Integer txUser, Date txDate, Integer idGame, Integer idEsrb, Integer idDeveloper, String name, String description, String size, Integer players, Timestamp releaseDate, String processor, String memory, String graphics, String color, Integer highlight, String downloadPath, Integer status) { - super(txId, txHost, txUser, txDate); - this.idGame = idGame; - this.idEsrb = idEsrb; - this.idDeveloper = idDeveloper; - this.name = name; - this.description = description; - this.size = size; - this.players = players; - this.releaseDate = releaseDate; - this.processor = processor; - this.memory = memory; - this.graphics = graphics; - this.color = color; - this.highlight = highlight; - this.downloadPath = downloadPath; - this.status = status; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getIdEsrb() { - return idEsrb; - } - - public void setIdEsrb(Integer idEsrb) { - this.idEsrb = idEsrb; - } - - public Integer getIdDeveloper() { - return idDeveloper; - } - - public void setIdDeveloper(Integer idDeveloper) { - this.idDeveloper = idDeveloper; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getSize() { - return size; - } - - public void setSize(String size) { - this.size = size; - } - - public Integer getPlayers() { - return players; - } - - public void setPlayers(Integer players) { - this.players = players; - } - - public Timestamp getReleaseDate() { - return releaseDate; - } - - public void setReleaseDate(Timestamp releaseDate) { - this.releaseDate = releaseDate; - } - - public String getProcessor() { - return processor; - } - - public void setProcessor(String processor) { - this.processor = processor; - } - - public String getMemory() { - return memory; - } - - public void setMemory(String memory) { - this.memory = memory; - } - - public String getGraphics() { - return graphics; - } - - public void setGraphics(String graphics) { - this.graphics = graphics; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public Integer getHighlight() { - return highlight; - } - - public void setHighlight(Integer highlight) { - this.highlight = highlight; - } - - public String getDownloadPath() { - return downloadPath; - } - - public void setDownloadPath(String downloadPath) { - this.downloadPath = downloadPath; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - @Override - public String toString() { - return "Game{" + - "idGame=" + idGame + - ", idEsrb=" + idEsrb + - ", idDeveloper=" + idDeveloper + - ", name='" + name + '\'' + - ", description='" + description + '\'' + - ", size='" + size + '\'' + - ", players=" + players + - ", releaseDate=" + releaseDate + - ", processor='" + processor + '\'' + - ", memory='" + memory + '\'' + - ", graphics='" + graphics + '\'' + - ", color='" + color + '\'' + - ", highlight=" + highlight + - ", downloadPath='" + downloadPath + '\'' + - ", status=" + status + - '}'; - } +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Game extends Transactions implements Serializable { + private Integer idGame; + private Integer idEsrb; + private Integer idDeveloper; + private String name; + private String description; + private String size; + private Integer players; + private Timestamp releaseDate; + private String processor; + private String memory; + private String graphics; + private String color; + private Integer highlight; + private String downloadPath; + private Integer status; } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/GameDirectx.java b/src/main/java/bo/ucb/edu/ingsoft/models/GameDirectx.java index b5e294b8..aeb8658c 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/GameDirectx.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/GameDirectx.java @@ -1,56 +1,19 @@ package bo.ucb.edu.ingsoft.models; -public class GameDirectx extends Transactions { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class GameDirectx extends Transactions implements Serializable { private Integer idGameDirectx; private Integer idGame; private Integer idDirectx; private Integer status; - - public GameDirectx() { - - } - - @Override - public String toString() { - return "GameDirectx{" + - "idGameDirectx=" + idGameDirectx + - ", idGame=" + idGame + - ", idDirectx=" + idDirectx + - ", status=" + status + - '}'; - } - - public Integer getIdGameDirectx() { - return idGameDirectx; - } - - public void setIdGameDirectx(Integer idGameDirectx) { - this.idGameDirectx = idGameDirectx; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getIdDirectx() { - return idDirectx; - } - - public void setIdDirectx(Integer idDirectx) { - this.idDirectx = idDirectx; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/GameHelper.java b/src/main/java/bo/ucb/edu/ingsoft/models/GameHelper.java index 5f8d1312..a6f5b62b 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/GameHelper.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/GameHelper.java @@ -1,6 +1,16 @@ package bo.ucb.edu.ingsoft.models; -public class GameHelper { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class GameHelper implements Serializable { private Integer limit; private Integer offset; private String query; @@ -8,87 +18,4 @@ public class GameHelper { private Boolean latest; private Boolean sale; private String publisher; - - public GameHelper(Integer limit, Integer offset, String query, Boolean highlight, Boolean latest, Boolean sale, String publisher) { - this.limit = limit; - this.offset = offset; - this.query = query; - this.highlight = highlight; - this.latest = latest; - this.sale = sale; - this.publisher = publisher; - } - - public GameHelper() { - - } - - @Override - public String toString() { - return "GameHelper{" + - "limit=" + limit + - ", offset=" + offset + - ", query='" + query + '\'' + - ", highlight=" + highlight + - ", latest=" + latest + - ", sale=" + sale + - ", publisher='" + publisher + '\'' + - '}'; - } - - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public Boolean getHighlight() { - return highlight; - } - - public void setHighlight(Boolean highlight) { - this.highlight = highlight; - } - - public Boolean getLatest() { - return latest; - } - - public void setLatest(Boolean latest) { - this.latest = latest; - } - - public Boolean getSale() { - return sale; - } - - public void setSale(Boolean sale) { - this.sale = sale; - } - - public String getPublisher() { - return publisher; - } - - public void setPublisher(String publisher) { - this.publisher = publisher; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/GameOS.java b/src/main/java/bo/ucb/edu/ingsoft/models/GameOS.java index 268c0e57..461de0db 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/GameOS.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/GameOS.java @@ -1,51 +1,18 @@ package bo.ucb.edu.ingsoft.models; -public class GameOS extends Transactions{ +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class GameOS extends Transactions implements Serializable { private Integer idGameOs; private Integer idGame; private Integer idOperatingSystem; private Integer status; - public GameOS() { - } - - @Override - public String toString() { - return "GameOS{" + - "idGameOs=" + idGameOs + - ", idGame=" + idGame + - ", idOperatingSystem=" + idOperatingSystem + - ", status=" + status + - '}'; - } - - public Integer getIdGameOs() { - return idGameOs; - } - - public void setIdGameOs(Integer idGameOs) { - this.idGameOs = idGameOs; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getIdOperatingSystem() { - return idOperatingSystem; - } - - public void setIdOperatingSystem(Integer idOperatingSystem) { - this.idOperatingSystem = idOperatingSystem; - } - public Integer getStatus() { - return status; - } - public void setStatus(Integer status) { - this.status = status; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirements.java b/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirements.java index 6d68c95b..ff9ece3a 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirements.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirements.java @@ -1,8 +1,14 @@ package bo.ucb.edu.ingsoft.models; -import java.util.Date; - -public class GameRequirements extends Transactions{ +import lombok.*; + +import java.io.Serializable; +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class GameRequirements extends Transactions implements Serializable { private Integer idGameRequirement; private Integer idGame; private Integer idOperatingSystem; @@ -10,87 +16,4 @@ public class GameRequirements extends Transactions{ private String memory; private String graphics; private Integer status; - - @Override - public String toString() { - return "GameRequirements{" + - "idGameRequirement=" + idGameRequirement + - ", idGame=" + idGame + - ", idOperatingSystem=" + idOperatingSystem + - ", processor='" + processor + '\'' + - ", memory='" + memory + '\'' + - ", graphics='" + graphics + '\'' + - ", status=" + status + - '}'; - } - - public GameRequirements() { - } - - public GameRequirements(Integer txId, String txHost, Integer txUser, Date txDate, Integer idGameRequirement, Integer idGame, Integer idOperatingSystem, String processor, String memory, String graphics, Integer status) { - super(txId, txHost, txUser, txDate); - this.idGameRequirement = idGameRequirement; - this.idGame = idGame; - this.idOperatingSystem = idOperatingSystem; - this.processor = processor; - this.memory = memory; - this.graphics = graphics; - this.status = status; - } - - public Integer getIdGameRequirement() { - return idGameRequirement; - } - - public void setIdGameRequirement(Integer idGameRequirement) { - this.idGameRequirement = idGameRequirement; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getIdOperatingSystem() { - return idOperatingSystem; - } - - public void setIdOperatingSystem(Integer idOperatingSystem) { - this.idOperatingSystem = idOperatingSystem; - } - - public String getProcessor() { - return processor; - } - - public void setProcessor(String processor) { - this.processor = processor; - } - - public String getMemory() { - return memory; - } - - public void setMemory(String memory) { - this.memory = memory; - } - - public String getGraphics() { - return graphics; - } - - public void setGraphics(String graphics) { - this.graphics = graphics; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirementsHelper.java b/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirementsHelper.java index 8fe4fb59..ce38ceeb 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirementsHelper.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/GameRequirementsHelper.java @@ -1,53 +1,18 @@ package bo.ucb.edu.ingsoft.models; -public class GameRequirementsHelper { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class GameRequirementsHelper implements Serializable { private String operatingSystem; private String processor; private String memory; private String graphics; - - @Override - public String toString() { - return "GameRequirementsHelper{" + - "operatingSystem='" + operatingSystem + '\'' + - ", processor='" + processor + '\'' + - ", memory='" + memory + '\'' + - ", graphics='" + graphics + '\'' + - '}'; - } - - public GameRequirementsHelper() { - } - - public String getOperatingSystem() { - return operatingSystem; - } - - public void setOperatingSystem(String operatingSystem) { - this.operatingSystem = operatingSystem; - } - - public String getProcessor() { - return processor; - } - - public void setProcessor(String processor) { - this.processor = processor; - } - - public String getMemory() { - return memory; - } - - public void setMemory(String memory) { - this.memory = memory; - } - - public String getGraphics() { - return graphics; - } - - public void setGraphics(String graphics) { - this.graphics = graphics; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Genre.java b/src/main/java/bo/ucb/edu/ingsoft/models/Genre.java index adaf02af..754072bb 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Genre.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Genre.java @@ -1,51 +1,18 @@ package bo.ucb.edu.ingsoft.models; -public class Genre { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Genre implements Serializable { private Integer idGenre; private String genre; private int status; - - public Genre() { - - } - - public Genre(Integer idGenre, String genre, int status) { - this.idGenre = idGenre; - this.genre = genre; - this.status = status; - } - - @Override - public String toString() { - return "Genre{" + - "idGenre=" + idGenre + - ", genre='" + genre + '\'' + - ", status=" + status + - '}'; - } - - public Integer getIdGenre() { - return idGenre; - } - - public void setIdGenre(Integer idGenre) { - this.idGenre = idGenre; - } - - public String getGenre() { - return genre; - } - - public void setGenre(String genre) { - this.genre = genre; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/GenreGame.java b/src/main/java/bo/ucb/edu/ingsoft/models/GenreGame.java index 538640f3..93849383 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/GenreGame.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/GenreGame.java @@ -1,51 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class GenreGame extends Transactions { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class GenreGame extends Transactions implements Serializable { private Integer idGenreGame; private Integer idGame; private Integer idGenre; - - public GenreGame(Integer idGenreGame, Integer idGame, Integer idGenre) { - this.idGenreGame = idGenreGame; - this.idGame = idGame; - this.idGenre = idGenre; - } - - public GenreGame() { - - } - - @Override - public String toString() { - return "Genres_Games{" + - "idGenreGame=" + idGenreGame + - ", idGame=" + idGame + - ", idGenre=" + idGenre + - '}'; - } - - public Integer getIdGenreGame() { - return idGenreGame; - } - - public void setIdGenreGame(Integer idGenreGame) { - this.idGenreGame = idGenreGame; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getIdGenre() { - return idGenre; - } - - public void setIdGenre(Integer idGenre) { - this.idGenre = idGenre; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Language.java b/src/main/java/bo/ucb/edu/ingsoft/models/Language.java index 3689b84d..b5247179 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Language.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Language.java @@ -1,33 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class Language { - private Integer idLanguage; - private String language; - - public Language() { - } - - @Override - public String toString() { - return "Language{" + - "idLanguage=" + idLanguage + - ", language='" + language + '\'' + - '}'; - } +import lombok.*; - public Integer getIdLanguage() { - return idLanguage; - } +import java.io.Serializable; - public void setIdLanguage(Integer idLanguage) { - this.idLanguage = idLanguage; - } - - public String getLanguage() { - return language; - } +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Language implements Serializable { + private Integer idLanguage; + private String language; - public void setLanguage(String language) { - this.language = language; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/LanguageGame.java b/src/main/java/bo/ucb/edu/ingsoft/models/LanguageGame.java index 2f844672..148f5c6a 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/LanguageGame.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/LanguageGame.java @@ -1,53 +1,15 @@ package bo.ucb.edu.ingsoft.models; +import lombok.*; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString public class LanguageGame extends Transactions{ private Integer idLanguageGame; private Integer idGame; private Integer idLanguage; private Integer status; - - public LanguageGame() { - } - - @Override - public String toString() { - return "LanguageGame{" + - "idLanguageGame=" + idLanguageGame + - ", idGame=" + idGame + - ", idLanguage=" + idLanguage + - ", status=" + status + - '}'; - } - - public Integer getIdLanguageGame() { - return idLanguageGame; - } - - public void setIdLanguageGame(Integer idLanguageGame) { - this.idLanguageGame = idLanguageGame; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getIdLanguage() { - return idLanguage; - } - - public void setIdLanguage(Integer idLanguage) { - this.idLanguage = idLanguage; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Library.java b/src/main/java/bo/ucb/edu/ingsoft/models/Library.java index 929b15b3..60054d77 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Library.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Library.java @@ -1,71 +1,18 @@ package bo.ucb.edu.ingsoft.models; -public class Library extends Transactions { - private Integer idLibrary; - private Integer idUser; - private Integer idGame; - private Integer status; - private Integer download; - - public Library() { - } - - public Library(Integer idLibrary, Integer idUser, Integer idGame, Integer status, Integer download) { - this.idLibrary = idLibrary; - this.idUser = idUser; - this.idGame = idGame; - this.status = status; - this.download = download; - } - - @Override - public String toString() { - return "Library{" + - "idLibrary=" + idLibrary + - ", idUser=" + idUser + - ", idGame=" + idGame + - ", status=" + status + - ", download=" + download + - '}'; - } - - public Integer getIdLibrary() { - return idLibrary; - } - - public void setIdLibrary(Integer idLibrary) { - this.idLibrary = idLibrary; - } - - public Integer getIdUser() { - return idUser; - } - - public void setIdUser(Integer idUser) { - this.idUser = idUser; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Integer getDownload() { - return download; - } - - public void setDownload(Integer download) { - this.download = download; - } +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Library extends Transactions implements Serializable { + private Integer idLibrary; + private Integer idUser; + private Integer idGame; + private Integer status; + private Integer download; } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/OperatingSystem.java b/src/main/java/bo/ucb/edu/ingsoft/models/OperatingSystem.java index 2242acf5..8a8f1463 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/OperatingSystem.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/OperatingSystem.java @@ -1,43 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class OperatingSystem { - private Integer idOperatingSystem; - private String operatingSystem; - private String logoPath; - - public OperatingSystem() { - } - - public Integer getIdOperatingSystem() { - return idOperatingSystem; - } - - public void setIdOperatingSystem(Integer idOperatingSystem) { - this.idOperatingSystem = idOperatingSystem; - } - - public String getOperatingSystem() { - return operatingSystem; - } - - public void setOperatingSystem(String operatingSystem) { - this.operatingSystem = operatingSystem; - } - - public String getLogoPath() { - return logoPath; - } - - public void setLogoPath(String logoPath) { - this.logoPath = logoPath; - } - - @Override - public String toString() { - return "OperatingSystem{" + - "id_operating_system=" + idOperatingSystem + - ", operating_system='" + operatingSystem + '\'' + - ", logo_path='" + logoPath + '\'' + - '}'; - } +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class OperatingSystem implements Serializable { + private Integer idOperatingSystem; + private String operatingSystem; + private String logoPath; } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/OrderDetails.java b/src/main/java/bo/ucb/edu/ingsoft/models/OrderDetails.java index 235b22b0..f9f4001e 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/OrderDetails.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/OrderDetails.java @@ -1,87 +1,17 @@ package bo.ucb.edu.ingsoft.models; -import java.util.Date; - -public class OrderDetails extends Transactions { +import lombok.*; + +import java.io.Serializable; +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class OrderDetails extends Transactions implements Serializable { private Integer idOrderDetails; private Integer idGame; private Integer idOrder; private Double price; private Integer status; - - public OrderDetails(Integer idOrderDetails, Integer idGame, Integer idOrder, Double price, Integer status) { - this.idOrderDetails = idOrderDetails; - this.idGame = idGame; - this.idOrder = idOrder; - this.price = price; - this.status = status; - } - - public OrderDetails(Integer txId, String txHost, Integer txUser, Date txDate, Integer idOrderDetails, Integer idGame, Integer idOrder, Double price, Integer status) { - super(txId, txHost, txUser, txDate); - this.idOrderDetails = idOrderDetails; - this.idGame = idGame; - this.idOrder = idOrder; - this.price = price; - this.status = status; - } - - public OrderDetails() { - } - - public OrderDetails(Integer txId, String txHost, Integer txUser, Date txDate) { - super(txId, txHost, txUser, txDate); - } - - public Integer getIdOrderDetails() { - return idOrderDetails; - } - - public void setIdOrderDetails(Integer idOrderDetails) { - this.idOrderDetails = idOrderDetails; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Integer getIdOrder() { - return idOrder; - } - - public void setIdOrder(Integer idOrder) { - this.idOrder = idOrder; - } - - public Double getPrice() { - return price; - } - - public void setPrice(Double price) { - this.price = price; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - @Override - public String toString() { - return "OrderDetails{" + - "idOrderDetails=" + idOrderDetails + - ", idGame=" + idGame + - ", idOrder=" + idOrder + - ", price=" + price + - ", status=" + status + - '}'; - } - } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Orders.java b/src/main/java/bo/ucb/edu/ingsoft/models/Orders.java index 37ab9195..81a22679 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Orders.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Orders.java @@ -1,75 +1,17 @@ package bo.ucb.edu.ingsoft.models; -import java.util.Date; +import lombok.*; -public class Orders extends Transactions { +import java.io.Serializable; +import java.util.Date; +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Orders extends Transactions implements Serializable { private Integer idOrder; private Integer idUser; private Date date; private Integer status; - - public Orders(Integer idOrder, Integer idUser, Date date, Integer status) { - this.idOrder = idOrder; - this.idUser = idUser; - this.date = date; - this.status = status; - } - - public Orders(Integer txId, String txHost, Integer txUser, java.util.Date txDate, Integer idOrder, Integer idUser, Date date, Integer status) { - super(txId, txHost, txUser, txDate); - this.idOrder = idOrder; - this.idUser = idUser; - this.date = date; - this.status = status; - } - - public Orders() { - } - - public Orders(Integer txId, String txHost, Integer txUser, java.util.Date txDate) { - super(txId, txHost, txUser, txDate); - } - - public Integer getIdOrder() { - return idOrder; - } - - public void setIdOrder(Integer idOrder) { - this.idOrder = idOrder; - } - - public Integer getIdUser() { - return idUser; - } - - public void setIdUser(Integer idUser) { - this.idUser = idUser; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - @Override - public String toString() { - return "Orders{" + - "idOrder=" + getIdOrder() + - ", idUser=" + getIdUser() + - ", date=" + getDate().toString() + - ", status=" + getStatus() + - '}'; - } - } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Photo.java b/src/main/java/bo/ucb/edu/ingsoft/models/Photo.java index 12cacc4c..0b5bb45e 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Photo.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Photo.java @@ -1,63 +1,18 @@ package bo.ucb.edu.ingsoft.models; -public class Photo extends Transactions { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Photo extends Transactions implements Serializable { private Integer idPhoto; private Integer idGame; private String photoPath; private Integer type; private Integer status; - - public Photo() { - } - - @Override - public String toString() { - return "Photo{" + - "idPhoto=" + idPhoto + - ", idGame=" + idGame + - ", photoPath='" + photoPath + '\'' + - ", type=" + type + - ", status=" + status + - '}'; - } - - public Integer getIdPhoto() { - return idPhoto; - } - - public void setIdPhoto(Integer idPhoto) { - this.idPhoto = idPhoto; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public String getPhotoPath() { - return photoPath; - } - - public void setPhotoPath(String photoPath) { - this.photoPath = photoPath; - } - - public Integer getType() { - return type; - } - - public void setType(Integer type) { - this.type = type; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Price.java b/src/main/java/bo/ucb/edu/ingsoft/models/Price.java index 41021679..75ce74f0 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Price.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Price.java @@ -1,95 +1,20 @@ package bo.ucb.edu.ingsoft.models; +import lombok.*; + +import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; - -public class Price extends Transactions { +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Price extends Transactions implements Serializable { private Integer idPrice; private Integer idGame; private Double price; private Timestamp date; private Double sale; private Integer status; - - public Price() { - } - - public Price(Integer idPrice, Integer idGame, Double price, Timestamp date, Double sale, Integer status) { - this.idPrice = idPrice; - this.idGame = idGame; - this.price = price; - this.date = date; - this.sale = sale; - this.status = status; - } - - public Price(Integer txId, String txHost, Integer txUser, Date txDate, Integer idPrice, Integer idGame, Double price, Timestamp date, Double sale, Integer status) { - super(txId, txHost, txUser, txDate); - this.idPrice = idPrice; - this.idGame = idGame; - this.price = price; - this.date = date; - this.sale = sale; - this.status = status; - } - - public Integer getIdPrice() { - return idPrice; - } - - public void setIdPrice(Integer idPrice) { - this.idPrice = idPrice; - } - - public Integer getIdGame() { - return idGame; - } - - public void setIdGame(Integer idGame) { - this.idGame = idGame; - } - - public Double getPrice() { - return price; - } - - public void setPrice(Double price) { - this.price = price; - } - - public Timestamp getDate() { - return date; - } - - public void setDate(Timestamp date) { - this.date = date; - } - - public Double getSale() { - return sale; - } - - public void setSale(Double sale) { - this.sale = sale; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - @Override - public String toString() { - return "Price{" + - "idPrice=" + idPrice + - ", idGame=" + idGame + - ", price=" + price + - ", date=" + date + - ", sale=" + sale + - ", status=" + status + - '}'; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Publisher.java b/src/main/java/bo/ucb/edu/ingsoft/models/Publisher.java index 0aeb0f28..91312871 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Publisher.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Publisher.java @@ -1,85 +1,18 @@ package bo.ucb.edu.ingsoft.models; -import java.util.Date; - -public class Publisher extends Transactions { +import lombok.*; + +import java.io.Serializable; +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Publisher extends Transactions implements Serializable { private Integer idPublisher; private Integer idUser; private String publisher; private String paypalMail; private Integer status; - - - public Publisher() { - - } - - public Publisher(Integer idPublisher, Integer idUser, String publisher, String paypalMail, Integer status) { - this.idPublisher = idPublisher; - this.idUser = idUser; - this.publisher = publisher; - this.paypalMail = paypalMail; - this.status = status; - } - - public Publisher(Integer txId, String txHost, Integer txUser, Date txDate, Integer idPublisher, Integer idUser, String publisher, String paypalMail, Integer status) { - super(txId, txHost, txUser, txDate); - this.idPublisher = idPublisher; - this.idUser = idUser; - this.publisher = publisher; - this.paypalMail = paypalMail; - this.status = status; - } - - public Integer getIdPublisher() { - return idPublisher; - } - - public void setIdPublisher(Integer idPublisher) { - this.idPublisher = idPublisher; - } - - public Integer getIdUser() { - return idUser; - } - - public void setIdUser(Integer idUser) { - this.idUser = idUser; - } - - public String getPublisher() { - return publisher; - } - - public void setPublisher(String publisher) { - this.publisher = publisher; - } - - public String getPaypalMail() { - return paypalMail; - } - - public void setPaypalMail(String paypalMail) { - this.paypalMail = paypalMail; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - @Override - public String toString() { - return "Publisher{" + - "idPublisher=" + idPublisher + - ", idUser=" + idUser + - ", publisher='" + publisher + '\'' + - ", paypalMail='" + paypalMail + '\'' + - ", status=" + status + - '}'; - } } \ No newline at end of file diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/Transactions.java b/src/main/java/bo/ucb/edu/ingsoft/models/Transactions.java index f598daa3..6d2c81c9 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/Transactions.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/Transactions.java @@ -1,63 +1,18 @@ package bo.ucb.edu.ingsoft.models; -import java.util.Date; +import lombok.*; -public class Transactions { +import java.io.Serializable; +import java.util.Date; +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class Transactions implements Serializable { private Integer txId; private String txHost; private Integer txUserId; private Date txDate; - - public Transactions() { - } - - public Transactions(Integer txId, String txHost, Integer txUser, Date txDate) { - this.txId = txId; - this.txHost = txHost; - this.txUserId = txUser; - this.txDate = txDate; - } - - public Integer getTxId() { - return txId; - } - - public void setTxId(Integer txId) { - this.txId = txId; - } - - public String getTxHost() { - return txHost; - } - - public void setTxHost(String txHost) { - this.txHost = txHost; - } - - public Integer getTxUserId() { - return txUserId; - } - - public void setTxUserId(Integer txUserId) { - this.txUserId = txUserId; - } - - public Date getTxDate() { - return txDate; - } - - public void setTxDate(Date txDate) { - this.txDate = txDate; - } - - @Override - public String toString() { - return "Transactions{" + - "txId=" + txId + - ", txHost='" + txHost + '\'' + - ", txUser=" + txUserId + - ", txDate=" + txDate + - '}'; - } - } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/User.java b/src/main/java/bo/ucb/edu/ingsoft/models/User.java index ae8edfdb..c555d06f 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/User.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/User.java @@ -1,8 +1,14 @@ package bo.ucb.edu.ingsoft.models; -import java.util.Date; - -public class User extends Transactions { +import lombok.*; + +import java.io.Serializable; +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class User extends Transactions implements Serializable { private Integer idUser; private Integer idCountry; private String userName; @@ -15,142 +21,4 @@ public class User extends Transactions { private String alias; private Integer status; - - public User() { - } - - public User(Integer idUser, Integer idCountry, String userName, String password, String email, Integer userType, String photoPath, String name, String lastName, String alias, Integer status) { - this.idUser = idUser; - this.idCountry = idCountry; - this.userName = userName; - this.password = password; - this.email = email; - this.userType = userType; - this.photoPath = photoPath; - this.name = name; - this.lastName = lastName; - this.alias = alias; - this.status = status; - } - - public User(Integer txId, String txHost, Integer txUser, Date txDate, Integer idUser, Integer idCountry, String userName, String password, String email, Integer userType, String photoPath, String name, String lastName, String alias, Integer status) { - super(txId, txHost, txUser, txDate); - this.idUser = idUser; - this.idCountry = idCountry; - this.userName = userName; - this.password = password; - this.email = email; - this.userType = userType; - this.photoPath = photoPath; - this.name = name; - this.lastName = lastName; - this.alias = alias; - this.status = status; - } - - @Override - public String toString() { - return "User{" + - "idUser=" + idUser + - ", idCountry=" + idCountry + - ", userName='" + userName + '\'' + - ", password='" + password + '\'' + - ", email='" + email + '\'' + - ", userType=" + userType + - ", photoPath='" + photoPath + '\'' + - ", name='" + name + '\'' + - ", lastName='" + lastName + '\'' + - ", alias='" + alias + '\'' + - ", status=" + status + - '}'; - } - - public Integer getIdUser() { - return idUser; - } - - public void setIdUser(Integer idUser) { - this.idUser = idUser; - } - - public Integer getIdCountry() { - return idCountry; - } - - public void setIdCountry(Integer idCountry) { - this.idCountry = idCountry; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public Integer getUserType() { - return userType; - } - - public void setUserType(Integer userType) { - this.userType = userType; - } - - public String getPhotoPath() { - return photoPath; - } - - public void setPhotoPath(String photoPath) { - this.photoPath = photoPath; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/countryDashboard.java b/src/main/java/bo/ucb/edu/ingsoft/models/countryDashboard.java index d47c2f20..bd16e04d 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/countryDashboard.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/countryDashboard.java @@ -1,43 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class countryDashboard { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class countryDashboard implements Serializable { private String country; private Integer sells; private Double earnings; - - public countryDashboard() { - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - public Integer getSells() { - return sells; - } - - public void setSells(Integer sells) { - this.sells = sells; - } - - public Double getEarnings() { - return earnings; - } - - public void setEarnings(Double earnings) { - this.earnings = earnings; - } - - @Override - public String toString() { - return "countryDashboard{" + - "country='" + country + '\'' + - ", sells=" + sells + - ", earnings=" + earnings + - '}'; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/gameDashboard.java b/src/main/java/bo/ucb/edu/ingsoft/models/gameDashboard.java index 0f875a2b..95b8012b 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/gameDashboard.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/gameDashboard.java @@ -1,43 +1,17 @@ package bo.ucb.edu.ingsoft.models; -public class gameDashboard { +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class gameDashboard implements Serializable { private String game; private Integer sells; private Double earnings; - - public gameDashboard() { - } - - public String getGame() { - return game; - } - - public void setGame(String game) { - this.game = game; - } - - public Integer getSells() { - return sells; - } - - public void setSells(Integer sells) { - this.sells = sells; - } - - public Double getEarnings() { - return earnings; - } - - public void setEarnings(Double earnings) { - this.earnings = earnings; - } - - @Override - public String toString() { - return "gameDashboard{" + - "game='" + game + '\'' + - ", sells=" + sells + - ", earnings=" + earnings + - '}'; - } } diff --git a/src/main/java/bo/ucb/edu/ingsoft/models/monthlyDashboard.java b/src/main/java/bo/ucb/edu/ingsoft/models/monthlyDashboard.java index 4a032d92..c87ae492 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/models/monthlyDashboard.java +++ b/src/main/java/bo/ucb/edu/ingsoft/models/monthlyDashboard.java @@ -1,53 +1,18 @@ package bo.ucb.edu.ingsoft.models; -public class monthlyDashboard { - private Integer month; - private Integer year; - private Integer sells; - private Double earnings; - - public monthlyDashboard() { - } - - public Integer getMonth() { - return month; - } - - public void setMonth(Integer month) { - this.month = month; - } - - public Integer getYear() { - return year; - } - - public void setYear(Integer year) { - this.year = year; - } - - public Integer getSells() { - return sells; - } - - public void setSells(Integer sells) { - this.sells = sells; - } - - public Double getEarnings() { - return earnings; - } - - public void setEarnings(Double earnings) { - this.earnings = earnings; - } - - @Override - public String toString() { - return "monthlyDashboard{" + - "month=" + month + - ", year=" + year + - ", sells=" + sells + - ", earnings=" + earnings + - '}'; - } +import lombok.*; + +import java.io.Serializable; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ToString +public class monthlyDashboard implements Serializable { + private Integer month; + private Integer year; + private Integer sells; + private Double earnings; } diff --git a/src/main/java/bo/ucb/edu/ingsoft/util/TransactionUtil.java b/src/main/java/bo/ucb/edu/ingsoft/util/TransactionUtil.java index f8dcf699..56f4bf3a 100644 --- a/src/main/java/bo/ucb/edu/ingsoft/util/TransactionUtil.java +++ b/src/main/java/bo/ucb/edu/ingsoft/util/TransactionUtil.java @@ -7,7 +7,7 @@ public class TransactionUtil { - public static Transaction createTransaction(HttpServletRequest request) { + public static Transaction createTransaction(final HttpServletRequest request) { Transaction transaction = new Transaction(); transaction.setTxDate(new Date()); transaction.setTxHost(request.getRemoteHost());