├── Back └── ToDo API │ ├── .gitignore │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── ar │ │ └── com │ │ └── utnfrsr │ │ └── todoapp │ │ ├── TodoAppApplication.java │ │ ├── context │ │ ├── CorsConfig.java │ │ └── OpenApiConfig.java │ │ ├── controller │ │ └── TaskController.java │ │ ├── exceptions │ │ ├── ExceptionHandler.java │ │ └── ToDoExceptions.java │ │ ├── model │ │ ├── dto │ │ │ ├── request │ │ │ │ └── TaskRequestDTO.java │ │ │ └── response │ │ │ │ └── TaskResponseDTO.java │ │ ├── entity │ │ │ └── Task.java │ │ └── mapper │ │ │ └── TaskMapper.java │ │ ├── repository │ │ └── TastkRepository.java │ │ └── service │ │ ├── ITaskService.java │ │ └── impl │ │ └── TaskService.java │ └── resources │ └── application.yml ├── Front ├── assets │ ├── css │ │ └── styles.css │ ├── img │ │ ├── rocket.svg │ │ └── utn.png │ └── script │ │ ├── components │ │ ├── addTask.js │ │ ├── checkComplete.js │ │ ├── dateElement.js │ │ ├── deleteIco.js │ │ └── displayTasks.js │ │ ├── data │ │ ├── checkTask.js │ │ ├── deleteTask.js │ │ ├── getTasks.js │ │ ├── path.js │ │ └── sendTask.js │ │ ├── script.js │ │ └── service │ │ └── date.js └── index.html ├── README.md ├── Tasks.postman_collection.json └── db_todo_api.sql /Back/ToDo API/.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 | 35 | ### Aplication.Properties ### 36 | /src/main/resources/application.yml 37 | 38 | ### Project images ### 39 | /Capturas/ 40 | /.mvn/ 41 | -------------------------------------------------------------------------------- /Back/ToDo API/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 /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | -------------------------------------------------------------------------------- /Back/ToDo API/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 "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\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/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq 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%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.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% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /Back/ToDo API/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 9 | 3.0.2 10 | 11 | 12 | ar.com.utnfrsr 13 | todoapp 14 | 0.0.1-SNAPSHOT 15 | TodoApp 16 | Demo project for Spring Boot 17 | 18 | 17 19 | 2.0.2 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-data-jpa 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-web 30 | 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-devtools 35 | runtime 36 | true 37 | 38 | 39 | 40 | org.projectlombok 41 | lombok 42 | true 43 | 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | 52 | org.springdoc 53 | springdoc-openapi-starter-webmvc-ui 54 | ${springdoc.openapi.starter.webmvc.ui.version} 55 | 56 | 57 | 58 | com.mysql 59 | mysql-connector-j 60 | runtime 61 | 62 | 63 | 64 | jakarta.validation 65 | jakarta.validation-api 66 | 3.0.2 67 | 68 | 69 | 70 | org.hibernate 71 | hibernate-validator 72 | 8.0.0.Final 73 | 74 | 75 | 76 | 77 | 78 | 79 | org.springframework.boot 80 | spring-boot-maven-plugin 81 | 82 | 83 | 84 | org.projectlombok 85 | lombok 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/TodoAppApplication.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class TodoAppApplication { 8 | 9 | public static void main(String[] args) { 10 | 11 | SpringApplication.run(TodoAppApplication.class, args); 12 | System.out.println("Hola desde SprigBoot"); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/context/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.context; 2 | 3 | import org.springframework.boot.web.servlet.FilterRegistrationBean; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.core.Ordered; 7 | import org.springframework.web.cors.CorsConfiguration; 8 | import org.springframework.web.cors.CorsConfigurationSource; 9 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 10 | import org.springframework.web.filter.CorsFilter; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | @Configuration 16 | public class CorsConfig { 17 | 18 | @Bean 19 | public CorsConfigurationSource corsConfigurationSource() { 20 | CorsConfiguration configuration = new CorsConfiguration(); 21 | configuration.setAllowedOrigins(List.of("*")); //(*) habilita todos los origenes 22 | configuration.setAllowedHeaders(Arrays.asList("Content-Type", "Authorization", "X-Requested-With", "Accept", "Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers", "Access-Control-Allow-Origin")); //habilita todos los encabezados 23 | configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")); //habilita todos los metodos 24 | // Agrega otros encabezados y opciones de configuración si es necesario 25 | 26 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 27 | source.registerCorsConfiguration("/**", configuration); 28 | return source; 29 | } 30 | 31 | @Bean 32 | public FilterRegistrationBean corsFilter() { 33 | FilterRegistrationBean bean = 34 | new FilterRegistrationBean<>(new CorsFilter(corsConfigurationSource())); 35 | bean.setOrder(Ordered.HIGHEST_PRECEDENCE); 36 | return bean; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/context/OpenApiConfig.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.context; 2 | 3 | import io.swagger.v3.oas.models.Components; 4 | import io.swagger.v3.oas.models.ExternalDocumentation; 5 | import io.swagger.v3.oas.models.OpenAPI; 6 | import io.swagger.v3.oas.models.info.Info; 7 | import io.swagger.v3.oas.models.security.SecurityRequirement; 8 | import io.swagger.v3.oas.models.security.SecurityScheme; 9 | 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.context.annotation.Configuration; 12 | 13 | @Configuration /*la clase con esta configuracipon tiene la capacidad de crear bines, los cuales forman parte de la aplication context de spring/springboot*/ 14 | public class OpenApiConfig { 15 | @Bean 16 | public OpenAPI OngAPI() { 17 | final String securitySchemeName = "bearerAuth"; 18 | return new OpenAPI() 19 | .info(new Info() 20 | .title("ToDo API") 21 | .description("La API REST de ToDo App.") 22 | .version("v1")) 23 | .externalDocs(new ExternalDocumentation() 24 | .description("") 25 | .url("")) 26 | .addSecurityItem(new SecurityRequirement() 27 | .addList(securitySchemeName)) 28 | .components(new Components() 29 | .addSecuritySchemes(securitySchemeName, new SecurityScheme() 30 | .name(securitySchemeName) 31 | .type(SecurityScheme.Type.HTTP) 32 | .scheme("bearer") 33 | .bearerFormat("JWT"))); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/controller/TaskController.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.controller; 2 | 3 | import ar.com.utnfrsr.todoapp.model.dto.request.TaskRequestDTO; 4 | import ar.com.utnfrsr.todoapp.model.dto.response.TaskResponseDTO; 5 | import ar.com.utnfrsr.todoapp.service.impl.TaskService; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.List; 12 | 13 | @RestController /*Anotación para confirmar de que se trata de un controlador el cual será revisado por swagger*/ 14 | @RequestMapping("api/v1/tasks") 15 | @RequiredArgsConstructor 16 | public class TaskController { //esta capa solo se comunica con la capa de servicio 17 | 18 | private final TaskService taskService; 19 | 20 | @PostMapping("/create") 21 | public ResponseEntity createTask(@RequestBody TaskRequestDTO taskRequestDTO) { 22 | TaskResponseDTO task = taskService.createTask(taskRequestDTO); 23 | return ResponseEntity.status(HttpStatus.CREATED).body(task); 24 | } 25 | 26 | @GetMapping("/all") 27 | public ResponseEntity> findAll() { 28 | List tasks = taskService.findAll(); 29 | return ResponseEntity.ok(tasks); 30 | } 31 | 32 | @PatchMapping("/mark_as_finished/{id}/{finished}") 33 | public ResponseEntity markAsFinished(@PathVariable("id") Long id, @PathVariable("finished") boolean finished) { 34 | this.taskService.updateTaskAsFinished(id, finished); 35 | return ResponseEntity.noContent().build(); //luego de que se ejecute la tarea devuelve un 204 siempre 36 | } 37 | 38 | @DeleteMapping("delete/{id}") 39 | public ResponseEntity delete(@PathVariable("id") Long id) { 40 | this.taskService.deleteById(id); 41 | return ResponseEntity.noContent().build(); 42 | } 43 | } -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/exceptions/ExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.exceptions; 2 | 3 | import org.springframework.http.HttpHeaders; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.ControllerAdvice; 6 | import org.springframework.web.context.request.WebRequest; 7 | import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; 8 | 9 | @ControllerAdvice 10 | public class ExceptionHandler extends ResponseEntityExceptionHandler { 11 | //mecanismo que permite manejar todas las excepciones de nuestra aplicación 12 | //cuando una aplicación lanza una excepción de manera general, 13 | //antes de que se muestre de manera descontrolada en el controlador, 14 | //maneja y la renderiza de la manera que la queremos mostrar 15 | @org.springframework.web.bind.annotation.ExceptionHandler(value = {ToDoExceptions.class}) 16 | protected ResponseEntity handleConflict( 17 | ToDoExceptions ex, WebRequest request) { 18 | String bodyOfResponse = ex.getMessage(); 19 | return handleExceptionInternal(ex, bodyOfResponse, 20 | new HttpHeaders(), ex.getHttpStatus(), request); 21 | } 22 | } -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/exceptions/ToDoExceptions.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.exceptions; 2 | 3 | import lombok.Data; 4 | import org.springframework.http.HttpStatus; 5 | 6 | @Data 7 | public class ToDoExceptions extends RuntimeException { 8 | 9 | private String message; 10 | private HttpStatus httpStatus; //para obtener el estado http 11 | 12 | public ToDoExceptions(String message, HttpStatus httpStatus) { //sobreescribimos el metodo runtimeexeption 13 | super(message); 14 | this.message = message; 15 | this.httpStatus = httpStatus; 16 | } 17 | } -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/model/dto/request/TaskRequestDTO.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.model.dto.request; 2 | 3 | import jakarta.validation.constraints.NotNull; 4 | import lombok.Data; 5 | 6 | import java.time.LocalDateTime; 7 | import java.time.LocalTime; 8 | import java.util.Date; 9 | 10 | @Data 11 | public class TaskRequestDTO { 12 | 13 | @NotNull 14 | private String title; 15 | @NotNull 16 | private LocalDateTime createdDate; 17 | @NotNull 18 | private Date date; 19 | @NotNull 20 | private LocalTime time; 21 | } 22 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/model/dto/response/TaskResponseDTO.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.model.dto.response; 2 | 3 | import lombok.Data; 4 | 5 | import java.time.LocalTime; 6 | import java.util.Date; 7 | 8 | @Data 9 | public class TaskResponseDTO { 10 | 11 | private Long id; 12 | private String title; 13 | private Date date; 14 | private LocalTime time; 15 | private boolean finished; 16 | } 17 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/model/entity/Task.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.model.entity; 2 | 3 | import jakarta.persistence.*; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | import org.hibernate.annotations.SQLDelete; 9 | import org.hibernate.annotations.Where; 10 | import org.springframework.format.annotation.DateTimeFormat; 11 | 12 | import java.time.LocalDate; 13 | import java.time.LocalDateTime; 14 | import java.time.LocalTime; 15 | import java.util.Date; 16 | 17 | @Data /*Para obtener los getter and setter de la clase*/ 18 | @Entity 19 | @Builder 20 | @AllArgsConstructor 21 | @NoArgsConstructor 22 | @Table(name = "task") 23 | @SQLDelete(sql = "UPDATE task SET enable = false WHERE id = ?") 24 | @Where(clause = "enable = true") 25 | public class Task { 26 | @Id 27 | @GeneratedValue(strategy = GenerationType.AUTO) 28 | @Column(name = "id", nullable = false, length = 20) 29 | private Long id; 30 | @Column(name = "title", nullable = false, length = 256) 31 | private String title; 32 | @Column(name = "created_date", nullable = false) 33 | private LocalDateTime createdDate; 34 | @DateTimeFormat(pattern = "yyyy-MM-DD") 35 | @Column(name = "date", nullable = false) 36 | private Date date; 37 | @Column(name = "time", nullable = false) 38 | private LocalTime time; 39 | @Column(name = "finished", nullable = false) 40 | private boolean finished; 41 | @Column(name = "enable") 42 | private boolean enabled = true; 43 | } 44 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/model/mapper/TaskMapper.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.model.mapper; 2 | 3 | import ar.com.utnfrsr.todoapp.model.dto.request.TaskRequestDTO; 4 | import ar.com.utnfrsr.todoapp.model.dto.response.TaskResponseDTO; 5 | import ar.com.utnfrsr.todoapp.model.entity.Task; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.time.LocalDateTime; 9 | import java.util.List; 10 | 11 | @Component /*de esta manera lo podremos indentar en nuestras clases*/ 12 | public class TaskMapper { 13 | 14 | public Task toTask(TaskRequestDTO taskRequestDTO) { 15 | Task task = new Task(); 16 | task.setTitle(taskRequestDTO.getTitle()); 17 | task.setCreatedDate(LocalDateTime.now()); 18 | task.setDate(taskRequestDTO.getDate()); 19 | task.setTime(taskRequestDTO.getTime()); 20 | return task; 21 | } 22 | 23 | public TaskResponseDTO toDTO(Task task) { 24 | TaskResponseDTO taskResponseDTO = new TaskResponseDTO(); 25 | taskResponseDTO.setId(task.getId()); 26 | taskResponseDTO.setTitle(task.getTitle()); 27 | taskResponseDTO.setDate(task.getDate()); 28 | taskResponseDTO.setTime(task.getTime()); 29 | taskResponseDTO.setFinished(task.isFinished()); 30 | return taskResponseDTO; 31 | } 32 | 33 | public List toDTOList(List tasks) { 34 | return tasks.stream().map(this::toDTO).collect(java.util.stream.Collectors.toList()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/repository/TastkRepository.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.repository; 2 | 3 | import ar.com.utnfrsr.todoapp.model.entity.Task; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.jpa.repository.Modifying; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | 9 | public interface TastkRepository extends JpaRepository { // 10 | 11 | /** 12 | * Update task to status (true or false) 13 | * 14 | * @param id recibe el ide para pasarlo a la query nativa 15 | * @param finished recibe el estado para pasarlo a la query nativa 16 | */ 17 | @Modifying //demuestra que la query es de actualización 18 | @Query(value = "UPDATE TASK SET FINISHED=:finished WHERE ID=:id", nativeQuery = true) 19 | void markTaskAsFinished(@Param("id") Long id, @Param("finished") boolean finished); 20 | } -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/service/ITaskService.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.service; 2 | 3 | import ar.com.utnfrsr.todoapp.model.dto.request.TaskRequestDTO; 4 | import ar.com.utnfrsr.todoapp.model.dto.response.TaskResponseDTO; 5 | 6 | import java.util.List; 7 | 8 | public interface ITaskService { 9 | 10 | TaskResponseDTO createTask(TaskRequestDTO taskRequestDTO); 11 | 12 | List findAll(); 13 | 14 | void updateTaskAsFinished(Long id, boolean finished); 15 | 16 | void deleteById(Long id); 17 | } 18 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/java/ar/com/utnfrsr/todoapp/service/impl/TaskService.java: -------------------------------------------------------------------------------- 1 | package ar.com.utnfrsr.todoapp.service.impl; 2 | 3 | import ar.com.utnfrsr.todoapp.exceptions.ToDoExceptions; 4 | import ar.com.utnfrsr.todoapp.model.dto.request.TaskRequestDTO; 5 | import ar.com.utnfrsr.todoapp.model.dto.response.TaskResponseDTO; 6 | import ar.com.utnfrsr.todoapp.model.entity.Task; 7 | import ar.com.utnfrsr.todoapp.model.mapper.TaskMapper; 8 | import ar.com.utnfrsr.todoapp.repository.TastkRepository; 9 | import ar.com.utnfrsr.todoapp.service.ITaskService; 10 | import jakarta.transaction.Transactional; 11 | import lombok.RequiredArgsConstructor; 12 | import org.springframework.http.HttpStatus; 13 | import org.springframework.stereotype.Service; 14 | 15 | import java.util.List; 16 | import java.util.Optional; 17 | 18 | @Service 19 | //le dice al contenedor bin de spring, que cree un bin y lo guarde en ese contenedor, para luego ser identado donde se lo necesite 20 | @RequiredArgsConstructor 21 | public class TaskService implements ITaskService { 22 | 23 | //en el service va toda la lógica necesaria para el programa. 24 | private final TastkRepository repository; 25 | private final TaskMapper mapper; 26 | 27 | //Crea la tarea 28 | @Override 29 | public TaskResponseDTO createTask(TaskRequestDTO taskRequestDTO) { 30 | Task task = mapper.toTask(taskRequestDTO); 31 | return mapper.toDTO(repository.save(task)); 32 | } 33 | 34 | //muestra la lista de tareas 35 | @Override 36 | public List findAll() { 37 | return mapper.toDTOList(repository.findAll()); 38 | } 39 | 40 | //actualiza el estado de la tarea 41 | @Override 42 | @Transactional 43 | public void updateTaskAsFinished(Long id, boolean finished) { 44 | Optional optionalTask = this.repository.findById(id); 45 | if (optionalTask.isEmpty()) { //si no hay taréa 46 | throw new ToDoExceptions("Task not found", HttpStatus.NOT_FOUND); 47 | } 48 | finished = !finished; 49 | this.repository.markTaskAsFinished(id, finished); 50 | } 51 | 52 | //elimina el task mediante su id 53 | @Override 54 | public void deleteById(Long id) { 55 | Optional optionalTask = this.repository.findById(id); 56 | if (optionalTask.isEmpty()) { 57 | throw new ToDoExceptions("Task not found", HttpStatus.NOT_FOUND); 58 | } 59 | this.repository.deleteById(id); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Back/ToDo API/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: todo-app 4 | datasource: 5 | driver-class-name: com.mysql.cj.jdbc.Driver 6 | username: ${DB_USER} 7 | password: ${DB_PASS} 8 | url: "jdbc:mysql://localhost:3306/db_todo_api?createDatabaseIfNotExist=true" 9 | jpa: 10 | show-sql: true 11 | database: mysql 12 | database-platform: org.hibernate.dialect.MySQL8Dialect 13 | defer-datasource-initialization: true 14 | properties: 15 | hibernate: 16 | format_sql: true 17 | hibernate: 18 | ddl-auto: update 19 | output: 20 | ansi: 21 | enabled: always -------------------------------------------------------------------------------- /Front/assets/css/styles.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | font-family: 'Dosis', sans-serif; 5 | font-size: 16px; 6 | } 7 | 8 | main { 9 | background-image: linear-gradient( 10 | 109.6deg, 11 | rgba(62, 161, 219, 1) 11.2%, 12 | rgba(93, 52, 236, 1) 100.2% 13 | ); 14 | width: 100vw; 15 | height: 100vh; 16 | display: flex; 17 | align-items: center; 18 | justify-content: center; 19 | } 20 | 21 | img{ 22 | width: 50px; 23 | } 24 | 25 | .utn{ 26 | display: flex; 27 | align-items: center; 28 | justify-content: center; 29 | } 30 | 31 | h1{ 32 | font-size: 30px; 33 | margin-left: 15px; 34 | 35 | } 36 | 37 | form { 38 | width: 100%; 39 | justify-content: space-between; 40 | align-items: center; 41 | display: flex; 42 | margin-bottom: 15px; 43 | } 44 | 45 | .mainCard { 46 | width: 40vw; 47 | border-radius: 25px; 48 | background-color: #fff; 49 | padding: 25px; 50 | } 51 | 52 | .title { 53 | font-family: 'Dosis', sans-serif; 54 | display: flex; 55 | justify-content: center; 56 | align-content: center; 57 | margin-bottom: 15px; 58 | } 59 | 60 | .inputForm { 61 | border: none; 62 | padding: 10px; 63 | border: 1px solid #eee; 64 | outline: none; 65 | width: 45%; 66 | } 67 | 68 | .inputForm::placeholder { 69 | padding: 0px; 70 | } 71 | 72 | .btnCreate { 73 | padding: 10px 15px; 74 | background-image: linear-gradient( 75 | 109.6deg, 76 | rgba(62, 161, 219, 1) 11.2%, 77 | rgba(93, 52, 236, 1) 100.2% 78 | ); 79 | border: none; 80 | color: #fff; 81 | border-radius: 5px; 82 | cursor: pointer; 83 | } 84 | 85 | .cardsList { 86 | width: 100%; 87 | display: flex; 88 | flex-direction: column; 89 | align-items: center; 90 | justify-content: flex-start; 91 | overflow-y: scroll; 92 | max-height: 60vh; 93 | height: 60vh; 94 | } 95 | 96 | .card { 97 | width: 90%; 98 | padding: 15px; 99 | box-shadow: 2px 4px 4px 4px rgba(71, 71, 71, 0.16); 100 | display: flex; 101 | flex-direction: row; 102 | justify-content: space-between; 103 | align-content: center; 104 | margin: 5px 0px; 105 | position: relative; 106 | } 107 | 108 | .task { 109 | padding: 10px; 110 | } 111 | 112 | .icon { 113 | cursor: pointer; 114 | } 115 | 116 | .icon:hover { 117 | color: rgba(62, 161, 219, 1); 118 | } 119 | 120 | .completeIcon { 121 | color: rgba(62, 161, 219, 1); 122 | } 123 | 124 | .trashIcon:hover { 125 | color: #f00; 126 | } 127 | 128 | .deleteConfirmationPop { 129 | position: relative; 130 | background-color: rgba(255, 255, 255); 131 | z-index: 99; 132 | width: 100%; 133 | top: -100px; 134 | left: 0; 135 | } 136 | .deleteSpace { 137 | position: relative; 138 | width: 30%; 139 | } 140 | 141 | .noTasks { 142 | font-size: 48px; 143 | } 144 | 145 | .date{ 146 | width: 100%; 147 | padding: 15px; 148 | } 149 | 150 | /*Agregamos las Media Querrys para que todo sea responsive*/ 151 | 152 | @media screen and (max-width: 1424px) { 153 | .mainCard { 154 | width: 60vw; 155 | } 156 | .inputForm { 157 | width: 80%; 158 | } 159 | input{ 160 | margin: 2%; 161 | } 162 | .btnCreate { 163 | width: 80%; 164 | } 165 | } -------------------------------------------------------------------------------- /Front/assets/img/rocket.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Front/assets/img/utn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lokywolf2295/ToDo_Front_-_API/c7f1726a87a033447d58c0b4f7167b04a1451abe/Front/assets/img/utn.png -------------------------------------------------------------------------------- /Front/assets/script/components/addTask.js: -------------------------------------------------------------------------------- 1 | import checkComplete from "./checkComplete.js"; 2 | import createDelIcon from "./deleteIco.js"; 3 | import { displayTasks } from "./displayTasks.js"; 4 | import { sendTask } from "../data/sendTask.js"; 5 | 6 | export const addTask = (event) => { 7 | event.preventDefault(); //evita que se recargue la pagina borrando la información 8 | 9 | const list = document.querySelector("[data-list]"); //guardamos el ul que contendra los mensajes 10 | const input = document.querySelector("[data-form-input]"); //guardamos el input 11 | const calendar = document.querySelector("[data-form-date]"); //guardamos el input de la fecha 12 | 13 | const title = input.value; //guardamos la información del input 14 | const date = calendar.value; //guardamos la información de la fecha 15 | const dateFormat = moment(date).format("yyyy-MM-DD"); 16 | const time = moment(date).format("HH:mm"); 17 | 18 | if (input == "" || date == "") { 19 | //corroboramos que ambos inputs tengan información 20 | return; 21 | } 22 | 23 | input.value = ""; //vaciamos el input 24 | calendar.value = ""; //vaciamos el calendario 25 | 26 | const finished = false; //se utilizará para verificar si el check está activado o no 27 | 28 | const taskObj = { 29 | //crea una variable que almacena una clave y su valor 30 | title, //texto 31 | date:dateFormat, //fecha 32 | time, //hora 33 | finished, //para el check 34 | }; 35 | 36 | list.innerHTML = ""; //por cada vez que se agreguen tareas nuevas se vacía la estructura 37 | 38 | sendTask(taskObj); //llama a la función que envía la tarea a la API 39 | displayTasks(); //llama a la función que agrupa las fechas 40 | }; 41 | 42 | //Arrow function o funciones flechas / anonimas 43 | export const createTask = ({ id, title, time,finished}) => { 44 | 45 | const task = document.createElement("li"); //creo un elemento li 46 | task.classList.add("card"); //agregamos una clase al task 47 | 48 | //backticks 49 | const taskContent = document.createElement("div"); //creo un elemento div 50 | 51 | const check = checkComplete(id,finished); 52 | 53 | const titleTask = document.createElement("span"); //creo un elemento span 54 | titleTask.classList.add("task"); //agregamos la clase task al titleTask 55 | titleTask.innerText = title; //agregamos al titleTask el valor del inpút 56 | taskContent.appendChild(check); //agregamos al div check 57 | taskContent.appendChild(titleTask); //agregamos al contenido el titleTask 58 | 59 | const dateElement = document.createElement("span"); //creo el elemento span para la fecha 60 | dateElement.innerHTML = time; //le agrego al span la hora obtenida 61 | task.appendChild(taskContent); //agrego al task el div con la info ingresada en el input 62 | task.appendChild(dateElement); //agrego al task la fecha 63 | task.appendChild(createDelIcon(id)); //agrego al contenido el icono del basurero 64 | return task; 65 | }; 66 | -------------------------------------------------------------------------------- /Front/assets/script/components/checkComplete.js: -------------------------------------------------------------------------------- 1 | import { checkTask } from "../data/checkTask.js"; 2 | 3 | const checkComplete = (id,finished) => { 4 | //console.log(id); 5 | //console.log(finished); 6 | const i = document.createElement("i"); //creamos un elemento i 7 | i.classList.add("far", "fa-check-square", "icon"); 8 | if(finished){ 9 | i.classList.toggle("fas"); 10 | i.classList.toggle("completeIcon"); 11 | i.classList.toggle("far"); //agregamos las clase al elemento i 12 | } 13 | i.addEventListener("click", (event) => completeTask(event, id,finished)); 14 | return i; //devolvemos el valor de i 15 | }; 16 | 17 | const completeTask = (event, id,finished) =>{ 18 | const element = event.target; 19 | element.classList.toggle("fas"); 20 | element.classList.toggle("completeIcon"); 21 | element.classList.toggle("far"); //agregamos las clase al elemento i 22 | checkTask(id,finished); 23 | } 24 | 25 | export default checkComplete; -------------------------------------------------------------------------------- /Front/assets/script/components/dateElement.js: -------------------------------------------------------------------------------- 1 | export default (date) => { 2 | const dateElement = document.createElement('li'); 3 | dateElement.classList.add('date'); 4 | dateElement.innerHTML = date; 5 | return dateElement; 6 | } -------------------------------------------------------------------------------- /Front/assets/script/components/deleteIco.js: -------------------------------------------------------------------------------- 1 | import { deleteTask } from "./../data/deleteTask.js"; 2 | import { displayTasks } from "./displayTasks.js"; 3 | 4 | 5 | const createDelIcon = (id) => { 6 | const i = document.createElement("i"); //creamos un elemento i 7 | i.classList.add("fas","fa-trash-alt", "trashIcon" ,"icon"); //agregamos las clase al elemento i 8 | i.addEventListener("click", () => dumpTask(id)); 9 | return i; //devolvemos el valor de i 10 | }; 11 | 12 | const dumpTask = (id) =>{ 13 | const list = document.querySelector("[data-list]"); //seleccionamos la lista 14 | deleteTask(id); 15 | list.innerHTML = ""; 16 | displayTasks(); //llamado, para mostrar las nuevas tareas modificadas 17 | } 18 | 19 | export default createDelIcon; -------------------------------------------------------------------------------- /Front/assets/script/components/displayTasks.js: -------------------------------------------------------------------------------- 1 | import { createTask } from "./addTask.js"; 2 | import dateElement from "./dateElement.js"; 3 | import { uniqueDates, orderDates } from "../service/date.js"; 4 | import { getTasks } from "./../data/getTasks.js"; 5 | 6 | export const displayTasks = async () => { 7 | let tasks = await getTasks(); 8 | 9 | const list = document.querySelector("[data-list]"); //linkeamos el contenedor de los mensajes 10 | const dates = uniqueDates(tasks); 11 | const orderedDates = orderDates(dates); 12 | 13 | orderedDates.forEach((date) => { 14 | const dateMoment = moment(date, "DD/MM/YYYY"); 15 | list.appendChild(dateElement(date)); 16 | 17 | tasks.forEach((task) => { 18 | const taskDate = moment(task.date, "YYYY/MM/DD").format("DD/MM/YYYY"); 19 | const diff = dateMoment.diff(moment(taskDate, "DD/MM/YYYY"), "days"); 20 | 21 | if (diff == 0) { 22 | list.appendChild(createTask(task)); 23 | } 24 | }); 25 | }); 26 | }; 27 | -------------------------------------------------------------------------------- /Front/assets/script/data/checkTask.js: -------------------------------------------------------------------------------- 1 | import { path } from "../data/path.js"; 2 | 3 | export const checkTask = async (id,finished) => { 4 | const url = path + "mark_as_finished/" + id+"/"+finished; 5 | fetch(url, { 6 | method: "PATCH", 7 | }) 8 | .then((res) => { 9 | if (res.ok) { 10 | window.location.href = "index.html"; 11 | } else { 12 | Swal.fire({ 13 | position: "center", 14 | icon: "error", 15 | title: "No se actualizó correctamente", 16 | showConfirmButton: false, 17 | timer: 1500, 18 | }); 19 | } 20 | }) 21 | .catch((error) => { 22 | Swal.fire({ 23 | position: "center", 24 | icon: "error", 25 | title: "Error en la solicitud:" + error, // Maneja el error de acuerdo a tus necesidades 26 | showConfirmButton: false, 27 | timer: 1500, 28 | }); 29 | }); 30 | }; 31 | -------------------------------------------------------------------------------- /Front/assets/script/data/deleteTask.js: -------------------------------------------------------------------------------- 1 | import { path } from "../data/path.js"; 2 | 3 | export const deleteTask = async (id) => { 4 | const url = path + "delete/" + id; 5 | fetch(url, { 6 | method: "DELETE", 7 | }) 8 | .then((res) => { 9 | if (res.ok) { 10 | Swal.fire({ 11 | //luego de copiar aparece un pop up de exito 12 | position: "center", 13 | icon: "success", 14 | title: "Tarea eliminada", 15 | showConfirmButton: false, 16 | timer: 2500, 17 | }); 18 | setTimeout(() => { 19 | window.location.href = "index.html"; 20 | }, 2500); 21 | } else { 22 | Swal.fire({ 23 | position: "center", 24 | icon: "error", 25 | title: "No se eliminó correctamente", 26 | showConfirmButton: false, 27 | timer: 1500, 28 | }); 29 | } 30 | }) 31 | .catch((error) => { 32 | Swal.fire({ 33 | position: "center", 34 | icon: "error", 35 | title: "Error en la solicitud:" + error, // Maneja el error de acuerdo a tus necesidades 36 | showConfirmButton: false, 37 | timer: 1500, 38 | }); 39 | }); 40 | }; 41 | -------------------------------------------------------------------------------- /Front/assets/script/data/getTasks.js: -------------------------------------------------------------------------------- 1 | import { path } from "../data/path.js"; 2 | 3 | export const getTasks = async () => { 4 | const response = await fetch(path+"all"); 5 | const tasks = await response.json(); 6 | 7 | return tasks; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /Front/assets/script/data/path.js: -------------------------------------------------------------------------------- 1 | export const path= "http://127.0.0.1:8080/api/v1/tasks/"; -------------------------------------------------------------------------------- /Front/assets/script/data/sendTask.js: -------------------------------------------------------------------------------- 1 | import { path } from "./path.js"; 2 | 3 | export const sendTask = (taskObj) => { 4 | const url = `${path}create`; 5 | fetch(url, { 6 | method: "POST", 7 | body: JSON.stringify(taskObj), 8 | headers: { 9 | "Content-Type": "application/json", 10 | }, 11 | }).then((res) => { 12 | if (res.ok) { 13 | window.location.href = "index.html"; 14 | } else { 15 | Swal.fire({ 16 | position: "center", 17 | icon: "error", 18 | title: "No se actualizó correctamente", 19 | showConfirmButton: false, 20 | timer: 1500, 21 | }); 22 | } 23 | }) 24 | .catch((error) => { 25 | console.log("Error en la solicitud:" + error, )// Maneja el error de acuerdo a tus necesidades 26 | }); 27 | }; 28 | -------------------------------------------------------------------------------- /Front/assets/script/script.js: -------------------------------------------------------------------------------- 1 | import { addTask } from "./components/addTask.js"; 2 | import { displayTasks } from "./components/displayTasks.js"; 3 | 4 | const btn = document.querySelector("[data-form-btn]");//guardamos la acción del boton formulario 5 | 6 | btn.addEventListener("click", addTask); 7 | 8 | displayTasks(); -------------------------------------------------------------------------------- /Front/assets/script/service/date.js: -------------------------------------------------------------------------------- 1 | export const uniqueDates = (tasks) => { 2 | const unique = []; 3 | 4 | tasks.forEach((task) => { 5 | if(!unique.includes(task.date)){ 6 | unique.push(task.date); 7 | } 8 | }); 9 | return unique; 10 | }; 11 | 12 | export const orderDates = (dates) => { //ordena cada fecha de la mas antigua a la mas moderna / furura 13 | return dates.sort((a, b) => { 14 | const firstDate = moment(a, "DD/MM/YYYY"); 15 | const secondDate = moment(b, "DD/MM/YYYY"); 16 | return firstDate - secondDate; 17 | }).map(date => moment(date, "YYYY-MM-DD").format("DD/MM/YYYY")); 18 | }; 19 | 20 | export const orderTimes = (dates) => { //ordena los horarios 21 | return dates.sort((a, b) => { 22 | const firstTime = moment(a, "LT"); 23 | const secondTime = moment(b, "LT"); 24 | return firstTime - secondTime; 25 | }); 26 | }; -------------------------------------------------------------------------------- /Front/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TODO App 8 | 9 | 10 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | UTN FRSR 27 | 28 | 29 | 37 | 38 | 39 | Agregar 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # ToDo-API 3 | 4 | 5 | Este Repositorio contiene una Página para la Gestión de Tareas - ToDo con Spring Boot. 6 | 7 | 8 | 9 | Pagina creada donde utilizamos HTML, CSS y JavaScript en la Web, para el consumo de la API creada con Java y utilizando el Framework de Spring y su herramienta de Spring Boot 10 | 11 | Esta página permite Agregar taréas a realizar, Marcarlas como Realizadas y también Eliminarlas. Almacenandolas en la base de datos y ordenandolas por fecha y horario. Todo esto se realiza mediante la utilización de los endpoints que provee la API. Esto se puede realizarlo mediante funciones en JavaScript, que permite crear elementos, agregar clases y modificarlas e incluso eliminar esos elementos creados dinamicamente. 12 | 13 | Base de Datos: de tipo Relacional, MySQL 14 | 15 | Swagger: Herramienta utilizada para la documentación de la API-REST 16 | 17 | Postman: Herramienta utilizada para el testeo de la API-REST 18 | 19 | ## Backend 20 | 21 | ### Versiones utilizadas: 22 | 23 | * Java Development Kit (JDK) 17 24 | * Spring Boot 3.0.2 25 | 26 | ### Dependencias utilizadas para el proyecto: 27 | 28 | * spring-boot-starter-web 29 | * spring-boot-starter-test 30 | * spring-boot-starter-data-jpa 31 | * spring-boot-devtools 32 | * mysql-connector-j 33 | * lombok 34 | * jakarta.validation-api 35 | * springdoc-openapi-ui 36 | * hibernate-validator 37 | 38 | #### Para Crear el proyecto desde cero: 39 | 40 | 1. Ingresar a la página de Spring Initializr: https://start.spring.io/ 41 | 2. Seleccionar las dependencias necesarias para el proyecto 42 | 43 |  44 | 3. Descargar el proyecto 45 | 4. Descomprimir el proyecto 46 | 5. Abrir el proyecto en un IDE (Eclipse, IntelliJ, NetBeans, etc) 47 | 6. Agregar las dependencias restantes que no se encontraron en la página en el archivo "pom.xml" (conforme lista de dependencias anterior) 48 | 49 | ### Pasos para iniciar el proyecto: 50 | 51 | 1. Clonar el repositorio desde el GitHub 52 | 53 |  54 | 2. Abrir el proyecto en un IDE (Eclipse, IntelliJ, NetBeans, etc) 55 | 3. Modificar el archivo "application.yml" con el usuario y contraseña de la base de datos. 56 | 57 |  58 | 4. (Opcional) en caso de no querer exponer el usuario y contraseña de la base de datos en el archivo "application.yml", se puede crear variables de entorno en el sistema operativo y llamarlas desde el archivo "application.yml" de la siguiente manera: 59 | - En la barra superior al lado del martillo verde (build), aparece el nombre del proyecto, hacer click y seleccionar "Edit Configurations..." 60 | - En la ventana que se abre, en la parte central de la pantalla seleccionar "Environment variables:" agregar las variables de entorno con el nombre de "DB_USER" y "DB_PASSWORD" y el valor correspondiente a cada una. 61 | 62 |  63 |  64 | 5. La base de datos en MySQL con el nombre de "db_todo_api" se creará automaticamente cuando el proyecto se inicie por primera vez. 65 | 6. (Opcional) en caso de necesidad de apertura de puertos: Utilizar sistema de gestión de bases de datos: en mi caso XAMP, para abrir los puertos de conexión. 66 | 7. Iniciar el proyecto desde el IDE 67 | 68 | ### Endpoints de la API 69 | 70 | #### POST 71 | 72 | El endpoint de creación de tareas es: http://localhost:8080/api/v1/tasks/create 73 | 74 | En el body del request se debe enviar un JSON con el siguiente formato: 75 | 76 | ```json 77 | { 78 | "title": "Tarea 1", 79 | "date": "2021-10-10", 80 | "time": "10:00" 81 | } 82 | ``` 83 | 84 | #### GET 85 | 86 | El endpoint de obtención de tareas es: http://localhost:8080/api/v1/tasks/all 87 | 88 | #### PATCH 89 | 90 | El endpoint de actualización del estado de la tarea es: http://localhost:8080/api/v1/tasks/mark_as_finished/{id}/{finished} 91 | 92 | Entiendase que como id se debe enviar el "ID" de la tarea que se desea actualizar y como finished se debe enviar un booleano (true o false) para indicar si la tarea se encuentra finalizada o no. 93 | 94 | #### DELETE 95 | 96 | El endpoint de eliminación de tareas es: http://localhost:8080/api/v1/tasks/delete/{id} 97 | 98 | Entiendase que como id se debe enviar el "ID" de la tarea que se desea eliminar. 99 | 100 | ### Testeo de la API 101 | 102 | Para el testeo de la API se utilizó la herramienta Postman. 103 | 104 | Para ello comparto el Postman que tiene todas las pruebas realizadas para la API. Se puede descargar desde el siguiente link: [https://github.com/lokywolf2295/ToDo_Front_-_API/Tasks.postman_collection.json](https://github.com/lokywolf2295/ToDo_Front_-_API/blob/test/Tasks.postman_collection.json) 105 | 106 |  107 | ### Documentación de la API 108 | 109 | Para la documentación de la API se utilizó la herramienta Swagger. 110 | 111 | Para acceder a la documentación de la API se debe ingresar a la siguiente URL: http://localhost:8080/swagger-ui/index.html 112 | 113 |  114 | ## Frontend 115 | 116 | En el Frontend se utilizó HTML, CSS y JavaScript para la creación de la página web. No se utilizaron Frameworks de CSS ni de JavaScript. 117 | Haciendo que esta página sea estática pero si responsive. 118 | 119 |  120 | 121 | ### De donde saco los ejemplos de alertas, botones, etc? 122 | 123 | Usando la página SweetAlert2: https://sweetalert2.github.io/#examples, usamos los ejemplos que nos provee la página y los adaptamos a nuestro proyecto. Esto siempre va a depender de que necesidades de efectos tenemos. 124 | 125 |  126 | 127 | ### Para correr la app 128 | 129 | Uso la extensión de Live Server para poder correr la aplicación en un servidor local y que permite ver los cambios que se realizan en el codigo, de manera automática luego de guardar los cambios y sin necesidad de volver a correr la aplicación nuevamente. -------------------------------------------------------------------------------- /Tasks.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "e49c6c10-aaf3-4e6a-8a1d-7795f532f2bc", 4 | "name": "Tasks", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", 6 | "_exporter_id": "26002575" 7 | }, 8 | "item": [ 9 | { 10 | "name": "Create Task", 11 | "request": { 12 | "method": "POST", 13 | "header": [], 14 | "body": { 15 | "mode": "raw", 16 | "raw": "{\r\n \"title\": \"Tarea 1\",\r\n \"date\": \"2021-10-10\",\r\n \"time\": \"10:00\"\r\n}", 17 | "options": { 18 | "raw": { 19 | "language": "json" 20 | } 21 | } 22 | }, 23 | "url": { 24 | "raw": "localhost:8080/api/v1/tasks/create", 25 | "host": [ 26 | "localhost" 27 | ], 28 | "port": "8080", 29 | "path": [ 30 | "api", 31 | "v1", 32 | "tasks", 33 | "create" 34 | ] 35 | } 36 | }, 37 | "response": [] 38 | }, 39 | { 40 | "name": "Get All Taks", 41 | "request": { 42 | "method": "GET", 43 | "header": [], 44 | "url": { 45 | "raw": "localhost:8080/api/v1/tasks/all", 46 | "host": [ 47 | "localhost" 48 | ], 49 | "port": "8080", 50 | "path": [ 51 | "api", 52 | "v1", 53 | "tasks", 54 | "all" 55 | ] 56 | } 57 | }, 58 | "response": [] 59 | }, 60 | { 61 | "name": "Update Status Task", 62 | "request": { 63 | "method": "PATCH", 64 | "header": [], 65 | "url": { 66 | "raw": "localhost:8080/api/v1/tasks/mark_as_finished/4/true", 67 | "host": [ 68 | "localhost" 69 | ], 70 | "port": "8080", 71 | "path": [ 72 | "api", 73 | "v1", 74 | "tasks", 75 | "mark_as_finished", 76 | "4", 77 | "true" 78 | ] 79 | } 80 | }, 81 | "response": [] 82 | }, 83 | { 84 | "name": "Delete Task", 85 | "request": { 86 | "method": "DELETE", 87 | "header": [], 88 | "url": { 89 | "raw": "localhost:8080/api/v1/tasks/delete/4", 90 | "host": [ 91 | "localhost" 92 | ], 93 | "port": "8080", 94 | "path": [ 95 | "api", 96 | "v1", 97 | "tasks", 98 | "delete", 99 | "4" 100 | ] 101 | } 102 | }, 103 | "response": [] 104 | } 105 | ] 106 | } -------------------------------------------------------------------------------- /db_todo_api.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.2.0 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Servidor: 127.0.0.1 6 | -- Tiempo de generación: 19-07-2023 a las 00:42:06 7 | -- Versión del servidor: 10.4.27-MariaDB 8 | -- Versión de PHP: 8.0.25 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- Base de datos: `db_todo_api` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- Estructura de tabla para la tabla `task` 28 | -- 29 | 30 | CREATE TABLE `task` ( 31 | `id` bigint(20) NOT NULL, 32 | `created_date` datetime(6) NOT NULL, 33 | `date` date NOT NULL, 34 | `enable` bit(1) DEFAULT NULL, 35 | `finished` bit(1) NOT NULL, 36 | `time` time NOT NULL, 37 | `title` varchar(256) NOT NULL 38 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 39 | 40 | -- 41 | -- Volcado de datos para la tabla `task` 42 | -- 43 | 44 | INSERT INTO `task` (`id`, `created_date`, `date`, `enable`, `finished`, `time`, `title`) VALUES 45 | (1, '2023-05-27 22:56:24.000000', '2023-05-28', b'1', b'0', '12:30:00', 'Realizar el Front de la Página ToDo'), 46 | (2, '2023-05-27 22:57:00.000000', '2023-05-30', b'1', b'0', '17:40:00', 'Realizar el Back de la Página ToDo'), 47 | (3, '2023-05-27 22:58:36.000000', '2023-06-02', b'1', b'0', '19:20:00', 'Hacer el deploy de la Página ToDo'), 48 | (52, '2023-05-28 13:44:18.000000', '2023-05-29', b'1', b'0', '10:15:00', 'Revisar que el diseño esté correcto'), 49 | (102, '2023-05-31 13:14:52.000000', '2023-05-31', b'1', b'0', '13:30:00', 'Prueba de Swagger'); 50 | 51 | -- -------------------------------------------------------- 52 | 53 | -- 54 | -- Estructura de tabla para la tabla `task_seq` 55 | -- 56 | 57 | CREATE TABLE `task_seq` ( 58 | `next_val` bigint(20) DEFAULT NULL 59 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 60 | 61 | -- 62 | -- Volcado de datos para la tabla `task_seq` 63 | -- 64 | 65 | INSERT INTO `task_seq` (`next_val`) VALUES 66 | (201); 67 | 68 | -- 69 | -- Índices para tablas volcadas 70 | -- 71 | 72 | -- 73 | -- Indices de la tabla `task` 74 | -- 75 | ALTER TABLE `task` 76 | ADD PRIMARY KEY (`id`); 77 | COMMIT; 78 | 79 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 80 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 81 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 82 | --------------------------------------------------------------------------------