├── .travis.yml ├── LICENSE ├── README.md ├── backend ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── create.sql ├── mvnw ├── mvnw.cmd ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── webvision │ │ │ │ └── dspesquisa │ │ │ │ ├── DspesquisaApplication.java │ │ │ │ ├── config │ │ │ │ └── SecurityConfig.java │ │ │ │ ├── dto │ │ │ │ ├── GameDTO.java │ │ │ │ ├── RecordDTO.java │ │ │ │ └── RecordInsertDTO.java │ │ │ │ ├── entities │ │ │ │ ├── Game.java │ │ │ │ ├── Genre.java │ │ │ │ ├── Record.java │ │ │ │ └── enums │ │ │ │ │ └── Platform.java │ │ │ │ ├── repositories │ │ │ │ ├── GameRepository.java │ │ │ │ ├── GenreRepository.java │ │ │ │ └── RecordRepository.java │ │ │ │ ├── resources │ │ │ │ ├── GameResource.java │ │ │ │ └── RecordResource.java │ │ │ │ └── services │ │ │ │ ├── GameService.java │ │ │ │ └── RecordService.java │ │ └── resources │ │ │ ├── application-dev.properties │ │ │ ├── application-prod.properties │ │ │ ├── application-test.properties │ │ │ ├── application.properties │ │ │ └── import.sql │ └── test │ │ └── java │ │ └── com │ │ └── webvision │ │ └── dspesquisa │ │ └── DspesquisaApplicationTests.java └── system.properties ├── front-mobile ├── .expo-shared │ └── assets.json ├── .gitignore ├── App.tsx ├── app.json ├── assets │ ├── favicon.png │ ├── icon.png │ └── splash.png ├── babel.config.js ├── package.json ├── src │ ├── assets │ │ ├── gamer.png │ │ └── logo.png │ ├── components │ │ └── Header │ │ │ └── index.tsx │ ├── pages │ │ ├── CreateRecords │ │ │ ├── PLatformCard.tsx │ │ │ ├── index.tsx │ │ │ └── types.ts │ │ └── Home │ │ │ └── index.tsx │ └── routes.tsx ├── tsconfig.json └── yarn.lock └── front-web ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── _redirects └── index.html ├── src ├── App.css ├── App.tsx ├── Routes.tsx ├── assets │ ├── arrow.svg │ ├── gamer.svg │ └── logo.svg ├── components │ ├── Filters │ │ └── index.tsx │ └── Header │ │ ├── Index.tsx │ │ └── styles.css ├── index.tsx ├── pages │ ├── Charts │ │ ├── chart-options.ts │ │ ├── helpers.ts │ │ ├── index.tsx │ │ ├── styles.css │ │ └── types.ts │ ├── Home │ │ ├── index.tsx │ │ └── styles.css │ └── Records │ │ ├── Pagination │ │ ├── index.tsx │ │ └── styles.css │ │ ├── helpers.ts │ │ ├── index.tsx │ │ ├── styles.css │ │ └── types.ts ├── react-app-env.d.ts └── utils │ └── requests.ts ├── tsconfig.json └── yarn.lock /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk11 4 | before_install: 5 | - cd backend 6 | - chmod +x mvnw 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 DevSuperior 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Big Game Survey 2 | [](https://github.com/devsuperior/sds1-wmazoni/blob/master/LICENSE) 3 | 4 | # Sobre o projeto 5 | 6 | https://wmazoni-sds1.netlify.app 7 | 8 | Big Game Survey é uma aplicação full stack web e mobile construída durante a 1ª edição da **Semana DevSuperior** (#sds1), evento organizado pela [DevSuperior](https://devsuperior.com "Site da DevSuperior"). 9 | 10 | A aplicação consiste em uma pesquisa de preferência de games, onde os dados são coletados no app mobile, e depois são listados no app web, que também apresenta um dashboard com gráficos baseados nestes dados. 11 | 12 | ## Layout mobile 13 |   14 | 15 | ## Layout web 16 |  17 | 18 |  19 | 20 | ## Modelo conceitual 21 |  22 | 23 | # Tecnologias utilizadas 24 | ## Back end 25 | - Java 26 | - Spring Boot 27 | - JPA / Hibernate 28 | - Maven 29 | ## Front end 30 | - HTML / CSS / JS / TypeScript 31 | - ReactJS 32 | - React Native 33 | - Apex Charts 34 | - Expo 35 | ## Implantação em produção 36 | - Back end: Heroku 37 | - Front end web: Netlify 38 | - Banco de dados: Postgresql 39 | 40 | # Como executar o projeto 41 | 42 | ## Back end 43 | Pré-requisitos: Java 11 44 | 45 | ```bash 46 | # clonar repositório 47 | git clone https://github.com/devsuperior/sds1-wmazoni 48 | 49 | # entrar na pasta do projeto back end 50 | cd backend 51 | 52 | # executar o projeto 53 | ./mvnw spring-boot:run 54 | ``` 55 | 56 | ## Front end web 57 | Pré-requisitos: npm / yarn 58 | 59 | ```bash 60 | # clonar repositório 61 | git clone https://github.com/devsuperior/sds1-wmazoni 62 | 63 | # entrar na pasta do projeto front end web 64 | cd front-web 65 | 66 | # instalar dependências 67 | yarn install 68 | 69 | # executar o projeto 70 | yarn start 71 | ``` 72 | 73 | # Autor 74 | 75 | Wellington Mazoni de Andrade 76 | 77 | https://www.linkedin.com/in/wmazoni 78 | 79 | -------------------------------------------------------------------------------- /backend/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /backend/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /backend/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devsuperior/sds1-wmazoni/f6899e37b63de10baac85b97303063efa13721e1/backend/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /backend/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /backend/create.sql: -------------------------------------------------------------------------------- 1 | create table tb_game (id int8 generated by default as identity, platform int4, title varchar(255), genre_id int8, primary key (id)); 2 | create table tb_genre (id int8 generated by default as identity, name varchar(255), primary key (id)); 3 | create table tb_record (id int8 generated by default as identity, age int4, moment timestamp, name varchar(255), game_id int8, primary key (id)); 4 | alter table if exists tb_game add constraint FKf3f1dhblquex0l47kxpid5c6x foreign key (genre_id) references tb_genre; 5 | alter table if exists tb_record add constraint FKk5bmm1a76ij93i60umu7syojv foreign key (game_id) references tb_game; 6 | INSERT INTO tb_genre (name) VALUES ('Shooter'); 7 | INSERT INTO tb_genre (name) VALUES ('MOBA'); 8 | INSERT INTO tb_genre (name) VALUES ('RPG'); 9 | INSERT INTO tb_genre (name) VALUES ('Battle Royale'); 10 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('The Witcher 3', 2, 3); 11 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('League of Legends', 0, 2); 12 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('CS GO', 0, 1); 13 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Cyberpunk 2077', 0, 3); 14 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Cyberpunk 2077', 2, 3); 15 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('God of War', 0, 3); 16 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('God of War', 1, 3); 17 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Overwatch', 0, 1); 18 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Valorant', 0, 1); 19 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Fall Guys', 0, 4); 20 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Fall Guys', 1, 4); 21 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Fortnite', 0, 4); 22 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Dragon Age Inquisition', 2, 3); 23 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Dragon Age Inquisition', 1, 3); 24 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tulio', 44, TIMESTAMP WITH TIME ZONE '2020-07-21T20:59:19Z'); 25 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Alex', 33, TIMESTAMP WITH TIME ZONE '2020-06-20T20:30:26Z'); 26 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcos', 45, TIMESTAMP WITH TIME ZONE '2020-06-15T15:01:37Z'); 27 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Tony', 32, TIMESTAMP WITH TIME ZONE '2020-05-22T19:05:38Z'); 28 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Meire', 24, TIMESTAMP WITH TIME ZONE '2020-07-11T11:31:03Z'); 29 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Maria', 31, TIMESTAMP WITH TIME ZONE '2020-07-11T00:36:59Z'); 30 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Alex', 39, TIMESTAMP WITH TIME ZONE '2020-06-14T03:33:16Z'); 31 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Aline', 42, TIMESTAMP WITH TIME ZONE '2020-05-20T09:27:22Z'); 32 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Filipe', 27, TIMESTAMP WITH TIME ZONE '2020-06-25T06:44:58Z'); 33 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Tulio', 45, TIMESTAMP WITH TIME ZONE '2020-05-29T15:26:15Z'); 34 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Filipe', 39, TIMESTAMP WITH TIME ZONE '2020-05-04T21:41:42Z'); 35 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Tulio', 42, TIMESTAMP WITH TIME ZONE '2020-05-30T12:35:32Z'); 36 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Silas', 32, TIMESTAMP WITH TIME ZONE '2020-05-14T23:27:26Z'); 37 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Alex', 44, TIMESTAMP WITH TIME ZONE '2020-07-18T01:20:44Z'); 38 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Carlos', 42, TIMESTAMP WITH TIME ZONE '2020-05-31T02:43:24Z'); 39 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tito', 26, TIMESTAMP WITH TIME ZONE '2020-06-05T16:59:51Z'); 40 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Erico', 34, TIMESTAMP WITH TIME ZONE '2020-07-23T14:22:42Z'); 41 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marina', 39, TIMESTAMP WITH TIME ZONE '2020-07-23T14:02:26Z'); 42 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Erico', 45, TIMESTAMP WITH TIME ZONE '2020-07-24T03:59:40Z'); 43 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Maria', 39, TIMESTAMP WITH TIME ZONE '2020-06-26T10:37:29Z'); 44 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Marcela', 20, TIMESTAMP WITH TIME ZONE '2020-06-19T19:02:59Z'); 45 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Marcos', 41, TIMESTAMP WITH TIME ZONE '2020-06-22T00:12:31Z'); 46 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Francisco', 29, TIMESTAMP WITH TIME ZONE '2020-07-01T09:59:35Z'); 47 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Manasses', 20, TIMESTAMP WITH TIME ZONE '2020-06-24T12:09:54Z'); 48 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Bob', 21, TIMESTAMP WITH TIME ZONE '2020-07-05T15:09:38Z'); 49 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Tony', 22, TIMESTAMP WITH TIME ZONE '2020-06-20T15:29:45Z'); 50 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Ana', 33, TIMESTAMP WITH TIME ZONE '2020-06-08T03:26:33Z'); 51 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcos', 40, TIMESTAMP WITH TIME ZONE '2020-06-16T18:18:31Z'); 52 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Jessica', 46, TIMESTAMP WITH TIME ZONE '2020-06-22T14:39:55Z'); 53 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Tulio', 22, TIMESTAMP WITH TIME ZONE '2020-07-22T16:49:11Z'); 54 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Erico', 25, TIMESTAMP WITH TIME ZONE '2020-06-06T06:48:33Z'); 55 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Meire', 31, TIMESTAMP WITH TIME ZONE '2020-07-12T04:16:15Z'); 56 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Cesar', 26, TIMESTAMP WITH TIME ZONE '2020-05-20T07:15:10Z'); 57 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Carolina', 21, TIMESTAMP WITH TIME ZONE '2020-06-19T11:33:35Z'); 58 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Marcos', 40, TIMESTAMP WITH TIME ZONE '2020-07-14T12:27:11Z'); 59 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Marcela', 23, TIMESTAMP WITH TIME ZONE '2020-06-27T21:40:33Z'); 60 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Rita', 33, TIMESTAMP WITH TIME ZONE '2020-06-23T09:09:14Z'); 61 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Alex', 18, TIMESTAMP WITH TIME ZONE '2020-07-10T13:58:32Z'); 62 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Jessica', 28, TIMESTAMP WITH TIME ZONE '2020-07-30T00:40:16Z'); 63 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcela', 22, TIMESTAMP WITH TIME ZONE '2020-06-21T15:17:07Z'); 64 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Maria', 45, TIMESTAMP WITH TIME ZONE '2020-06-11T17:36:44Z'); 65 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Marcos', 46, TIMESTAMP WITH TIME ZONE '2020-06-30T00:25:28Z'); 66 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Maria', 18, TIMESTAMP WITH TIME ZONE '2020-05-05T16:44:51Z'); 67 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Francisco', 45, TIMESTAMP WITH TIME ZONE '2020-06-19T02:24:11Z'); 68 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Manasses', 42, TIMESTAMP WITH TIME ZONE '2020-05-18T23:54:59Z'); 69 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Tulio', 30, TIMESTAMP WITH TIME ZONE '2020-07-23T00:20:54Z'); 70 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Bob', 40, TIMESTAMP WITH TIME ZONE '2020-05-22T17:13:10Z'); 71 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Jessica', 24, TIMESTAMP WITH TIME ZONE '2020-07-04T10:35:28Z'); 72 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tony', 27, TIMESTAMP WITH TIME ZONE '2020-06-08T16:45:34Z'); 73 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Manasses', 34, TIMESTAMP WITH TIME ZONE '2020-07-10T19:26:49Z'); 74 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Francisco', 38, TIMESTAMP WITH TIME ZONE '2020-07-21T23:54:48Z'); 75 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Maria', 32, TIMESTAMP WITH TIME ZONE '2020-06-24T11:04:57Z'); 76 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Maria', 37, TIMESTAMP WITH TIME ZONE '2020-05-28T04:51:07Z'); 77 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Marina', 37, TIMESTAMP WITH TIME ZONE '2020-06-13T10:20:06Z'); 78 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Marina', 27, TIMESTAMP WITH TIME ZONE '2020-07-05T09:10:16Z'); 79 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tulio', 28, TIMESTAMP WITH TIME ZONE '2020-05-05T09:01:48Z'); 80 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Manasses', 43, TIMESTAMP WITH TIME ZONE '2020-05-27T14:42:01Z'); 81 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Tito', 23, TIMESTAMP WITH TIME ZONE '2020-06-16T07:22:12Z'); 82 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Bob', 46, TIMESTAMP WITH TIME ZONE '2020-06-04T12:43:47Z'); 83 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Manasses', 43, TIMESTAMP WITH TIME ZONE '2020-05-29T00:39:12Z'); 84 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Marcos', 30, TIMESTAMP WITH TIME ZONE '2020-05-07T18:58:45Z'); 85 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcos', 26, TIMESTAMP WITH TIME ZONE '2020-05-20T15:12:10Z'); 86 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Jessica', 35, TIMESTAMP WITH TIME ZONE '2020-06-23T00:38:49Z'); 87 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marcela', 23, TIMESTAMP WITH TIME ZONE '2020-05-01T05:40:58Z'); 88 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tulio', 37, TIMESTAMP WITH TIME ZONE '2020-06-26T00:51:12Z'); 89 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Tony', 37, TIMESTAMP WITH TIME ZONE '2020-07-28T05:46:23Z'); 90 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Monica', 35, TIMESTAMP WITH TIME ZONE '2020-06-28T10:49:12Z'); 91 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Ana', 20, TIMESTAMP WITH TIME ZONE '2020-05-25T11:29:38Z'); 92 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Bob', 37, TIMESTAMP WITH TIME ZONE '2020-06-05T05:03:03Z'); 93 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Erico', 43, TIMESTAMP WITH TIME ZONE '2020-05-21T03:30:32Z'); 94 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Maria', 20, TIMESTAMP WITH TIME ZONE '2020-07-23T16:49:02Z'); 95 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Tony', 18, TIMESTAMP WITH TIME ZONE '2020-05-15T02:24:46Z'); 96 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Filipe', 24, TIMESTAMP WITH TIME ZONE '2020-05-14T08:26:00Z'); 97 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Marcela', 27, TIMESTAMP WITH TIME ZONE '2020-07-25T13:11:09Z'); 98 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Monica', 39, TIMESTAMP WITH TIME ZONE '2020-06-03T04:28:58Z'); 99 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Monica', 34, TIMESTAMP WITH TIME ZONE '2020-07-12T20:12:21Z'); 100 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Meire', 39, TIMESTAMP WITH TIME ZONE '2020-05-12T14:57:23Z'); 101 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marina', 25, TIMESTAMP WITH TIME ZONE '2020-06-23T12:17:23Z'); 102 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tito', 20, TIMESTAMP WITH TIME ZONE '2020-05-20T15:24:43Z'); 103 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Ana', 36, TIMESTAMP WITH TIME ZONE '2020-07-01T16:51:09Z'); 104 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Jessica', 25, TIMESTAMP WITH TIME ZONE '2020-06-03T13:08:05Z'); 105 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 41, TIMESTAMP WITH TIME ZONE '2020-06-12T23:50:42Z'); 106 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Maria', 35, TIMESTAMP WITH TIME ZONE '2020-05-23T15:33:18Z'); 107 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Cesar', 25, TIMESTAMP WITH TIME ZONE '2020-07-02T19:06:52Z'); 108 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Bob', 38, TIMESTAMP WITH TIME ZONE '2020-06-26T13:49:49Z'); 109 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Alex', 30, TIMESTAMP WITH TIME ZONE '2020-05-26T00:13:35Z'); 110 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Cesar', 30, TIMESTAMP WITH TIME ZONE '2020-05-04T22:08:03Z'); 111 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Tulio', 46, TIMESTAMP WITH TIME ZONE '2020-07-21T08:58:17Z'); 112 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Cesar', 44, TIMESTAMP WITH TIME ZONE '2020-06-02T20:51:22Z'); 113 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Marcela', 27, TIMESTAMP WITH TIME ZONE '2020-07-13T23:17:38Z'); 114 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Bob', 39, TIMESTAMP WITH TIME ZONE '2020-06-28T19:16:40Z'); 115 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Erico', 40, TIMESTAMP WITH TIME ZONE '2020-07-29T02:41:47Z'); 116 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Marcos', 47, TIMESTAMP WITH TIME ZONE '2020-07-15T23:10:50Z'); 117 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Tito', 41, TIMESTAMP WITH TIME ZONE '2020-06-27T20:03:12Z'); 118 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Francisco', 41, TIMESTAMP WITH TIME ZONE '2020-06-27T22:24:43Z'); 119 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Tony', 21, TIMESTAMP WITH TIME ZONE '2020-05-11T19:08:56Z'); 120 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Erico', 32, TIMESTAMP WITH TIME ZONE '2020-07-17T12:50:52Z'); 121 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Filipe', 22, TIMESTAMP WITH TIME ZONE '2020-07-07T18:33:37Z'); 122 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Tiago', 39, TIMESTAMP WITH TIME ZONE '2020-07-06T22:15:07Z'); 123 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Filipe', 32, TIMESTAMP WITH TIME ZONE '2020-06-06T17:40:06Z'); 124 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Carolina', 20, TIMESTAMP WITH TIME ZONE '2020-07-11T18:25:34Z'); 125 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Manasses', 45, TIMESTAMP WITH TIME ZONE '2020-06-25T10:03:38Z'); 126 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Maria', 31, TIMESTAMP WITH TIME ZONE '2020-06-24T19:13:42Z'); 127 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marcela', 41, TIMESTAMP WITH TIME ZONE '2020-07-14T11:35:40Z'); 128 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Marina', 27, TIMESTAMP WITH TIME ZONE '2020-07-08T11:32:31Z'); 129 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Carolina', 39, TIMESTAMP WITH TIME ZONE '2020-07-07T06:17:55Z'); 130 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Alex', 29, TIMESTAMP WITH TIME ZONE '2020-05-07T16:55:40Z'); 131 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Meire', 26, TIMESTAMP WITH TIME ZONE '2020-06-21T22:35:13Z'); 132 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Silas', 28, TIMESTAMP WITH TIME ZONE '2020-06-21T07:55:41Z'); 133 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Meire', 27, TIMESTAMP WITH TIME ZONE '2020-06-29T12:36:02Z'); 134 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Cesar', 19, TIMESTAMP WITH TIME ZONE '2020-06-05T23:35:06Z'); 135 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Meire', 21, TIMESTAMP WITH TIME ZONE '2020-06-13T00:16:11Z'); 136 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Carolina', 35, TIMESTAMP WITH TIME ZONE '2020-06-21T20:27:18Z'); 137 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Marcos', 33, TIMESTAMP WITH TIME ZONE '2020-06-10T09:41:17Z'); 138 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Francisco', 22, TIMESTAMP WITH TIME ZONE '2020-07-17T21:53:18Z'); 139 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Francisco', 45, TIMESTAMP WITH TIME ZONE '2020-05-09T16:31:29Z'); 140 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Tito', 29, TIMESTAMP WITH TIME ZONE '2020-07-19T19:39:54Z'); 141 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tiago', 37, TIMESTAMP WITH TIME ZONE '2020-05-05T16:23:54Z'); 142 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Tulio', 35, TIMESTAMP WITH TIME ZONE '2020-06-03T06:06:01Z'); 143 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Meire', 25, TIMESTAMP WITH TIME ZONE '2020-07-19T02:02:32Z'); 144 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Francisco', 44, TIMESTAMP WITH TIME ZONE '2020-07-24T03:32:22Z'); 145 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Francisco', 23, TIMESTAMP WITH TIME ZONE '2020-05-18T16:45:37Z'); 146 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Ana', 26, TIMESTAMP WITH TIME ZONE '2020-07-07T22:11:51Z'); 147 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Aline', 30, TIMESTAMP WITH TIME ZONE '2020-07-25T12:18:48Z'); 148 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Erico', 21, TIMESTAMP WITH TIME ZONE '2020-05-23T11:24:09Z'); 149 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Marina', 42, TIMESTAMP WITH TIME ZONE '2020-07-04T10:16:40Z'); 150 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Marina', 32, TIMESTAMP WITH TIME ZONE '2020-06-14T13:25:11Z'); 151 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Carlos', 43, TIMESTAMP WITH TIME ZONE '2020-05-29T19:52:07Z'); 152 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tiago', 34, TIMESTAMP WITH TIME ZONE '2020-07-24T08:36:19Z'); 153 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Aline', 46, TIMESTAMP WITH TIME ZONE '2020-07-20T05:32:53Z'); 154 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Manasses', 18, TIMESTAMP WITH TIME ZONE '2020-06-04T11:43:05Z'); 155 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Rita', 36, TIMESTAMP WITH TIME ZONE '2020-05-08T18:06:04Z'); 156 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Manasses', 22, TIMESTAMP WITH TIME ZONE '2020-07-15T14:19:44Z'); 157 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Tiago', 21, TIMESTAMP WITH TIME ZONE '2020-05-15T16:58:55Z'); 158 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Maria', 26, TIMESTAMP WITH TIME ZONE '2020-06-04T10:20:57Z'); 159 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Marcos', 30, TIMESTAMP WITH TIME ZONE '2020-06-10T06:55:09Z'); 160 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Bob', 45, TIMESTAMP WITH TIME ZONE '2020-07-08T20:00:48Z'); 161 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Marina', 41, TIMESTAMP WITH TIME ZONE '2020-06-16T13:14:52Z'); 162 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Maria', 33, TIMESTAMP WITH TIME ZONE '2020-06-08T13:26:00Z'); 163 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Aline', 41, TIMESTAMP WITH TIME ZONE '2020-05-19T01:56:48Z'); 164 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Maria', 20, TIMESTAMP WITH TIME ZONE '2020-07-28T23:53:21Z'); 165 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Aline', 39, TIMESTAMP WITH TIME ZONE '2020-06-15T23:42:27Z'); 166 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tulio', 26, TIMESTAMP WITH TIME ZONE '2020-06-02T16:05:39Z'); 167 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Rita', 34, TIMESTAMP WITH TIME ZONE '2020-07-30T06:33:00Z'); 168 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Cesar', 41, TIMESTAMP WITH TIME ZONE '2020-07-11T14:05:22Z'); 169 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Carlos', 22, TIMESTAMP WITH TIME ZONE '2020-05-29T01:54:35Z'); 170 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Carlos', 27, TIMESTAMP WITH TIME ZONE '2020-06-10T19:30:33Z'); 171 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tulio', 32, TIMESTAMP WITH TIME ZONE '2020-07-02T22:32:56Z'); 172 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Silas', 43, TIMESTAMP WITH TIME ZONE '2020-07-10T11:30:09Z'); 173 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Meire', 24, TIMESTAMP WITH TIME ZONE '2020-06-21T08:29:45Z'); 174 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Meire', 28, TIMESTAMP WITH TIME ZONE '2020-06-30T10:27:21Z'); 175 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Tony', 29, TIMESTAMP WITH TIME ZONE '2020-07-06T10:09:46Z'); 176 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Maria', 24, TIMESTAMP WITH TIME ZONE '2020-06-17T04:34:20Z'); 177 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Carlos', 46, TIMESTAMP WITH TIME ZONE '2020-07-05T13:40:20Z'); 178 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Ana', 45, TIMESTAMP WITH TIME ZONE '2020-05-07T03:56:32Z'); 179 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Filipe', 43, TIMESTAMP WITH TIME ZONE '2020-06-10T17:39:52Z'); 180 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tulio', 21, TIMESTAMP WITH TIME ZONE '2020-05-22T23:35:31Z'); 181 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Monica', 42, TIMESTAMP WITH TIME ZONE '2020-06-03T22:37:55Z'); 182 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Erico', 24, TIMESTAMP WITH TIME ZONE '2020-07-17T11:50:22Z'); 183 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Meire', 30, TIMESTAMP WITH TIME ZONE '2020-05-15T03:22:50Z'); 184 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Francisco', 20, TIMESTAMP WITH TIME ZONE '2020-07-09T13:22:12Z'); 185 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Silas', 19, TIMESTAMP WITH TIME ZONE '2020-05-17T08:03:08Z'); 186 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Bob', 22, TIMESTAMP WITH TIME ZONE '2020-07-13T09:04:01Z'); 187 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Tulio', 19, TIMESTAMP WITH TIME ZONE '2020-05-28T12:00:37Z'); 188 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Rita', 24, TIMESTAMP WITH TIME ZONE '2020-05-11T02:15:40Z'); 189 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 20, TIMESTAMP WITH TIME ZONE '2020-05-01T22:43:35Z'); 190 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Carolina', 18, TIMESTAMP WITH TIME ZONE '2020-06-22T02:48:39Z'); 191 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tony', 28, TIMESTAMP WITH TIME ZONE '2020-06-09T21:45:20Z'); 192 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Maria', 33, TIMESTAMP WITH TIME ZONE '2020-05-30T05:59:56Z'); 193 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Ana', 42, TIMESTAMP WITH TIME ZONE '2020-07-06T22:57:28Z'); 194 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Monica', 24, TIMESTAMP WITH TIME ZONE '2020-07-16T19:28:31Z'); 195 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Bob', 22, TIMESTAMP WITH TIME ZONE '2020-05-28T04:33:37Z'); 196 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Alex', 18, TIMESTAMP WITH TIME ZONE '2020-06-01T19:10:08Z'); 197 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Marina', 27, TIMESTAMP WITH TIME ZONE '2020-06-20T07:05:43Z'); 198 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Tiago', 36, TIMESTAMP WITH TIME ZONE '2020-05-17T12:10:00Z'); 199 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Manasses', 40, TIMESTAMP WITH TIME ZONE '2020-06-05T22:23:12Z'); 200 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tulio', 43, TIMESTAMP WITH TIME ZONE '2020-05-20T11:40:56Z'); 201 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Marcela', 19, TIMESTAMP WITH TIME ZONE '2020-07-18T16:48:43Z'); 202 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Tony', 27, TIMESTAMP WITH TIME ZONE '2020-07-13T13:08:47Z'); 203 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Monica', 47, TIMESTAMP WITH TIME ZONE '2020-07-18T15:02:10Z'); 204 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Tony', 35, TIMESTAMP WITH TIME ZONE '2020-05-31T04:52:18Z'); 205 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Manasses', 44, TIMESTAMP WITH TIME ZONE '2020-07-24T10:46:01Z'); 206 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Marcela', 42, TIMESTAMP WITH TIME ZONE '2020-07-23T20:08:36Z'); 207 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Meire', 23, TIMESTAMP WITH TIME ZONE '2020-06-06T15:39:10Z'); 208 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Marina', 26, TIMESTAMP WITH TIME ZONE '2020-05-25T12:29:17Z'); 209 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Maria', 25, TIMESTAMP WITH TIME ZONE '2020-05-08T20:34:49Z'); 210 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Francisco', 41, TIMESTAMP WITH TIME ZONE '2020-06-24T07:41:40Z'); 211 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Jessica', 18, TIMESTAMP WITH TIME ZONE '2020-06-04T10:33:15Z'); 212 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marina', 39, TIMESTAMP WITH TIME ZONE '2020-06-05T08:07:52Z'); 213 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Meire', 34, TIMESTAMP WITH TIME ZONE '2020-05-26T18:01:20Z'); 214 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Cesar', 40, TIMESTAMP WITH TIME ZONE '2020-05-02T09:57:52Z'); 215 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Silas', 34, TIMESTAMP WITH TIME ZONE '2020-07-20T19:47:59Z'); 216 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 32, TIMESTAMP WITH TIME ZONE '2020-07-11T18:00:15Z'); 217 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Marcela', 24, TIMESTAMP WITH TIME ZONE '2020-05-08T20:15:34Z'); 218 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Carlos', 32, TIMESTAMP WITH TIME ZONE '2020-07-17T04:35:32Z'); 219 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Filipe', 38, TIMESTAMP WITH TIME ZONE '2020-05-20T04:20:48Z'); 220 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tulio', 27, TIMESTAMP WITH TIME ZONE '2020-07-29T22:41:07Z'); 221 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Alex', 27, TIMESTAMP WITH TIME ZONE '2020-06-14T21:05:20Z'); 222 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 24, TIMESTAMP WITH TIME ZONE '2020-05-06T21:06:39Z'); 223 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Erico', 36, TIMESTAMP WITH TIME ZONE '2020-06-01T14:24:21Z'); 224 | -------------------------------------------------------------------------------- /backend/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /backend/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /backend/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.3.3.RELEASE 10 | 11 | 12 | com.webvision 13 | dspesquisa 14 | 0.0.1-SNAPSHOT 15 | dspesquisa 16 | Projedo da Semana Devsuperior 1.0 17 | 18 | 19 | 11 20 | 21 | 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-web 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-test 31 | test 32 | 33 | 34 | org.junit.vintage 35 | junit-vintage-engine 36 | 37 | 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-starter-data-jpa 42 | 43 | 44 | com.h2database 45 | h2 46 | runtime 47 | 48 | 49 | org.postgresql 50 | postgresql 51 | runtime 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-starter-validation 56 | 57 | 58 | org.springframework.boot 59 | spring-boot-starter-security 60 | 61 | 62 | 63 | 64 | 65 | 66 | org.springframework.boot 67 | spring-boot-maven-plugin 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/DspesquisaApplication.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DspesquisaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DspesquisaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/config/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.config; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.core.env.Environment; 9 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 10 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 11 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 12 | import org.springframework.security.config.http.SessionCreationPolicy; 13 | import org.springframework.web.cors.CorsConfiguration; 14 | import org.springframework.web.cors.CorsConfigurationSource; 15 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 16 | 17 | @Configuration 18 | @EnableWebSecurity 19 | public class SecurityConfig extends WebSecurityConfigurerAdapter { 20 | 21 | @Autowired 22 | private Environment env; 23 | 24 | private static final String[] PUBLIC_MATCHERS = { "/**" }; 25 | 26 | @Override 27 | protected void configure(HttpSecurity http) throws Exception { 28 | 29 | // H2 30 | if (Arrays.asList(env.getActiveProfiles()).contains("test")) { 31 | http.headers().frameOptions().disable(); 32 | } 33 | 34 | http.cors().and().csrf().disable(); 35 | http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); 36 | http.authorizeRequests().antMatchers(PUBLIC_MATCHERS).permitAll(); 37 | } 38 | 39 | @Bean 40 | CorsConfigurationSource corsConfigurationSource() { 41 | CorsConfiguration configuration = new CorsConfiguration().applyPermitDefaultValues(); 42 | configuration.setAllowedMethods(Arrays.asList("POST", "GET", "PUT", "DELETE", "OPTIONS")); 43 | final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 44 | source.registerCorsConfiguration("/**", configuration); 45 | return source; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/dto/GameDTO.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.dto; 2 | 3 | import com.webvision.dspesquisa.entities.Game; 4 | import com.webvision.dspesquisa.entities.enums.Platform; 5 | 6 | public class GameDTO { 7 | 8 | private Long id; 9 | private String title; 10 | private Platform platform; 11 | 12 | public GameDTO() { 13 | 14 | } 15 | 16 | public GameDTO(Game entity) { 17 | id = entity.getId(); 18 | title = entity.getTitle(); 19 | platform = entity.getPlatform(); 20 | } 21 | 22 | public Long getId() { 23 | return id; 24 | } 25 | 26 | public void setId(Long id) { 27 | this.id = id; 28 | } 29 | 30 | public String getTitle() { 31 | return title; 32 | } 33 | 34 | public void setTitle(String title) { 35 | this.title = title; 36 | } 37 | 38 | public Platform getPlatform() { 39 | return platform; 40 | } 41 | 42 | public void setPlatform(Platform platform) { 43 | this.platform = platform; 44 | } 45 | 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/dto/RecordDTO.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.dto; 2 | 3 | import java.io.Serializable; 4 | import java.time.Instant; 5 | 6 | import com.webvision.dspesquisa.entities.Record; 7 | import com.webvision.dspesquisa.entities.enums.Platform; 8 | 9 | public class RecordDTO implements Serializable { 10 | private static final long serialVersionUID = 1L; 11 | private Long id; 12 | private Instant moment; 13 | private String name; 14 | private Integer age; 15 | private String gameTitle; 16 | private Platform gamePlatform; 17 | private String genreName; 18 | 19 | public RecordDTO() { 20 | 21 | } 22 | 23 | public RecordDTO(Record entity) { 24 | id = entity.getId(); 25 | moment = entity.getMoment(); 26 | name = entity.getName(); 27 | age = entity.getAge(); 28 | gameTitle = entity.getGame().getTitle(); 29 | gamePlatform = entity.getGame().getPlatform(); 30 | genreName = entity.getGame().getGenre().getName(); 31 | } 32 | 33 | public Long getId() { 34 | return id; 35 | } 36 | 37 | public void setId(Long id) { 38 | this.id = id; 39 | } 40 | 41 | public Instant getMoment() { 42 | return moment; 43 | } 44 | 45 | public void setMoment(Instant moment) { 46 | this.moment = moment; 47 | } 48 | 49 | public String getName() { 50 | return name; 51 | } 52 | 53 | public void setName(String name) { 54 | this.name = name; 55 | } 56 | 57 | public Integer getAge() { 58 | return age; 59 | } 60 | 61 | public void setAge(Integer age) { 62 | this.age = age; 63 | } 64 | 65 | public String getGameTitle() { 66 | return gameTitle; 67 | } 68 | 69 | public void setGameTitle(String gameTitle) { 70 | this.gameTitle = gameTitle; 71 | } 72 | 73 | public Platform getGamePlatform() { 74 | return gamePlatform; 75 | } 76 | 77 | public void setGamePlatform(Platform gamePlatform) { 78 | this.gamePlatform = gamePlatform; 79 | } 80 | 81 | public String getGenreName() { 82 | return genreName; 83 | } 84 | 85 | public void setGenreName(String genreName) { 86 | this.genreName = genreName; 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/dto/RecordInsertDTO.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | public class RecordInsertDTO implements Serializable { 6 | private static final long serialVersionUID = 1L; 7 | 8 | private String name; 9 | private Integer age; 10 | private Long gameId; 11 | 12 | public RecordInsertDTO() { 13 | 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public Integer getAge() { 25 | return age; 26 | } 27 | 28 | public void setAge(Integer age) { 29 | this.age = age; 30 | } 31 | 32 | public Long getGameId() { 33 | return gameId; 34 | } 35 | 36 | public void setGameId(Long gameId) { 37 | this.gameId = gameId; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/entities/Game.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.entities; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.JoinColumn; 12 | import javax.persistence.ManyToOne; 13 | import javax.persistence.OneToMany; 14 | import javax.persistence.Table; 15 | 16 | import com.webvision.dspesquisa.entities.enums.Platform; 17 | 18 | @Entity 19 | @Table(name="tb_game") 20 | public class Game implements Serializable { 21 | private static final long serialVersionUID = 1L; 22 | 23 | @Id 24 | @GeneratedValue(strategy=GenerationType.IDENTITY) 25 | private Long id; 26 | private String title; 27 | private Platform platform; 28 | 29 | 30 | @ManyToOne 31 | @JoinColumn(name="genre_id") 32 | private Genre genre; 33 | 34 | 35 | @OneToMany(mappedBy = "game") 36 | private List records = new ArrayList<>(); 37 | 38 | public Game() { 39 | 40 | } 41 | 42 | public Game(Long id, String title, Platform platform, Genre genre) { 43 | super(); 44 | this.id = id; 45 | this.title = title; 46 | this.platform = platform; 47 | this.genre = genre; 48 | } 49 | 50 | public Long getId() { 51 | return id; 52 | } 53 | 54 | public void setId(Long id) { 55 | this.id = id; 56 | } 57 | 58 | public String getTitle() { 59 | return title; 60 | } 61 | 62 | public void setTitle(String title) { 63 | this.title = title; 64 | } 65 | 66 | public Platform getPlatform() { 67 | return platform; 68 | } 69 | 70 | public void setPlatform(Platform platform) { 71 | this.platform = platform; 72 | } 73 | 74 | public Genre getGenre() { 75 | return genre; 76 | } 77 | 78 | public void setGenre(Genre genre) { 79 | this.genre = genre; 80 | } 81 | 82 | public List getRecords() { 83 | return records; 84 | } 85 | 86 | @Override 87 | public int hashCode() { 88 | final int prime = 31; 89 | int result = 1; 90 | result = prime * result + ((id == null) ? 0 : id.hashCode()); 91 | return result; 92 | } 93 | 94 | @Override 95 | public boolean equals(Object obj) { 96 | if (this == obj) 97 | return true; 98 | if (obj == null) 99 | return false; 100 | if (getClass() != obj.getClass()) 101 | return false; 102 | Game other = (Game) obj; 103 | if (id == null) { 104 | if (other.id != null) 105 | return false; 106 | } else if (!id.equals(other.id)) 107 | return false; 108 | return true; 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/entities/Genre.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.entities; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.OneToMany; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name="tb_genre") 16 | public class Genre implements Serializable { 17 | private static final long serialVersionUID = 1L; 18 | 19 | @Id 20 | @GeneratedValue(strategy=GenerationType.IDENTITY) 21 | private Long id; 22 | private String name; 23 | 24 | @OneToMany(mappedBy = "genre") 25 | private List games = new ArrayList<>(); 26 | 27 | public Genre() { 28 | 29 | } 30 | 31 | public Genre(Long id, String name) { 32 | super(); 33 | this.id = id; 34 | this.name = name; 35 | } 36 | 37 | public Long getId() { 38 | return id; 39 | } 40 | 41 | public void setId(Long id) { 42 | this.id = id; 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public void setName(String name) { 50 | this.name = name; 51 | } 52 | 53 | public List getGames() { 54 | return games; 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | final int prime = 31; 60 | int result = 1; 61 | result = prime * result + ((id == null) ? 0 : id.hashCode()); 62 | return result; 63 | } 64 | 65 | @Override 66 | public boolean equals(Object obj) { 67 | if (this == obj) 68 | return true; 69 | if (obj == null) 70 | return false; 71 | if (getClass() != obj.getClass()) 72 | return false; 73 | Genre other = (Genre) obj; 74 | if (id == null) { 75 | if (other.id != null) 76 | return false; 77 | } else if (!id.equals(other.id)) 78 | return false; 79 | return true; 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/entities/Record.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.entities; 2 | 3 | import java.io.Serializable; 4 | import java.time.Instant; 5 | 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToOne; 12 | import javax.persistence.Table; 13 | 14 | @Entity 15 | @Table(name = "tb_record") 16 | public class Record implements Serializable { 17 | private static final long serialVersionUID = 1L; 18 | 19 | @Id 20 | @GeneratedValue(strategy=GenerationType.IDENTITY) 21 | private Long id; 22 | private String name; 23 | private Integer age; 24 | private Instant moment; 25 | 26 | @ManyToOne 27 | @JoinColumn(name="game_id") 28 | private Game game; 29 | 30 | public Record() { 31 | 32 | } 33 | 34 | public Record(Long id, String name, Integer age, Instant moment, Game game) { 35 | super(); 36 | this.id = id; 37 | this.name = name; 38 | this.age = age; 39 | this.moment = moment; 40 | this.game = game; 41 | } 42 | 43 | public Long getId() { 44 | return id; 45 | } 46 | 47 | public void setId(Long id) { 48 | this.id = id; 49 | } 50 | 51 | public String getName() { 52 | return name; 53 | } 54 | 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | public Integer getAge() { 60 | return age; 61 | } 62 | 63 | public void setAge(Integer age) { 64 | this.age = age; 65 | } 66 | 67 | public Instant getMoment() { 68 | return moment; 69 | } 70 | 71 | public void setMoment(Instant moment) { 72 | this.moment = moment; 73 | } 74 | 75 | public Game getGame() { 76 | return game; 77 | } 78 | 79 | public void setGame(Game game) { 80 | this.game = game; 81 | } 82 | 83 | @Override 84 | public int hashCode() { 85 | final int prime = 31; 86 | int result = 1; 87 | result = prime * result + ((id == null) ? 0 : id.hashCode()); 88 | return result; 89 | } 90 | 91 | @Override 92 | public boolean equals(Object obj) { 93 | if (this == obj) 94 | return true; 95 | if (obj == null) 96 | return false; 97 | if (getClass() != obj.getClass()) 98 | return false; 99 | Record other = (Record) obj; 100 | if (id == null) { 101 | if (other.id != null) 102 | return false; 103 | } else if (!id.equals(other.id)) 104 | return false; 105 | return true; 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/entities/enums/Platform.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.entities.enums; 2 | 3 | 4 | public enum Platform { 5 | PC, PLAYSTATION, XBOX; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/repositories/GameRepository.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.repositories; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.webvision.dspesquisa.entities.Game; 7 | 8 | @Repository 9 | public interface GameRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/repositories/GenreRepository.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.repositories; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.webvision.dspesquisa.entities.Genre; 7 | 8 | @Repository 9 | public interface GenreRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/repositories/RecordRepository.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.repositories; 2 | 3 | import java.time.Instant; 4 | 5 | import org.springframework.data.domain.Page; 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.stereotype.Repository; 10 | 11 | import com.webvision.dspesquisa.entities.Record; 12 | 13 | @Repository 14 | public interface RecordRepository extends JpaRepository { 15 | 16 | @Query("SELECT obj FROM Record obj WHERE " 17 | + "(coalesce(:min, null) IS NULL OR obj.moment >= :min) AND " 18 | + "(coalesce(:max, null) IS NULL OR obj.moment <= :max)") 19 | Page findByMoments(Instant min, Instant max, Pageable pageable); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/resources/GameResource.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.resources; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import com.webvision.dspesquisa.dto.GameDTO; 12 | import com.webvision.dspesquisa.services.GameService; 13 | 14 | @RestController 15 | @RequestMapping(value = "/games") 16 | public class GameResource { 17 | 18 | @Autowired 19 | private GameService service; 20 | 21 | @GetMapping 22 | public ResponseEntity> findAll() { 23 | List list = service.findAll(); 24 | return ResponseEntity.ok().body(list); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/resources/RecordResource.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.resources; 2 | 3 | import java.time.Instant; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.domain.Page; 7 | import org.springframework.data.domain.PageRequest; 8 | import org.springframework.data.domain.Sort.Direction; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.RequestBody; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestParam; 15 | import org.springframework.web.bind.annotation.RestController; 16 | 17 | import com.webvision.dspesquisa.dto.RecordDTO; 18 | import com.webvision.dspesquisa.dto.RecordInsertDTO; 19 | import com.webvision.dspesquisa.services.RecordService; 20 | 21 | @RestController 22 | @RequestMapping(value = "/records") 23 | public class RecordResource { 24 | 25 | @Autowired 26 | private RecordService service; 27 | 28 | @PostMapping 29 | public ResponseEntity insert(@RequestBody RecordInsertDTO dto) { 30 | RecordDTO newDTO = service.insert(dto); 31 | return ResponseEntity.ok().body(newDTO); 32 | } 33 | 34 | @GetMapping 35 | public ResponseEntity> findAll( 36 | @RequestParam(value = "min", defaultValue = "") String min, 37 | @RequestParam(value = "max", defaultValue = "") String max, 38 | @RequestParam(value = "page", defaultValue = "0") Integer page, 39 | @RequestParam(value = "linesPerPage", defaultValue = "0") Integer linesPerPage, 40 | @RequestParam(value = "orderBy", defaultValue = "moment") String orderBy, 41 | @RequestParam(value = "direction", defaultValue = "DESC") String direction) { 42 | 43 | Instant minDate = ("".equals(min)) ? null : Instant.parse(min); 44 | Instant maxDate = ("".equals(max)) ? null : Instant.parse(max); 45 | 46 | if (linesPerPage == 0) { 47 | linesPerPage = Integer.MAX_VALUE; 48 | } 49 | 50 | PageRequest pageRequest = PageRequest.of(page, linesPerPage, Direction.valueOf(direction), orderBy); 51 | 52 | Page list = service.findByMoment(minDate, maxDate, pageRequest); 53 | return ResponseEntity.ok().body(list); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/services/GameService.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.services; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.webvision.dspesquisa.dto.GameDTO; 11 | import com.webvision.dspesquisa.entities.Game; 12 | import com.webvision.dspesquisa.repositories.GameRepository; 13 | 14 | @Service 15 | public class GameService { 16 | 17 | @Autowired 18 | private GameRepository repository; 19 | 20 | @Transactional(readOnly = true) 21 | public List findAll() { 22 | List list = repository.findAll(); 23 | return list.stream().map(x -> new GameDTO(x)).collect(Collectors.toList()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/com/webvision/dspesquisa/services/RecordService.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa.services; 2 | 3 | import java.time.Instant; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.domain.Page; 7 | import org.springframework.data.domain.PageRequest; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.webvision.dspesquisa.dto.RecordDTO; 12 | import com.webvision.dspesquisa.dto.RecordInsertDTO; 13 | import com.webvision.dspesquisa.entities.Game; 14 | import com.webvision.dspesquisa.entities.Record; 15 | import com.webvision.dspesquisa.repositories.GameRepository; 16 | import com.webvision.dspesquisa.repositories.RecordRepository; 17 | 18 | @Service 19 | public class RecordService { 20 | 21 | @Autowired 22 | private RecordRepository repository; 23 | 24 | @Autowired 25 | private GameRepository gameRepository; 26 | 27 | @Transactional 28 | public RecordDTO insert(RecordInsertDTO dto ) { 29 | Record entity = new Record(); 30 | entity.setName(dto.getName()); 31 | entity.setAge(dto.getAge()); 32 | entity.setMoment(Instant.now()); 33 | 34 | Game game = gameRepository.getOne(dto.getGameId()); 35 | entity.setGame(game); 36 | 37 | entity = repository.save(entity); 38 | return new RecordDTO(entity); 39 | } 40 | 41 | @Transactional(readOnly = true) 42 | public Page findByMoment(Instant minDate, Instant maxDate, PageRequest pageRequest) { 43 | return repository.findByMoments(minDate, maxDate, pageRequest).map(x -> new RecordDTO(x)); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /backend/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.properties.javax.persistence.schema-generation.create-source=metadata 2 | spring.jpa.properties.javax.persistence.schema-generation.scripts.action=create 3 | spring.jpa.properties.javax.persistence.schema-generation.scripts.create-target=create.sql 4 | spring.jpa.properties.hibernate.hbm2ddl.delimiter=; 5 | 6 | spring.datasource.url=jdbc:postgresql://localhost:5432/dspesquisa 7 | spring.datasource.username=postgres 8 | spring.datasource.password=1234567 9 | 10 | spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true 11 | spring.jpa.hibernate.ddl-auto=none -------------------------------------------------------------------------------- /backend/src/main/resources/application-prod.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=${DATABASE_URL} 2 | 3 | spring.jpa.hibernate.ddl-auto=none 4 | spring.jpa.show-sql=false 5 | spring.jpa.properties.hibernate.format_sql=false -------------------------------------------------------------------------------- /backend/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:testdb 2 | spring.datasource.username=sa 3 | spring.datasource.password= 4 | 5 | spring.h2.console.enabled=true 6 | spring.h2.console.path=/h2-console -------------------------------------------------------------------------------- /backend/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=test 2 | 3 | spring.jpa.open-in-view=false 4 | 5 | -------------------------------------------------------------------------------- /backend/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO tb_genre (name) VALUES ('Shooter'); 2 | INSERT INTO tb_genre (name) VALUES ('MOBA'); 3 | INSERT INTO tb_genre (name) VALUES ('RPG'); 4 | INSERT INTO tb_genre (name) VALUES ('Battle Royale'); 5 | 6 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('The Witcher 3', 2, 3); 7 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('League of Legends', 0, 2); 8 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('CS GO', 0, 1); 9 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Cyberpunk 2077', 0, 3); 10 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Cyberpunk 2077', 2, 3); 11 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('God of War', 0, 3); 12 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('God of War', 1, 3); 13 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Overwatch', 0, 1); 14 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Valorant', 0, 1); 15 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Fall Guys', 0, 4); 16 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Fall Guys', 1, 4); 17 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Fortnite', 0, 4); 18 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Dragon Age Inquisition', 2, 3); 19 | INSERT INTO tb_game (title, platform, genre_id) VALUES ('Dragon Age Inquisition', 1, 3); 20 | 21 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tulio', 44, TIMESTAMP WITH TIME ZONE '2020-07-21T20:59:19Z'); 22 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Alex', 33, TIMESTAMP WITH TIME ZONE '2020-06-20T20:30:26Z'); 23 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcos', 45, TIMESTAMP WITH TIME ZONE '2020-06-15T15:01:37Z'); 24 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Tony', 32, TIMESTAMP WITH TIME ZONE '2020-05-22T19:05:38Z'); 25 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Meire', 24, TIMESTAMP WITH TIME ZONE '2020-07-11T11:31:03Z'); 26 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Maria', 31, TIMESTAMP WITH TIME ZONE '2020-07-11T00:36:59Z'); 27 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Alex', 39, TIMESTAMP WITH TIME ZONE '2020-06-14T03:33:16Z'); 28 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Aline', 42, TIMESTAMP WITH TIME ZONE '2020-05-20T09:27:22Z'); 29 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Filipe', 27, TIMESTAMP WITH TIME ZONE '2020-06-25T06:44:58Z'); 30 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Tulio', 45, TIMESTAMP WITH TIME ZONE '2020-05-29T15:26:15Z'); 31 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Filipe', 39, TIMESTAMP WITH TIME ZONE '2020-05-04T21:41:42Z'); 32 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Tulio', 42, TIMESTAMP WITH TIME ZONE '2020-05-30T12:35:32Z'); 33 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Silas', 32, TIMESTAMP WITH TIME ZONE '2020-05-14T23:27:26Z'); 34 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Alex', 44, TIMESTAMP WITH TIME ZONE '2020-07-18T01:20:44Z'); 35 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Carlos', 42, TIMESTAMP WITH TIME ZONE '2020-05-31T02:43:24Z'); 36 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tito', 26, TIMESTAMP WITH TIME ZONE '2020-06-05T16:59:51Z'); 37 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Erico', 34, TIMESTAMP WITH TIME ZONE '2020-07-23T14:22:42Z'); 38 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marina', 39, TIMESTAMP WITH TIME ZONE '2020-07-23T14:02:26Z'); 39 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Erico', 45, TIMESTAMP WITH TIME ZONE '2020-07-24T03:59:40Z'); 40 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Maria', 39, TIMESTAMP WITH TIME ZONE '2020-06-26T10:37:29Z'); 41 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Marcela', 20, TIMESTAMP WITH TIME ZONE '2020-06-19T19:02:59Z'); 42 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Marcos', 41, TIMESTAMP WITH TIME ZONE '2020-06-22T00:12:31Z'); 43 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Francisco', 29, TIMESTAMP WITH TIME ZONE '2020-07-01T09:59:35Z'); 44 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Manasses', 20, TIMESTAMP WITH TIME ZONE '2020-06-24T12:09:54Z'); 45 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Bob', 21, TIMESTAMP WITH TIME ZONE '2020-07-05T15:09:38Z'); 46 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Tony', 22, TIMESTAMP WITH TIME ZONE '2020-06-20T15:29:45Z'); 47 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Ana', 33, TIMESTAMP WITH TIME ZONE '2020-06-08T03:26:33Z'); 48 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcos', 40, TIMESTAMP WITH TIME ZONE '2020-06-16T18:18:31Z'); 49 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Jessica', 46, TIMESTAMP WITH TIME ZONE '2020-06-22T14:39:55Z'); 50 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Tulio', 22, TIMESTAMP WITH TIME ZONE '2020-07-22T16:49:11Z'); 51 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Erico', 25, TIMESTAMP WITH TIME ZONE '2020-06-06T06:48:33Z'); 52 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Meire', 31, TIMESTAMP WITH TIME ZONE '2020-07-12T04:16:15Z'); 53 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Cesar', 26, TIMESTAMP WITH TIME ZONE '2020-05-20T07:15:10Z'); 54 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Carolina', 21, TIMESTAMP WITH TIME ZONE '2020-06-19T11:33:35Z'); 55 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Marcos', 40, TIMESTAMP WITH TIME ZONE '2020-07-14T12:27:11Z'); 56 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Marcela', 23, TIMESTAMP WITH TIME ZONE '2020-06-27T21:40:33Z'); 57 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Rita', 33, TIMESTAMP WITH TIME ZONE '2020-06-23T09:09:14Z'); 58 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Alex', 18, TIMESTAMP WITH TIME ZONE '2020-07-10T13:58:32Z'); 59 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Jessica', 28, TIMESTAMP WITH TIME ZONE '2020-07-30T00:40:16Z'); 60 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcela', 22, TIMESTAMP WITH TIME ZONE '2020-06-21T15:17:07Z'); 61 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Maria', 45, TIMESTAMP WITH TIME ZONE '2020-06-11T17:36:44Z'); 62 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Marcos', 46, TIMESTAMP WITH TIME ZONE '2020-06-30T00:25:28Z'); 63 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Maria', 18, TIMESTAMP WITH TIME ZONE '2020-05-05T16:44:51Z'); 64 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Francisco', 45, TIMESTAMP WITH TIME ZONE '2020-06-19T02:24:11Z'); 65 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Manasses', 42, TIMESTAMP WITH TIME ZONE '2020-05-18T23:54:59Z'); 66 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Tulio', 30, TIMESTAMP WITH TIME ZONE '2020-07-23T00:20:54Z'); 67 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Bob', 40, TIMESTAMP WITH TIME ZONE '2020-05-22T17:13:10Z'); 68 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Jessica', 24, TIMESTAMP WITH TIME ZONE '2020-07-04T10:35:28Z'); 69 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tony', 27, TIMESTAMP WITH TIME ZONE '2020-06-08T16:45:34Z'); 70 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Manasses', 34, TIMESTAMP WITH TIME ZONE '2020-07-10T19:26:49Z'); 71 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Francisco', 38, TIMESTAMP WITH TIME ZONE '2020-07-21T23:54:48Z'); 72 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Maria', 32, TIMESTAMP WITH TIME ZONE '2020-06-24T11:04:57Z'); 73 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Maria', 37, TIMESTAMP WITH TIME ZONE '2020-05-28T04:51:07Z'); 74 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Marina', 37, TIMESTAMP WITH TIME ZONE '2020-06-13T10:20:06Z'); 75 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Marina', 27, TIMESTAMP WITH TIME ZONE '2020-07-05T09:10:16Z'); 76 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tulio', 28, TIMESTAMP WITH TIME ZONE '2020-05-05T09:01:48Z'); 77 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Manasses', 43, TIMESTAMP WITH TIME ZONE '2020-05-27T14:42:01Z'); 78 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Tito', 23, TIMESTAMP WITH TIME ZONE '2020-06-16T07:22:12Z'); 79 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Bob', 46, TIMESTAMP WITH TIME ZONE '2020-06-04T12:43:47Z'); 80 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Manasses', 43, TIMESTAMP WITH TIME ZONE '2020-05-29T00:39:12Z'); 81 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Marcos', 30, TIMESTAMP WITH TIME ZONE '2020-05-07T18:58:45Z'); 82 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Marcos', 26, TIMESTAMP WITH TIME ZONE '2020-05-20T15:12:10Z'); 83 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Jessica', 35, TIMESTAMP WITH TIME ZONE '2020-06-23T00:38:49Z'); 84 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marcela', 23, TIMESTAMP WITH TIME ZONE '2020-05-01T05:40:58Z'); 85 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tulio', 37, TIMESTAMP WITH TIME ZONE '2020-06-26T00:51:12Z'); 86 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Tony', 37, TIMESTAMP WITH TIME ZONE '2020-07-28T05:46:23Z'); 87 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Monica', 35, TIMESTAMP WITH TIME ZONE '2020-06-28T10:49:12Z'); 88 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Ana', 20, TIMESTAMP WITH TIME ZONE '2020-05-25T11:29:38Z'); 89 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Bob', 37, TIMESTAMP WITH TIME ZONE '2020-06-05T05:03:03Z'); 90 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Erico', 43, TIMESTAMP WITH TIME ZONE '2020-05-21T03:30:32Z'); 91 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Maria', 20, TIMESTAMP WITH TIME ZONE '2020-07-23T16:49:02Z'); 92 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Tony', 18, TIMESTAMP WITH TIME ZONE '2020-05-15T02:24:46Z'); 93 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Filipe', 24, TIMESTAMP WITH TIME ZONE '2020-05-14T08:26:00Z'); 94 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Marcela', 27, TIMESTAMP WITH TIME ZONE '2020-07-25T13:11:09Z'); 95 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Monica', 39, TIMESTAMP WITH TIME ZONE '2020-06-03T04:28:58Z'); 96 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Monica', 34, TIMESTAMP WITH TIME ZONE '2020-07-12T20:12:21Z'); 97 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Meire', 39, TIMESTAMP WITH TIME ZONE '2020-05-12T14:57:23Z'); 98 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marina', 25, TIMESTAMP WITH TIME ZONE '2020-06-23T12:17:23Z'); 99 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tito', 20, TIMESTAMP WITH TIME ZONE '2020-05-20T15:24:43Z'); 100 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Ana', 36, TIMESTAMP WITH TIME ZONE '2020-07-01T16:51:09Z'); 101 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Jessica', 25, TIMESTAMP WITH TIME ZONE '2020-06-03T13:08:05Z'); 102 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 41, TIMESTAMP WITH TIME ZONE '2020-06-12T23:50:42Z'); 103 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Maria', 35, TIMESTAMP WITH TIME ZONE '2020-05-23T15:33:18Z'); 104 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Cesar', 25, TIMESTAMP WITH TIME ZONE '2020-07-02T19:06:52Z'); 105 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Bob', 38, TIMESTAMP WITH TIME ZONE '2020-06-26T13:49:49Z'); 106 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Alex', 30, TIMESTAMP WITH TIME ZONE '2020-05-26T00:13:35Z'); 107 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Cesar', 30, TIMESTAMP WITH TIME ZONE '2020-05-04T22:08:03Z'); 108 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Tulio', 46, TIMESTAMP WITH TIME ZONE '2020-07-21T08:58:17Z'); 109 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Cesar', 44, TIMESTAMP WITH TIME ZONE '2020-06-02T20:51:22Z'); 110 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Marcela', 27, TIMESTAMP WITH TIME ZONE '2020-07-13T23:17:38Z'); 111 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Bob', 39, TIMESTAMP WITH TIME ZONE '2020-06-28T19:16:40Z'); 112 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Erico', 40, TIMESTAMP WITH TIME ZONE '2020-07-29T02:41:47Z'); 113 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Marcos', 47, TIMESTAMP WITH TIME ZONE '2020-07-15T23:10:50Z'); 114 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Tito', 41, TIMESTAMP WITH TIME ZONE '2020-06-27T20:03:12Z'); 115 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Francisco', 41, TIMESTAMP WITH TIME ZONE '2020-06-27T22:24:43Z'); 116 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Tony', 21, TIMESTAMP WITH TIME ZONE '2020-05-11T19:08:56Z'); 117 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Erico', 32, TIMESTAMP WITH TIME ZONE '2020-07-17T12:50:52Z'); 118 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Filipe', 22, TIMESTAMP WITH TIME ZONE '2020-07-07T18:33:37Z'); 119 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Tiago', 39, TIMESTAMP WITH TIME ZONE '2020-07-06T22:15:07Z'); 120 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Filipe', 32, TIMESTAMP WITH TIME ZONE '2020-06-06T17:40:06Z'); 121 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Carolina', 20, TIMESTAMP WITH TIME ZONE '2020-07-11T18:25:34Z'); 122 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Manasses', 45, TIMESTAMP WITH TIME ZONE '2020-06-25T10:03:38Z'); 123 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Maria', 31, TIMESTAMP WITH TIME ZONE '2020-06-24T19:13:42Z'); 124 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marcela', 41, TIMESTAMP WITH TIME ZONE '2020-07-14T11:35:40Z'); 125 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Marina', 27, TIMESTAMP WITH TIME ZONE '2020-07-08T11:32:31Z'); 126 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Carolina', 39, TIMESTAMP WITH TIME ZONE '2020-07-07T06:17:55Z'); 127 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Alex', 29, TIMESTAMP WITH TIME ZONE '2020-05-07T16:55:40Z'); 128 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Meire', 26, TIMESTAMP WITH TIME ZONE '2020-06-21T22:35:13Z'); 129 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Silas', 28, TIMESTAMP WITH TIME ZONE '2020-06-21T07:55:41Z'); 130 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Meire', 27, TIMESTAMP WITH TIME ZONE '2020-06-29T12:36:02Z'); 131 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Cesar', 19, TIMESTAMP WITH TIME ZONE '2020-06-05T23:35:06Z'); 132 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Meire', 21, TIMESTAMP WITH TIME ZONE '2020-06-13T00:16:11Z'); 133 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Carolina', 35, TIMESTAMP WITH TIME ZONE '2020-06-21T20:27:18Z'); 134 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Marcos', 33, TIMESTAMP WITH TIME ZONE '2020-06-10T09:41:17Z'); 135 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Francisco', 22, TIMESTAMP WITH TIME ZONE '2020-07-17T21:53:18Z'); 136 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Francisco', 45, TIMESTAMP WITH TIME ZONE '2020-05-09T16:31:29Z'); 137 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Tito', 29, TIMESTAMP WITH TIME ZONE '2020-07-19T19:39:54Z'); 138 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tiago', 37, TIMESTAMP WITH TIME ZONE '2020-05-05T16:23:54Z'); 139 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Tulio', 35, TIMESTAMP WITH TIME ZONE '2020-06-03T06:06:01Z'); 140 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Meire', 25, TIMESTAMP WITH TIME ZONE '2020-07-19T02:02:32Z'); 141 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Francisco', 44, TIMESTAMP WITH TIME ZONE '2020-07-24T03:32:22Z'); 142 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Francisco', 23, TIMESTAMP WITH TIME ZONE '2020-05-18T16:45:37Z'); 143 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Ana', 26, TIMESTAMP WITH TIME ZONE '2020-07-07T22:11:51Z'); 144 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Aline', 30, TIMESTAMP WITH TIME ZONE '2020-07-25T12:18:48Z'); 145 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Erico', 21, TIMESTAMP WITH TIME ZONE '2020-05-23T11:24:09Z'); 146 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Marina', 42, TIMESTAMP WITH TIME ZONE '2020-07-04T10:16:40Z'); 147 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Marina', 32, TIMESTAMP WITH TIME ZONE '2020-06-14T13:25:11Z'); 148 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Carlos', 43, TIMESTAMP WITH TIME ZONE '2020-05-29T19:52:07Z'); 149 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tiago', 34, TIMESTAMP WITH TIME ZONE '2020-07-24T08:36:19Z'); 150 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Aline', 46, TIMESTAMP WITH TIME ZONE '2020-07-20T05:32:53Z'); 151 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Manasses', 18, TIMESTAMP WITH TIME ZONE '2020-06-04T11:43:05Z'); 152 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Rita', 36, TIMESTAMP WITH TIME ZONE '2020-05-08T18:06:04Z'); 153 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Manasses', 22, TIMESTAMP WITH TIME ZONE '2020-07-15T14:19:44Z'); 154 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Tiago', 21, TIMESTAMP WITH TIME ZONE '2020-05-15T16:58:55Z'); 155 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Maria', 26, TIMESTAMP WITH TIME ZONE '2020-06-04T10:20:57Z'); 156 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Marcos', 30, TIMESTAMP WITH TIME ZONE '2020-06-10T06:55:09Z'); 157 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Bob', 45, TIMESTAMP WITH TIME ZONE '2020-07-08T20:00:48Z'); 158 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Marina', 41, TIMESTAMP WITH TIME ZONE '2020-06-16T13:14:52Z'); 159 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Maria', 33, TIMESTAMP WITH TIME ZONE '2020-06-08T13:26:00Z'); 160 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Aline', 41, TIMESTAMP WITH TIME ZONE '2020-05-19T01:56:48Z'); 161 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Maria', 20, TIMESTAMP WITH TIME ZONE '2020-07-28T23:53:21Z'); 162 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Aline', 39, TIMESTAMP WITH TIME ZONE '2020-06-15T23:42:27Z'); 163 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tulio', 26, TIMESTAMP WITH TIME ZONE '2020-06-02T16:05:39Z'); 164 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Rita', 34, TIMESTAMP WITH TIME ZONE '2020-07-30T06:33:00Z'); 165 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Cesar', 41, TIMESTAMP WITH TIME ZONE '2020-07-11T14:05:22Z'); 166 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Carlos', 22, TIMESTAMP WITH TIME ZONE '2020-05-29T01:54:35Z'); 167 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Carlos', 27, TIMESTAMP WITH TIME ZONE '2020-06-10T19:30:33Z'); 168 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tulio', 32, TIMESTAMP WITH TIME ZONE '2020-07-02T22:32:56Z'); 169 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Silas', 43, TIMESTAMP WITH TIME ZONE '2020-07-10T11:30:09Z'); 170 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Meire', 24, TIMESTAMP WITH TIME ZONE '2020-06-21T08:29:45Z'); 171 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Meire', 28, TIMESTAMP WITH TIME ZONE '2020-06-30T10:27:21Z'); 172 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Tony', 29, TIMESTAMP WITH TIME ZONE '2020-07-06T10:09:46Z'); 173 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Maria', 24, TIMESTAMP WITH TIME ZONE '2020-06-17T04:34:20Z'); 174 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Carlos', 46, TIMESTAMP WITH TIME ZONE '2020-07-05T13:40:20Z'); 175 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Ana', 45, TIMESTAMP WITH TIME ZONE '2020-05-07T03:56:32Z'); 176 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Filipe', 43, TIMESTAMP WITH TIME ZONE '2020-06-10T17:39:52Z'); 177 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tulio', 21, TIMESTAMP WITH TIME ZONE '2020-05-22T23:35:31Z'); 178 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Monica', 42, TIMESTAMP WITH TIME ZONE '2020-06-03T22:37:55Z'); 179 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Erico', 24, TIMESTAMP WITH TIME ZONE '2020-07-17T11:50:22Z'); 180 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Meire', 30, TIMESTAMP WITH TIME ZONE '2020-05-15T03:22:50Z'); 181 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Francisco', 20, TIMESTAMP WITH TIME ZONE '2020-07-09T13:22:12Z'); 182 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Silas', 19, TIMESTAMP WITH TIME ZONE '2020-05-17T08:03:08Z'); 183 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Bob', 22, TIMESTAMP WITH TIME ZONE '2020-07-13T09:04:01Z'); 184 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Tulio', 19, TIMESTAMP WITH TIME ZONE '2020-05-28T12:00:37Z'); 185 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Rita', 24, TIMESTAMP WITH TIME ZONE '2020-05-11T02:15:40Z'); 186 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 20, TIMESTAMP WITH TIME ZONE '2020-05-01T22:43:35Z'); 187 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Carolina', 18, TIMESTAMP WITH TIME ZONE '2020-06-22T02:48:39Z'); 188 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Tony', 28, TIMESTAMP WITH TIME ZONE '2020-06-09T21:45:20Z'); 189 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Maria', 33, TIMESTAMP WITH TIME ZONE '2020-05-30T05:59:56Z'); 190 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (9, 'Ana', 42, TIMESTAMP WITH TIME ZONE '2020-07-06T22:57:28Z'); 191 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Monica', 24, TIMESTAMP WITH TIME ZONE '2020-07-16T19:28:31Z'); 192 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Bob', 22, TIMESTAMP WITH TIME ZONE '2020-05-28T04:33:37Z'); 193 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Alex', 18, TIMESTAMP WITH TIME ZONE '2020-06-01T19:10:08Z'); 194 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (4, 'Marina', 27, TIMESTAMP WITH TIME ZONE '2020-06-20T07:05:43Z'); 195 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (8, 'Tiago', 36, TIMESTAMP WITH TIME ZONE '2020-05-17T12:10:00Z'); 196 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (2, 'Manasses', 40, TIMESTAMP WITH TIME ZONE '2020-06-05T22:23:12Z'); 197 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Tulio', 43, TIMESTAMP WITH TIME ZONE '2020-05-20T11:40:56Z'); 198 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Marcela', 19, TIMESTAMP WITH TIME ZONE '2020-07-18T16:48:43Z'); 199 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Tony', 27, TIMESTAMP WITH TIME ZONE '2020-07-13T13:08:47Z'); 200 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Monica', 47, TIMESTAMP WITH TIME ZONE '2020-07-18T15:02:10Z'); 201 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Tony', 35, TIMESTAMP WITH TIME ZONE '2020-05-31T04:52:18Z'); 202 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (13, 'Manasses', 44, TIMESTAMP WITH TIME ZONE '2020-07-24T10:46:01Z'); 203 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Marcela', 42, TIMESTAMP WITH TIME ZONE '2020-07-23T20:08:36Z'); 204 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Meire', 23, TIMESTAMP WITH TIME ZONE '2020-06-06T15:39:10Z'); 205 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Marina', 26, TIMESTAMP WITH TIME ZONE '2020-05-25T12:29:17Z'); 206 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Maria', 25, TIMESTAMP WITH TIME ZONE '2020-05-08T20:34:49Z'); 207 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Francisco', 41, TIMESTAMP WITH TIME ZONE '2020-06-24T07:41:40Z'); 208 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Jessica', 18, TIMESTAMP WITH TIME ZONE '2020-06-04T10:33:15Z'); 209 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Marina', 39, TIMESTAMP WITH TIME ZONE '2020-06-05T08:07:52Z'); 210 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (6, 'Meire', 34, TIMESTAMP WITH TIME ZONE '2020-05-26T18:01:20Z'); 211 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (7, 'Cesar', 40, TIMESTAMP WITH TIME ZONE '2020-05-02T09:57:52Z'); 212 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (11, 'Silas', 34, TIMESTAMP WITH TIME ZONE '2020-07-20T19:47:59Z'); 213 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 32, TIMESTAMP WITH TIME ZONE '2020-07-11T18:00:15Z'); 214 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (14, 'Marcela', 24, TIMESTAMP WITH TIME ZONE '2020-05-08T20:15:34Z'); 215 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (5, 'Carlos', 32, TIMESTAMP WITH TIME ZONE '2020-07-17T04:35:32Z'); 216 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (10, 'Filipe', 38, TIMESTAMP WITH TIME ZONE '2020-05-20T04:20:48Z'); 217 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Tulio', 27, TIMESTAMP WITH TIME ZONE '2020-07-29T22:41:07Z'); 218 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (12, 'Alex', 27, TIMESTAMP WITH TIME ZONE '2020-06-14T21:05:20Z'); 219 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (1, 'Aline', 24, TIMESTAMP WITH TIME ZONE '2020-05-06T21:06:39Z'); 220 | INSERT INTO tb_record (game_id, name, age, moment) VALUES (3, 'Erico', 36, TIMESTAMP WITH TIME ZONE '2020-06-01T14:24:21Z'); -------------------------------------------------------------------------------- /backend/src/test/java/com/webvision/dspesquisa/DspesquisaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.webvision.dspesquisa; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | 7 | @SpringBootTest 8 | class DspesquisaApplicationTests { 9 | 10 | @Test 11 | void contextLoads() { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /backend/system.properties: -------------------------------------------------------------------------------- 1 | java.runtime.version=11 -------------------------------------------------------------------------------- /front-mobile/.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 4 | } 5 | -------------------------------------------------------------------------------- /front-mobile/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | *.jks 5 | *.p8 6 | *.p12 7 | *.key 8 | *.mobileprovision 9 | *.orig.* 10 | web-build/ 11 | 12 | # macOS 13 | .DS_Store 14 | -------------------------------------------------------------------------------- /front-mobile/App.tsx: -------------------------------------------------------------------------------- 1 | import { StatusBar } from 'expo-status-bar'; 2 | import React from 'react'; 3 | import { StyleSheet, Text, View } from 'react-native'; 4 | import {AppLoading} from 'expo'; 5 | import { 6 | useFonts, 7 | Play_400Regular, 8 | Play_700Bold 9 | } from '@expo-google-fonts/play'; 10 | 11 | 12 | import Routes from './src/routes'; 13 | 14 | export default function App() { 15 | const [fontsLoaded] = useFonts({ 16 | Play_400Regular, 17 | Play_700Bold 18 | }); 19 | 20 | if (!fontsLoaded) { 21 | return 22 | } else { 23 | return ( 24 | 25 | 26 | 27 | 28 | ); 29 | } 30 | } 31 | 32 | const styles = StyleSheet.create({ 33 | container: { 34 | flex: 1 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /front-mobile/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "front-mobile", 4 | "slug": "front-mobile", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "splash": { 9 | "image": "./assets/splash.png", 10 | "resizeMode": "contain", 11 | "backgroundColor": "#ffffff" 12 | }, 13 | "updates": { 14 | "fallbackToCacheTimeout": 0 15 | }, 16 | "assetBundlePatterns": [ 17 | "**/*" 18 | ], 19 | "ios": { 20 | "supportsTablet": true 21 | }, 22 | "web": { 23 | "favicon": "./assets/favicon.png" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /front-mobile/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devsuperior/sds1-wmazoni/f6899e37b63de10baac85b97303063efa13721e1/front-mobile/assets/favicon.png -------------------------------------------------------------------------------- /front-mobile/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devsuperior/sds1-wmazoni/f6899e37b63de10baac85b97303063efa13721e1/front-mobile/assets/icon.png -------------------------------------------------------------------------------- /front-mobile/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devsuperior/sds1-wmazoni/f6899e37b63de10baac85b97303063efa13721e1/front-mobile/assets/splash.png -------------------------------------------------------------------------------- /front-mobile/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /front-mobile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "node_modules/expo/AppEntry.js", 3 | "scripts": { 4 | "start": "expo start", 5 | "android": "expo start --android", 6 | "ios": "expo start --ios", 7 | "web": "expo start --web", 8 | "eject": "expo eject" 9 | }, 10 | "dependencies": { 11 | "@expo-google-fonts/play": "^0.1.0", 12 | "@react-native-community/masked-view": "0.1.10", 13 | "@react-navigation/native": "^5.7.3", 14 | "@react-navigation/stack": "^5.9.0", 15 | "axios": "^0.20.0", 16 | "expo": "~38.0.8", 17 | "expo-font": "~8.2.1", 18 | "expo-status-bar": "^1.0.2", 19 | "react": "~16.11.0", 20 | "react-dom": "~16.11.0", 21 | "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz", 22 | "react-native-gesture-handler": "~1.6.0", 23 | "react-native-picker-select": "7.0.0", 24 | "react-native-reanimated": "~1.9.0", 25 | "react-native-safe-area-context": "~3.0.7", 26 | "react-native-screens": "~2.9.0", 27 | "react-native-web": "~0.11.7" 28 | }, 29 | "devDependencies": { 30 | "@babel/core": "^7.8.6", 31 | "@types/react": "~16.9.41", 32 | "@types/react-native": "~0.62.13", 33 | "typescript": "~3.9.5" 34 | }, 35 | "private": true 36 | } 37 | -------------------------------------------------------------------------------- /front-mobile/src/assets/gamer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devsuperior/sds1-wmazoni/f6899e37b63de10baac85b97303063efa13721e1/front-mobile/src/assets/gamer.png -------------------------------------------------------------------------------- /front-mobile/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devsuperior/sds1-wmazoni/f6899e37b63de10baac85b97303063efa13721e1/front-mobile/src/assets/logo.png -------------------------------------------------------------------------------- /front-mobile/src/components/Header/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, StyleSheet, View, Image} from 'react-native'; 3 | import {TouchableWithoutFeedback} from 'react-native-gesture-handler'; 4 | import {useNavigation} from '@react-navigation/native' 5 | 6 | const Header = () => { 7 | const navigation= useNavigation(); 8 | const handleOnPress = () => { 9 | navigation.navigate('Home'); 10 | } 11 | return ( 12 | 13 | 14 | 15 | Big Game 16 | Survey 17 | 18 | 19 | ); 20 | }; 21 | 22 | const styles = StyleSheet.create({ 23 | header: { 24 | paddingTop: 50, 25 | height: 90, 26 | backgroundColor: '#37474F', 27 | flexDirection: 'row', 28 | justifyContent: 'center' 29 | }, 30 | textLogo1: { 31 | fontWeight: 'bold', 32 | fontSize: 18, 33 | fontFamily: "Play_700Bold", 34 | color: '#ED7947', 35 | marginLeft: 10, 36 | marginRight: 5, 37 | }, 38 | textLogo2: { 39 | fontWeight: 'bold', 40 | fontFamily: "Play_700Bold", 41 | fontSize: 18, 42 | color: '#FFF' 43 | }, 44 | tinyLogo: { 45 | width: 25, 46 | height: 25, 47 | }, 48 | }); 49 | 50 | export default Header; -------------------------------------------------------------------------------- /front-mobile/src/pages/CreateRecords/PLatformCard.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {FontAwesome5 as Icon} from '@expo/vector-icons'; 3 | import {Text, StyleSheet} from 'react-native'; 4 | import {GamePLatform} from './types'; 5 | import {RectButton} from 'react-native-gesture-handler'; 6 | 7 | type Props = { 8 | platform: GamePLatform; 9 | onChange: (platform: GamePLatform) => void; 10 | icon: string; 11 | activePlatform?: GamePLatform; 12 | } 13 | 14 | const PlatformCard = ({ 15 | platform, 16 | onChange, 17 | icon, 18 | activePlatform 19 | }: Props) => { 20 | const isActive = platform === activePlatform; 21 | const backgroundColor = isActive ? '#fad7c8' : '#FFF'; 22 | const textColor = isActive ? '#ED7947' : '#9E9E9E'; 23 | 24 | return ( 25 | onChange(platform)} 28 | > 29 | 30 | 31 | {platform === 'PLAYSTATION' ? 'PS' : platform} 32 | 33 | 34 | ) 35 | 36 | } 37 | 38 | const styles = StyleSheet.create({ 39 | platformCard: { 40 | paddingTop: 30, 41 | paddingBottom: 20, 42 | width: '30%', 43 | backgroundColor: '#FFF', 44 | borderRadius: 10, 45 | justifyContent: 'center', 46 | alignItems: 'center' 47 | }, 48 | platformCardText: { 49 | marginTop: 40, 50 | color: '#9E9E9E', 51 | fontSize: 24, 52 | fontFamily: "Play_700Bold", 53 | textAlign: 'center' 54 | }, 55 | }); 56 | 57 | export default PlatformCard; -------------------------------------------------------------------------------- /front-mobile/src/pages/CreateRecords/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import {FontAwesome5 as Icon} from '@expo/vector-icons'; 3 | import {Text, StyleSheet, TextInput, View, Alert} from 'react-native'; 4 | import Header from '../../components/Header'; 5 | import PlatformCard from './PLatformCard'; 6 | import { GamePLatform, Game } from './types'; 7 | import RNPickerSelect from 'react-native-picker-select'; 8 | import axios from 'axios'; 9 | import {RectButton} from 'react-native-gesture-handler'; 10 | 11 | const placeholder = { 12 | label: 'Selecione o game', 13 | value: null 14 | } 15 | const BASE_URL = 'http://192.168.2.107:8080'; 16 | const mapSelectValues = (games: Game[]) => { 17 | return games.map(game => ({ 18 | ...game, 19 | label: game.title, 20 | value: game.id 21 | })); 22 | } 23 | 24 | const CreateRecord = () => { 25 | 26 | const [name, setName] = useState(''); 27 | const [age, setAge] = useState(''); 28 | const [platform, setPlatform] = useState(); 29 | const [selectedGame, setSelectedGame] = useState(''); 30 | const [allGames, setAllGames] = useState([]); 31 | const [filteredGames, setFilteredGames] = useState([]); 32 | const handleChangePlatform = (selectedPlatform: GamePLatform) => { 33 | setPlatform(selectedPlatform); 34 | const gamesByPlatform = allGames.filter( 35 | game => game.platform === selectedPlatform 36 | ) 37 | setFilteredGames(gamesByPlatform); 38 | } 39 | 40 | const handleSubmit = () => { 41 | const payload = {name, age, gameId: selectedGame}; 42 | axios.post(`${BASE_URL}/records`, payload) 43 | .then(() => { 44 | Alert.alert('Dados salvos com sucesso!'); 45 | setName(''); 46 | setAge(''); 47 | setSelectedGame(''); 48 | setPlatform(undefined); 49 | }) 50 | } 51 | 52 | 53 | useEffect(() => { 54 | axios.get(`${BASE_URL}/games`) 55 | .then(response => { 56 | const selectValues = mapSelectValues(response.data); 57 | console.log(selectValues); 58 | setAllGames(selectValues); 59 | }) 60 | }, []) 61 | return ( 62 | <> 63 | 64 | 65 | setName(text)} 70 | value={name} 71 | /> 72 | setAge(text)} 79 | value={age} 80 | /> 81 | 82 | 88 | 94 | 100 | 101 | { 103 | setSelectedGame(value); 104 | }} 105 | placeholder={placeholder} 106 | value={selectedGame} 107 | items={filteredGames} 108 | style={pickerSelectStyles} 109 | Icon={() => { 110 | return 111 | }} 112 | /> 113 | 114 | 115 | 116 | SALVAR 117 | 118 | 119 | 120 | 121 | 122 | > 123 | ); 124 | } 125 | 126 | const pickerSelectStyles = StyleSheet.create({ 127 | inputIOS: { 128 | fontSize: 16, 129 | paddingVertical: 12, 130 | paddingHorizontal: 20, 131 | backgroundColor: '#FFF', 132 | borderRadius: 10, 133 | color: '#ED7947', 134 | paddingRight: 30, 135 | fontFamily: "Play_700Bold", 136 | height: 50 137 | }, 138 | inputAndroid: { 139 | fontSize: 16, 140 | paddingVertical: 12, 141 | paddingHorizontal: 20, 142 | backgroundColor: '#FFF', 143 | borderRadius: 10, 144 | color: '#ED7947', 145 | paddingRight: 30, 146 | fontFamily: "Play_700Bold", 147 | height: 50 148 | }, 149 | placeholder: { 150 | color: '#9E9E9E', 151 | fontSize: 16, 152 | fontFamily: "Play_700Bold", 153 | }, 154 | iconContainer: { 155 | top: 10, 156 | right: 12, 157 | } 158 | }) 159 | 160 | const styles = StyleSheet.create({ 161 | container: { 162 | marginTop: '15%', 163 | paddingRight: '5%', 164 | paddingLeft: '5%', 165 | paddingBottom: 50 166 | }, 167 | inputText: { 168 | height: 50, 169 | backgroundColor: '#FFF', 170 | borderRadius: 10, 171 | color: '#ED7947', 172 | fontFamily: "Play_700Bold", 173 | fontSize: 16, 174 | paddingLeft: 20, 175 | marginBottom: 21 176 | }, 177 | platformContainer: { 178 | marginBottom: 20, 179 | flexDirection: 'row', 180 | justifyContent: 'space-between', 181 | }, 182 | footer: { 183 | marginTop: '15%', 184 | alignItems: 'center', 185 | }, 186 | button: { 187 | backgroundColor: '#00D4FF', 188 | flexDirection: 'row', 189 | borderRadius: 10, 190 | height: 60, 191 | width: '100%', 192 | alignItems: 'center', 193 | justifyContent: 'center' 194 | }, 195 | buttonText: { 196 | fontFamily: "Play_700Bold", 197 | fontWeight: 'bold', 198 | fontSize: 18, 199 | color: '#0B1F34', 200 | } 201 | }); 202 | 203 | export default CreateRecord; -------------------------------------------------------------------------------- /front-mobile/src/pages/CreateRecords/types.ts: -------------------------------------------------------------------------------- 1 | export type GamePLatform = 'XBOX' | 'PC' | 'PLAYSTATION'; 2 | 3 | export type Game = { 4 | id: number, 5 | title: string, 6 | platform: GamePLatform; 7 | label: string; 8 | value: number; 9 | } -------------------------------------------------------------------------------- /front-mobile/src/pages/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Text, StyleSheet, View, Image, Alert} from 'react-native'; 3 | import {FontAwesome5 as Icon} from '@expo/vector-icons'; 4 | import {RectButton} from 'react-native-gesture-handler' 5 | import Header from '../../components/Header' 6 | import {useNavigation} from '@react-navigation/native'; 7 | 8 | const Home = () => { 9 | 10 | const navigation = useNavigation(); 11 | 12 | const handleOnPress = () => { 13 | navigation.navigate('CreateRecord'); 14 | } 15 | 16 | return ( 17 | <> 18 | 19 | 20 | 24 | Vote agora! 25 | Nos diga qual é o seu jogo favorito! 26 | 27 | 28 | 29 | 30 | COLETAR DADOS 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | > 40 | ) 41 | }; 42 | 43 | const styles = StyleSheet.create({ 44 | container: { 45 | marginTop: '15%', 46 | backgroundColor: '#0B1F34', 47 | alignItems: 'center', 48 | }, 49 | gamerImage: { 50 | width: 309, 51 | height: 288 52 | }, 53 | title: { 54 | color: '#00D4FF', 55 | fontSize: 36, 56 | fontWeight: 'bold', 57 | marginTop: 31, 58 | fontFamily: "Play_700Bold", 59 | }, 60 | subTitle: { 61 | color: '#ED7947', 62 | fontSize: 21, 63 | marginTop: 15, 64 | fontFamily: "Play_400Regular", 65 | }, 66 | footer: { 67 | marginTop: '15%', 68 | alignItems: 'center' 69 | }, 70 | button: { 71 | backgroundColor: '#00D4FF', 72 | flexDirection: 'row', 73 | borderRadius: 10 74 | }, 75 | buttonIcon: { 76 | backgroundColor: '#ED7947', 77 | justifyContent: 'center', 78 | alignItems: 'center', 79 | width: 50, 80 | borderBottomRightRadius: 10, 81 | borderTopRightRadius: 10 82 | }, 83 | buttonText: { 84 | paddingTop: 15, 85 | paddingBottom: 15, 86 | paddingLeft: 50, 87 | paddingRight: 50, 88 | fontFamily: "Play_700Bold", 89 | fontWeight: 'bold', 90 | fontSize: 18, 91 | color: '#0B1F34', 92 | } 93 | }); 94 | 95 | export default Home; -------------------------------------------------------------------------------- /front-mobile/src/routes.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {NavigationContainer} from '@react-navigation/native'; 3 | import {createStackNavigator} from '@react-navigation/stack'; 4 | 5 | const Stack = createStackNavigator(); 6 | import Home from './pages/Home'; 7 | import CreateRecord from './pages/CreateRecords'; 8 | 9 | const Routes = () => { 10 | return ( 11 | 12 | 20 | 21 | 22 | 23 | 24 | ) 25 | }; 26 | 27 | export default Routes; -------------------------------------------------------------------------------- /front-mobile/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "jsx": "react-native", 5 | "lib": ["dom", "esnext"], 6 | "moduleResolution": "node", 7 | "noEmit": true, 8 | "skipLibCheck": true, 9 | "resolveJsonModule": true, 10 | "strict": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /front-web/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /front-web/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `yarn start` 8 | 9 | Runs the app in the development mode. 10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits. 13 | You will also see any lint errors in the console. 14 | 15 | ### `yarn test` 16 | 17 | Launches the test runner in the interactive watch mode. 18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `yarn build` 21 | 22 | Builds the app for production to the `build` folder. 23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes. 26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `yarn eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | -------------------------------------------------------------------------------- /front-web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "front-web", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^4.2.4", 7 | "@testing-library/react": "^9.3.2", 8 | "@testing-library/user-event": "^7.1.2", 9 | "@types/jest": "^24.0.0", 10 | "@types/node": "^12.0.0", 11 | "@types/react": "^16.9.0", 12 | "@types/react-dom": "^16.9.0", 13 | "apexcharts": "^3.20.2", 14 | "axios": "^0.20.0", 15 | "moment": "^2.28.0", 16 | "react": "^16.13.1", 17 | "react-apexcharts": "^1.3.7", 18 | "react-dom": "^16.13.1", 19 | "react-router-dom": "^5.2.0", 20 | "react-scripts": "3.4.3", 21 | "typescript": "~3.7.2" 22 | }, 23 | "scripts": { 24 | "start": "react-scripts start", 25 | "build": "react-scripts build", 26 | "test": "react-scripts test", 27 | "eject": "react-scripts eject" 28 | }, 29 | "eslintConfig": { 30 | "extends": "react-app" 31 | }, 32 | "browserslist": { 33 | "production": [ 34 | ">0.2%", 35 | "not dead", 36 | "not op_mini all" 37 | ], 38 | "development": [ 39 | "last 1 chrome version", 40 | "last 1 firefox version", 41 | "last 1 safari version" 42 | ] 43 | }, 44 | "devDependencies": { 45 | "@types/react-router-dom": "^5.1.5" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /front-web/public/_redirects: -------------------------------------------------------------------------------- 1 | /* /index.html 200 -------------------------------------------------------------------------------- /front-web/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | Big Game Survey 12 | 13 | 14 | You need to enable JavaScript to run this app. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /front-web/src/App.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap'); 2 | 3 | :root { 4 | --color-turquoise: #00D4FF; 5 | --color-coral: #ed7947; 6 | --color-dimgray: #4c5d67; 7 | --color-darkslategray: #37474f; 8 | --color-black: #0b1f34; 9 | } 10 | 11 | body, html { 12 | padding: 0; 13 | margin: 0; 14 | } 15 | 16 | * { 17 | font-family: 'Play', sans-serif; 18 | } 19 | 20 | body { 21 | background: var(--color-black); 22 | } 23 | 24 | a { 25 | text-decoration: none; 26 | } 27 | 28 | .text-primary { 29 | color: var(--color-turquoise); 30 | } 31 | 32 | .text-secondary { 33 | color: var(--color-coral); 34 | } 35 | 36 | button { 37 | border: none; 38 | cursor: pointer; 39 | } 40 | 41 | button:focus { 42 | outline: none; 43 | } -------------------------------------------------------------------------------- /front-web/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './App.css'; 3 | import Routes from './Routes'; 4 | 5 | 6 | function App() { 7 | return ( 8 | 9 | ); 10 | } 11 | 12 | export default App; 13 | -------------------------------------------------------------------------------- /front-web/src/Routes.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {BrowserRouter, Route, Switch} from 'react-router-dom'; 3 | import Header from './components/Header/Index'; 4 | import Charts from './pages/Charts'; 5 | import Home from './pages/Home'; 6 | import Records from './pages/Records'; 7 | 8 | const Routes = () => ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | 25 | export default Routes; -------------------------------------------------------------------------------- /front-web/src/assets/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /front-web/src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /front-web/src/components/Filters/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | 4 | type Props = { 5 | link: string; 6 | linkText: string; 7 | } 8 | 9 | const Filters = ({link, linkText}: Props) => ( 10 | 11 | 12 | 13 | {linkText} 14 | 15 | 16 | 17 | 18 | ); 19 | 20 | export default Filters; -------------------------------------------------------------------------------- /front-web/src/components/Header/Index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {ReactComponent as Logo} from '../../assets/logo.svg' 3 | import {Link} from 'react-router-dom'; 4 | import './styles.css'; 5 | 6 | const Header = () => ( 7 | 8 | 9 | 10 | 11 | Big Game 12 | Survey 13 | 14 | 15 | 16 | ); 17 | 18 | export default Header; -------------------------------------------------------------------------------- /front-web/src/components/Header/styles.css: -------------------------------------------------------------------------------- 1 | .main-header { 2 | height: 30px; 3 | padding: 20px 40px; 4 | display: flex; 5 | background-color: var(--color-darkslategray); 6 | } 7 | 8 | .logo-text { 9 | font-weight: bold; 10 | font-size: 24px; 11 | margin-left: 15px; 12 | } 13 | 14 | .logo-text-1 { 15 | color: var(--color-coral); 16 | } 17 | 18 | .logo-text-2 { 19 | color: #FFF; 20 | } 21 | 22 | @media (max-width: 850px) { 23 | .main-header { 24 | justify-content: center; 25 | } 26 | } -------------------------------------------------------------------------------- /front-web/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') 11 | ); 12 | 13 | -------------------------------------------------------------------------------- /front-web/src/pages/Charts/chart-options.ts: -------------------------------------------------------------------------------- 1 | export const pieOptions = { 2 | chart: { 3 | background: "transparent", 4 | foreColor: "red", 5 | }, 6 | colors: ["#a8dadc", "#ed7947", "#00D4FF", "#ffd6a5"], 7 | legend: { 8 | show: false, 9 | }, 10 | tooltip: { 11 | enabled: true, 12 | }, 13 | dataLabels: { 14 | enabled: true, 15 | offsetX: "100px", 16 | offsetY: "100px", 17 | style: { 18 | colors: ["#a8dadc", "#ed7947", "#00D4FF", "#ffd6a5"], 19 | fontSize: "20px", 20 | fontFamily: "Play, sans-serif", 21 | fontWeight: 700, 22 | }, 23 | }, 24 | plotOptions: { 25 | pie: { 26 | customScale: 0.7, 27 | expandOnClick: false, 28 | dataLabels: { 29 | offset: 60, 30 | }, 31 | }, 32 | }, 33 | }; 34 | 35 | export const barOptions = { 36 | chart: { 37 | toolbar: { 38 | show: false, 39 | }, 40 | }, 41 | colors: ["#ED7947"], 42 | grid: { 43 | show: false, 44 | }, 45 | plotOptions: { 46 | bar: { 47 | horizontal: true, 48 | endingShape: "rounded", 49 | startingShape: "rounded", 50 | barHeight: "60px", 51 | }, 52 | }, 53 | dataLabels: { 54 | enabled: true, 55 | }, 56 | tooltip: { 57 | enabled: false, 58 | }, 59 | xaxis: { 60 | labels: { 61 | show: false, 62 | }, 63 | axisBorder: { 64 | show: false, 65 | }, 66 | axisTicks: { 67 | show: false, 68 | }, 69 | }, 70 | yaxis: [ 71 | { 72 | labels: { 73 | maxWidth: 360, 74 | style: { 75 | colors: "#00D4FF", 76 | fontSize: "18px", 77 | fontFamily: "Play, sans-serif", 78 | fontWeight: 700, 79 | }, 80 | }, 81 | }, 82 | ], 83 | }; -------------------------------------------------------------------------------- /front-web/src/pages/Charts/helpers.ts: -------------------------------------------------------------------------------- 1 | import { Game } from './types'; 2 | import { RecordItem } from '../Records/types'; 3 | 4 | export const buildBarSeries = (games: Game[], records: RecordItem[]) => { 5 | const mappedGames = games.map(game => { 6 | const filteredGames = records.filter(item => { 7 | return item.gameTitle === game.title && item.gamePlatform === game.platform 8 | }); 9 | 10 | return { 11 | x: `${game.title} | ${game.platform}`, 12 | y: filteredGames.length 13 | } 14 | 15 | }); 16 | 17 | const sortedGames = mappedGames.sort((a, b) => { 18 | return b.y - a.y; 19 | }); 20 | 21 | return sortedGames.slice(0, 8); 22 | }; 23 | 24 | export const getPlatformChartData = (records: RecordItem[]) => { 25 | const platforms = ["PC", "PLAYSTATION", "XBOX"]; 26 | 27 | const series = platforms.map(platform => { 28 | const filtedGames = records.filter(item => { 29 | return platform === item.gamePlatform; 30 | }) 31 | 32 | return filtedGames.length; 33 | }); 34 | 35 | return { 36 | labels: platforms, 37 | series, 38 | }; 39 | }; 40 | 41 | export const getGenderChartData = (records: RecordItem[]) => { 42 | const genderByAmount = records.reduce((accumulator, currentValue) => { 43 | if (accumulator[currentValue.genreName] !== undefined) { 44 | accumulator[currentValue.genreName] += 1; 45 | } else { 46 | accumulator[currentValue.genreName] = 1; 47 | } 48 | 49 | return accumulator; 50 | }, {} as Record); 51 | 52 | const labels = Object.keys(genderByAmount); 53 | const series = Object.values(genderByAmount); 54 | 55 | return { 56 | labels, 57 | series 58 | }; 59 | }; -------------------------------------------------------------------------------- /front-web/src/pages/Charts/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import Filters from '../../components/Filters' 3 | import './styles.css' 4 | import {barOptions, pieOptions} from './chart-options'; 5 | import Chart from 'react-apexcharts'; 6 | import axios from 'axios'; 7 | import {buildBarSeries, getPlatformChartData, getGenderChartData} from './helpers'; 8 | import { BASE_URL } from "../../utils/requests"; 9 | 10 | type PieChartData = { 11 | labels: string[]; 12 | series: number[]; 13 | } 14 | 15 | type BarChartData = { 16 | x: string; 17 | y: number; 18 | } 19 | 20 | const initialPieData = { 21 | labels: [], 22 | series: [] 23 | } 24 | 25 | const Charts = () => { 26 | const [barChartData, setBarChartData] = useState([]); 27 | const [platformData, setPlatformData] = useState(initialPieData); 28 | const [genderData, setGenderData] = useState(initialPieData); 29 | 30 | useEffect(() => { 31 | async function getData(){ 32 | const recordsResponse = await axios.get(`${BASE_URL}/records`); 33 | const gamesResponse = await axios.get(`${BASE_URL}/games`); 34 | const barData = buildBarSeries(gamesResponse.data, recordsResponse.data.content); 35 | setBarChartData(barData); 36 | const platformChartData = getPlatformChartData(recordsResponse.data.content); 37 | setPlatformData(platformChartData); 38 | const genderChartData = getGenderChartData(recordsResponse.data.content); 39 | setGenderData(genderChartData); 40 | } 41 | 42 | getData(); 43 | }, []) 44 | 45 | return ( 46 | 47 | 48 | 49 | 50 | 51 | Jogos mais votados 52 | 53 | 54 | 61 | 62 | 63 | 64 | 65 | Plataformas 66 | 72 | 73 | 74 | Gêneros 75 | 81 | 82 | 83 | 84 | 85 | ) 86 | } 87 | 88 | export default Charts; -------------------------------------------------------------------------------- /front-web/src/pages/Charts/styles.css: -------------------------------------------------------------------------------- 1 | .chart-container { 2 | display: flex; 3 | } 4 | 5 | .top-related { 6 | background-color: var(--color-dimgray); 7 | padding-top: 30px; 8 | padding-left: 70px; 9 | border-radius: 10px; 10 | flex: 1; 11 | } 12 | 13 | .top-related-title { 14 | font-size: 36px; 15 | color: #FFF; 16 | } 17 | 18 | .games-container { 19 | display: flex; 20 | justify-content: center; 21 | } 22 | 23 | .games-list { 24 | width: 100%; 25 | } 26 | 27 | .game-result { 28 | display: flex; 29 | align-items: center; 30 | } 31 | 32 | .game-title { 33 | font-size: 24px; 34 | color: var(--color-turquoise); 35 | margin-right: 40px; 36 | width: 400px; 37 | text-align: right; 38 | } 39 | 40 | .game-rating { 41 | height: 20px; 42 | width: 300px; 43 | background-color: var(--color-coral); 44 | border-radius: 10px; 45 | } 46 | 47 | .charts { 48 | color: #FFF; 49 | width: 400px; 50 | margin-left: 30px; 51 | } 52 | 53 | .chart-title { 54 | font-size: 28px; 55 | } 56 | 57 | .platform-chart { 58 | padding-top: 15px; 59 | padding-left: 25px; 60 | height: 373px; 61 | margin-bottom: 25px; 62 | background-color: var(--color-dimgray); 63 | border-radius: 10px; 64 | } 65 | 66 | .gender-chart { 67 | padding-top: 15px; 68 | padding-left: 25px; 69 | height: 373px; 70 | background-color: var(--color-dimgray); 71 | border-radius: 10px; 72 | } -------------------------------------------------------------------------------- /front-web/src/pages/Charts/types.ts: -------------------------------------------------------------------------------- 1 | import { Platform } from "../Records/types"; 2 | 3 | export type Game = { 4 | id: number; 5 | title: string; 6 | platform: Platform; 7 | } 8 | 9 | export type ChartItem = { 10 | x: string; 11 | y: number; 12 | } -------------------------------------------------------------------------------- /front-web/src/pages/Home/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {ReactComponent as ArrowIcon} from '../../assets/arrow.svg' 3 | import {ReactComponent as GamerImage} from '../../assets/gamer.svg' 4 | import {Link} from 'react-router-dom'; 5 | import './styles.css' 6 | 7 | const Home = () => ( 8 | 9 | 10 | 11 | Quais jogos a galera mais gosta? 12 | 13 | 14 | Clique no botão abaixo e saiba quais são os jogos que os gamers estão escolhendo! 15 | 16 | 17 | 18 | 19 | QUERO SABER QUAIS SÃO 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ); 30 | 31 | export default Home; -------------------------------------------------------------------------------- /front-web/src/pages/Home/styles.css: -------------------------------------------------------------------------------- 1 | .home-container { 2 | margin-top: 150px; 3 | display: flex; 4 | justify-content: center; 5 | } 6 | 7 | .home-text { 8 | width: 490px; 9 | margin-right: 70px; 10 | } 11 | 12 | .home-text-title { 13 | font-size: 55px; 14 | color: var(--color-turquoise); 15 | } 16 | 17 | .home-text-subtitle { 18 | font-size: 24px; 19 | color: var(--color-coral); 20 | } 21 | 22 | .home-actions { 23 | display: flex; 24 | height: 70px; 25 | margin-top: 150px; 26 | } 27 | 28 | .home-btn { 29 | background-color: var(--color-turquoise); 30 | border-radius: 10px 0px 0px 10px; 31 | color: var(--color-black); 32 | font-weight: bold; 33 | font-size: 24px; 34 | padding: 20px 45px; 35 | } 36 | 37 | .home-btn:hover { 38 | background-color: #04c7ef; 39 | } 40 | 41 | .home-btn-icon { 42 | border-radius: 0px 10px 10px 0px; 43 | width: 70px; 44 | background-color: var(--color-coral); 45 | display: flex; 46 | align-items: center; 47 | justify-content: center; 48 | } 49 | 50 | /* responsive */ 51 | 52 | @media (max-width: 1250px) { 53 | .home-image { 54 | max-width: 400px; 55 | height: auto; 56 | } 57 | } 58 | 59 | @media (max-width: 1250px) { 60 | .home-image { 61 | max-width: 400px; 62 | height: auto; 63 | } 64 | 65 | .home-text-title { 66 | font-size: 45px; 67 | } 68 | 69 | .home-text-subtitle { 70 | font-size: 20px; 71 | } 72 | 73 | .home-text { 74 | width: 410px; 75 | margin-right: 20px; 76 | } 77 | 78 | .home-btn { 79 | font-size: 18px; 80 | padding: 10px 25px; 81 | } 82 | 83 | .home-actions { 84 | margin-top: 50px; 85 | } 86 | } 87 | 88 | @media (max-width: 850px) { 89 | .home-container { 90 | margin-top: 50px; 91 | } 92 | 93 | .home-actions { 94 | height: 50px; 95 | justify-content: center; 96 | } 97 | 98 | .home-image { 99 | display: none; 100 | } 101 | 102 | .home-text { 103 | margin-right: 0; 104 | text-align: center; 105 | padding: 0 10px; 106 | } 107 | } -------------------------------------------------------------------------------- /front-web/src/pages/Records/Pagination/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './styles.css'; 3 | 4 | type Props = { 5 | totalPages?: number; 6 | goToPage: Function; 7 | activePage: number; 8 | } 9 | 10 | const Pagination = ({totalPages = 0, goToPage, activePage}: Props) => { 11 | const paginationItems = Array.from(Array(totalPages).keys()); 12 | return ( 13 | 14 | {paginationItems.map(item => ( 15 | goToPage(item)} 19 | > 20 | {item + 1} 21 | 22 | ))} 23 | 24 | ) 25 | } 26 | 27 | export default Pagination; -------------------------------------------------------------------------------- /front-web/src/pages/Records/Pagination/styles.css: -------------------------------------------------------------------------------- 1 | .pagination-container { 2 | margin-top: 30px; 3 | text-align: center; 4 | } 5 | 6 | .pagination-item { 7 | width: 40px; 8 | height: 40px; 9 | border-radius: 10px; 10 | margin-right: 10px; 11 | font-weight: bold; 12 | font-size: 18px; 13 | } 14 | 15 | .pagination-item.active { 16 | background: var(--color-turquoise); 17 | } 18 | 19 | .pagination-item.inactive { 20 | background: var(--color-darkslategray); 21 | color: var(--color-coral); 22 | } 23 | 24 | .pagination-item.active:hover { 25 | background-color: #04c7ef; 26 | } 27 | 28 | .pagination-item.inactive:hover { 29 | background-color: #29353b; 30 | } -------------------------------------------------------------------------------- /front-web/src/pages/Records/helpers.ts: -------------------------------------------------------------------------------- 1 | import moment from 'moment'; 2 | 3 | export const formatDate = (date: string) => { 4 | return moment(date).format('DD/MM/YY HH:mm'); 5 | } -------------------------------------------------------------------------------- /front-web/src/pages/Records/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react'; 2 | import axios from 'axios'; 3 | import './styles.css'; 4 | import { RecordsResponse } from './types'; 5 | import {} from './types'; 6 | import { formatDate } from './helpers'; 7 | import Pagination from './Pagination'; 8 | import Filters from '../../components/Filters' 9 | import { BASE_URL } from '../../utils/requests'; 10 | 11 | const Records = () => { 12 | const [recordsResponse, setRecordsResponse] = useState(); 13 | const [activePage, setActivePage] = useState(0); 14 | 15 | useEffect(() => { 16 | axios.get(`${BASE_URL}/records?linesPerPage=12&page=${activePage}`) 17 | .then(response => setRecordsResponse(response.data)); 18 | }, [activePage]); 19 | 20 | const handlePageChange = (index: number) => { 21 | setActivePage(index) 22 | } 23 | 24 | return ( 25 | 26 | 27 | 28 | 29 | 30 | INSTANTE 31 | NOME 32 | IDADE 33 | PLATAFORMA 34 | GÊNERO 35 | TÍTULO DO GAME 36 | 37 | 38 | 39 | {recordsResponse?.content.map(record => ( 40 | 41 | {formatDate(record.moment)} 42 | {record.name} 43 | {record.age} 44 | {record.gamePlatform} 45 | {record.genreName} 46 | {record.gameTitle} 47 | 48 | ))} 49 | 50 | 51 | 56 | 57 | ); 58 | } 59 | 60 | export default Records; -------------------------------------------------------------------------------- /front-web/src/pages/Records/styles.css: -------------------------------------------------------------------------------- 1 | .page-container { 2 | width: 80%; 3 | margin: 0 auto; 4 | margin-bottom: 50px; 5 | padding-top: 50px; 6 | } 7 | 8 | .filters-container.records-actions { 9 | justify-content: flex-end; 10 | } 11 | 12 | .records-table { 13 | width: 100%; 14 | border-bottom: 10px solid var(--color-turquoise); 15 | border-radius: 0 0 10px 10px; 16 | } 17 | 18 | .records-table thead { 19 | background-color: var(--color-turquoise); 20 | text-align: left; 21 | color: #0E1B28; 22 | border-radius: 10px; 23 | } 24 | 25 | .records-table thead tr { 26 | height: 50px; 27 | } 28 | 29 | .records-table thead th:first-child { 30 | padding-left: 50px; 31 | border-top-left-radius: 10px; 32 | } 33 | 34 | .records-table thead th:last-child { 35 | border-top-right-radius: 10px; 36 | } 37 | 38 | .records-table tbody td:first-child { 39 | padding-left: 50px; 40 | } 41 | 42 | .records-table tbody tr { 43 | height: 45px; 44 | color: #FFF; 45 | font-size: 18px; 46 | } 47 | 48 | .records-table tbody tr:nth-child(odd) { 49 | background-color: var(--color-darkslategray); 50 | } 51 | 52 | .records-table tbody tr:nth-child(even) { 53 | background-color: var(--color-dimgray); 54 | } 55 | 56 | .filters-container { 57 | background-color: var(--color-darkslategray); 58 | display: flex; 59 | justify-content: space-between; 60 | padding: 13px 15px; 61 | margin-bottom: 25px; 62 | border-radius: 10px; 63 | } 64 | 65 | .filters-container input { 66 | height: 44px; 67 | font-weight: bold; 68 | font-size: 16px; 69 | color: #9E9E9E; 70 | border: 1px solid #E1E1E1; 71 | border-radius: 10px; 72 | box-sizing: border-box; 73 | margin-right: 20px; 74 | padding-left: 15px; 75 | } 76 | 77 | .filters-container input:focus { 78 | outline: none; 79 | } 80 | 81 | .filters-container button { 82 | font-weight: bold; 83 | font-size: 16px; 84 | border-radius: 10px; 85 | padding: 13px 60px; 86 | } 87 | 88 | .filters-container .clean-filters { 89 | background-color: var(--color-coral); 90 | color: #FFF; 91 | margin-left: 20px; 92 | } 93 | 94 | .filters-container .clean-filters:hover { 95 | background-color: #e07243; 96 | } 97 | 98 | .filters-container .action-filters { 99 | background-color: var(--color-turquoise); 100 | color: #0E1B28; 101 | } 102 | 103 | .filters-container .action-filters:hover { 104 | background-color: #04c7ef; 105 | } -------------------------------------------------------------------------------- /front-web/src/pages/Records/types.ts: -------------------------------------------------------------------------------- 1 | export type RecordsResponse = { 2 | content: RecordItem[]; 3 | totalPages: number; 4 | } 5 | 6 | export type RecordItem = { 7 | id: number; 8 | moment: string; 9 | name: string; 10 | age: number; 11 | gameTitle: string; 12 | gamePlatform: Platform, 13 | genreName: string; 14 | } 15 | 16 | export type Platform = 'XBOX' | 'PC' | 'PLAYSTATION'; -------------------------------------------------------------------------------- /front-web/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /front-web/src/utils/requests.ts: -------------------------------------------------------------------------------- 1 | export const BASE_URL = process.env.REACT_APP_BACKEND_URL ?? 'http://localhost:8080'; 2 | -------------------------------------------------------------------------------- /front-web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "noEmit": true, 20 | "jsx": "react" 21 | }, 22 | "include": [ 23 | "src" 24 | ] 25 | } 26 | --------------------------------------------------------------------------------