athrainsky 1 year ago
commit
80ff032f76
37 changed files with 4250 additions and 0 deletions
  1. 33 0
      .gitignore
  2. BIN
      .mvn/wrapper/maven-wrapper.jar
  3. 2 0
      .mvn/wrapper/maven-wrapper.properties
  4. 581 0
      hs_err_pid9528.log
  5. 308 0
      mvnw
  6. 205 0
      mvnw.cmd
  7. 111 0
      pom.xml
  8. 1938 0
      replay_pid9528.log
  9. 11 0
      src/main/kotlin/com/server/alb/AlbApplication.kt
  10. 15 0
      src/main/kotlin/com/server/alb/configs/MvcConfig.kt
  11. 61 0
      src/main/kotlin/com/server/alb/configs/WebSecurityConfig.kt
  12. 169 0
      src/main/kotlin/com/server/alb/controllers/BugController.kt
  13. 83 0
      src/main/kotlin/com/server/alb/models/ListBug.kt
  14. 20 0
      src/main/kotlin/com/server/alb/models/Platform.kt
  15. 17 0
      src/main/kotlin/com/server/alb/models/Project.kt
  16. 15 0
      src/main/kotlin/com/server/alb/models/Role.kt
  17. 21 0
      src/main/kotlin/com/server/alb/models/Status.kt
  18. 32 0
      src/main/kotlin/com/server/alb/models/User.kt
  19. 14 0
      src/main/kotlin/com/server/alb/repositories/ListBugRepository.kt
  20. 11 0
      src/main/kotlin/com/server/alb/repositories/PlatformRepository.kt
  21. 6 0
      src/main/kotlin/com/server/alb/repositories/ProjectRepository.kt
  22. 14 0
      src/main/kotlin/com/server/alb/repositories/UserRepository.kt
  23. 27 0
      src/main/kotlin/com/server/alb/services/BugService.kt
  24. 17 0
      src/main/kotlin/com/server/alb/services/BugValidationService.kt
  25. 49 0
      src/main/kotlin/com/server/alb/services/MyUserDetails.kt
  26. 18 0
      src/main/kotlin/com/server/alb/services/PlatformService.kt
  27. 18 0
      src/main/kotlin/com/server/alb/services/ProjectService.kt
  28. 19 0
      src/main/kotlin/com/server/alb/services/UserDetailsServiceImpl.kt
  29. 18 0
      src/main/kotlin/com/server/alb/services/UserService.kt
  30. 4 0
      src/main/resources/application.properties
  31. 10 0
      src/main/resources/templates/403.html
  32. 65 0
      src/main/resources/templates/add_bug.html
  33. 106 0
      src/main/resources/templates/edit_bug.html
  34. 90 0
      src/main/resources/templates/inPro.html
  35. 90 0
      src/main/resources/templates/index.html
  36. 39 0
      src/main/resources/templates/login.html
  37. 13 0
      src/test/kotlin/com/server/alb/AlbApplicationTests.kt

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

BIN
.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

File diff suppressed because it is too large
+ 581 - 0
hs_err_pid9528.log


+ 308 - 0
mvnw

@@ -0,0 +1,308 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Apache Maven Wrapper startup batch script, version 3.2.0
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /usr/local/etc/mavenrc ] ; then
+    . /usr/local/etc/mavenrc
+  fi
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "$(uname)" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
+      else
+        JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=$(java-config --jre-home)
+  fi
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
+    JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="$(which javac)"
+  if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=$(which readlink)
+    if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
+      if $darwin ; then
+        javaHome="$(dirname "\"$javaExecutable\"")"
+        javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
+      else
+        javaExecutable="$(readlink -f "\"$javaExecutable\"")"
+      fi
+      javaHome="$(dirname "\"$javaExecutable\"")"
+      javaHome=$(expr "$javaHome" : '\(.*\)/bin')
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=$(cd "$wdir/.." || exit 1; pwd)
+    fi
+    # end of workaround
+  done
+  printf '%s' "$(cd "$basedir" || exit 1; pwd)"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    # Remove \r in case we run on Windows within Git Bash
+    # and check out the repository with auto CRLF management
+    # enabled. Otherwise, we may read lines that are delimited with
+    # \r\n and produce $'-Xarg\r' rather than -Xarg due to word
+    # splitting rules.
+    tr -s '\r\n' ' ' < "$1"
+  fi
+}
+
+log() {
+  if [ "$MVNW_VERBOSE" = true ]; then
+    printf '%s\n' "$1"
+  fi
+}
+
+BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
+log "$MAVEN_PROJECTBASEDIR"
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
+if [ -r "$wrapperJarPath" ]; then
+    log "Found $wrapperJarPath"
+else
+    log "Couldn't find $wrapperJarPath, downloading it ..."
+
+    if [ -n "$MVNW_REPOURL" ]; then
+      wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+    else
+      wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+    fi
+    while IFS="=" read -r key value; do
+      # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
+      safeValue=$(echo "$value" | tr -d '\r')
+      case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
+      esac
+    done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
+    log "Downloading from: $wrapperUrl"
+
+    if $cygwin; then
+      wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
+    fi
+
+    if command -v wget > /dev/null; then
+        log "Found wget ... using wget"
+        [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        else
+            wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        log "Found curl ... using curl"
+        [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
+        else
+            curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
+        fi
+    else
+        log "Falling back to using Java to download"
+        javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaSource=$(cygpath --path --windows "$javaSource")
+          javaClass=$(cygpath --path --windows "$javaClass")
+        fi
+        if [ -e "$javaSource" ]; then
+            if [ ! -e "$javaClass" ]; then
+                log " - Compiling MavenWrapperDownloader.java ..."
+                ("$JAVA_HOME/bin/javac" "$javaSource")
+            fi
+            if [ -e "$javaClass" ]; then
+                log " - Running MavenWrapperDownloader.java ..."
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+# If specified, validate the SHA-256 sum of the Maven wrapper jar file
+wrapperSha256Sum=""
+while IFS="=" read -r key value; do
+  case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
+  esac
+done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
+if [ -n "$wrapperSha256Sum" ]; then
+  wrapperSha256Result=false
+  if command -v sha256sum > /dev/null; then
+    if echo "$wrapperSha256Sum  $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
+      wrapperSha256Result=true
+    fi
+  elif command -v shasum > /dev/null; then
+    if echo "$wrapperSha256Sum  $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
+      wrapperSha256Result=true
+    fi
+  else
+    echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
+    echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
+    exit 1
+  fi
+  if [ $wrapperSha256Result = false ]; then
+    echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
+    echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
+    echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
+    exit 1
+  fi
+fi
+
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+# shellcheck disable=SC2086 # safe args
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  $MAVEN_DEBUG_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 205 - 0
mvnw.cmd

@@ -0,0 +1,205 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Apache Maven Wrapper startup batch script, version 3.2.0
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Found %WRAPPER_JAR%
+    )
+) else (
+    if not "%MVNW_REPOURL%" == "" (
+        SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %WRAPPER_URL%
+    )
+
+    powershell -Command "&{"^
+		"$webclient = new-object System.Net.WebClient;"^
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+		"}"^
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
+SET WRAPPER_SHA_256_SUM=""
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
+)
+IF NOT %WRAPPER_SHA_256_SUM%=="" (
+    powershell -Command "&{"^
+       "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
+       "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
+       "  Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
+       "  Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
+       "  Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
+       "  exit 1;"^
+       "}"^
+       "}"
+    if ERRORLEVEL 1 goto error
+)
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% ^
+  %JVM_CONFIG_MAVEN_PROPS% ^
+  %MAVEN_OPTS% ^
+  %MAVEN_DEBUG_OPTS% ^
+  -classpath %WRAPPER_JAR% ^
+  "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
+  %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
+if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%"=="on" pause
+
+if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
+
+cmd /C exit /B %ERROR_CODE%

+ 111 - 0
pom.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.springframework.boot</groupId>
+		<artifactId>spring-boot-starter-parent</artifactId>
+		<version>3.1.4</version>
+		<relativePath/> <!-- lookup parent from repository -->
+	</parent>
+	<groupId>com.example</groupId>
+	<artifactId>ALB</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+	<name>ALB</name>
+	<description>Aplikasi List Bug</description>
+	<properties>
+		<java.version>17</java.version>
+		<kotlin.version>1.8.22</kotlin.version>
+	</properties>
+	<dependencies>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-data-jpa</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-security</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-thymeleaf</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-validation</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-web</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.module</groupId>
+			<artifactId>jackson-module-kotlin</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jetbrains.kotlin</groupId>
+			<artifactId>kotlin-reflect</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jetbrains.kotlin</groupId>
+			<artifactId>kotlin-stdlib</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.thymeleaf.extras</groupId>
+			<artifactId>thymeleaf-extras-springsecurity6</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.mysql</groupId>
+			<artifactId>mysql-connector-j</artifactId>
+			<scope>runtime</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.security</groupId>
+			<artifactId>spring-security-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
+		<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>org.jetbrains.kotlin</groupId>
+				<artifactId>kotlin-maven-plugin</artifactId>
+				<configuration>
+					<args>
+						<arg>-Xjsr305=strict</arg>
+					</args>
+					<compilerPlugins>
+						<plugin>spring</plugin>
+						<plugin>jpa</plugin>
+					</compilerPlugins>
+				</configuration>
+				<dependencies>
+					<dependency>
+						<groupId>org.jetbrains.kotlin</groupId>
+						<artifactId>kotlin-maven-allopen</artifactId>
+						<version>${kotlin.version}</version>
+					</dependency>
+					<dependency>
+						<groupId>org.jetbrains.kotlin</groupId>
+						<artifactId>kotlin-maven-noarg</artifactId>
+						<version>${kotlin.version}</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

File diff suppressed because it is too large
+ 1938 - 0
replay_pid9528.log


+ 11 - 0
src/main/kotlin/com/server/alb/AlbApplication.kt

@@ -0,0 +1,11 @@
+package com.server.alb
+
+import org.springframework.boot.autoconfigure.SpringBootApplication
+import org.springframework.boot.runApplication
+
+@SpringBootApplication
+class AlbApplication
+
+fun main(args: Array<String>) {
+    runApplication<AlbApplication>(*args)
+}

+ 15 - 0
src/main/kotlin/com/server/alb/configs/MvcConfig.kt

@@ -0,0 +1,15 @@
+package com.server.alb.configs
+
+import org.springframework.context.annotation.Configuration
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
+
+
+@Configuration
+class MvcConfig : WebMvcConfigurer {
+    override fun addViewControllers(registry: ViewControllerRegistry) {
+        registry.addViewController("/403").setViewName("403")
+        registry.addViewController("/login").setViewName("login")
+        registry.addViewController("/inPro").setViewName("inPro")
+    }
+}

+ 61 - 0
src/main/kotlin/com/server/alb/configs/WebSecurityConfig.kt

@@ -0,0 +1,61 @@
+package com.server.alb.configs
+
+import com.server.alb.services.UserDetailsServiceImpl
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.security.authentication.dao.DaoAuthenticationProvider
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
+import org.springframework.security.config.annotation.web.builders.HttpSecurity
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
+import org.springframework.security.core.userdetails.UserDetailsService
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
+import org.springframework.security.web.SecurityFilterChain
+
+
+@Configuration
+@EnableWebSecurity
+class WebSecurityConfig {
+
+    @Bean
+    @Throws(Exception::class)
+    fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
+        http.authorizeHttpRequests { requests ->
+            requests.requestMatchers("/").hasAnyAuthority("QC", "PROGRAMMER", "ADMIN")
+            requests.requestMatchers("/inPro").hasAnyAuthority("QC", "PROGRAMMER", "ADMIN")
+            requests.requestMatchers("/new").hasAnyAuthority("ADMIN", "QC")
+            requests.requestMatchers("/edit/**").hasAnyAuthority("ADMIN", "QC", "PROGRAMMER")
+            requests.requestMatchers("/delete/**").hasAnyAuthority("ADMIN", "QC").anyRequest().authenticated()
+        }.formLogin { form ->
+            form.loginPage("/login").permitAll().defaultSuccessUrl("/")
+        }.logout { logout ->
+            logout.permitAll()
+        }.exceptionHandling { customizer ->
+            customizer.accessDeniedPage("/403")
+        }
+        return http.build()
+    }
+
+    @Bean
+    fun passwordEncoder(): BCryptPasswordEncoder {
+        return BCryptPasswordEncoder()
+    }
+
+    @Bean
+    fun userDetailsService(): UserDetailsService {
+        return UserDetailsServiceImpl()
+    }
+
+    @Bean
+    fun authenticationProvider(): DaoAuthenticationProvider {
+        val authProvider = DaoAuthenticationProvider()
+        authProvider.setUserDetailsService(userDetailsService())
+        authProvider.setPasswordEncoder(passwordEncoder())
+        return authProvider
+    }
+
+    @Throws(Exception::class)
+    protected fun configure(auth: AuthenticationManagerBuilder) {
+        auth.authenticationProvider(authenticationProvider())
+    }
+
+}

+ 169 - 0
src/main/kotlin/com/server/alb/controllers/BugController.kt

@@ -0,0 +1,169 @@
+package com.server.alb.controllers
+
+import com.server.alb.models.*
+import com.server.alb.repositories.ListBugRepository
+import com.server.alb.repositories.PlatformRepository
+import com.server.alb.repositories.ProjectRepository
+import com.server.alb.repositories.UserRepository
+import com.server.alb.services.BugService
+import com.server.alb.services.BugValidationService.Companion.isValid
+import com.server.alb.services.PlatformService
+import com.server.alb.services.UserService
+import jakarta.servlet.http.HttpServletRequest
+import jakarta.validation.Valid
+import org.springframework.security.authentication.AnonymousAuthenticationToken
+import org.springframework.security.core.Authentication
+import org.springframework.security.core.context.SecurityContextHolder
+import org.springframework.stereotype.Controller
+import org.springframework.ui.Model
+import org.springframework.validation.BindingResult
+import org.springframework.web.bind.annotation.*
+import org.springframework.web.servlet.ModelAndView
+import org.springframework.web.servlet.mvc.support.RedirectAttributes
+
+
+@Controller
+@RequestMapping
+class BugController(
+    private val userRepository: UserRepository,
+    private val listBugRepository: ListBugRepository,
+    private val projectRepository: ProjectRepository,
+    private val platformRepository: PlatformRepository,
+    private val service: BugService,
+    private val serUser: UserService,
+    private val serPlatform: PlatformService
+) {
+    val qcResultType = Status.QCResultType.values()
+    val worList = Status.WorkedType.values()
+    val wStList = Status.WorkedStatusType.values()
+    val dStList = Status.DevStatusType.values()
+    val project: MutableIterable<Project> = this.projectRepository.findAll()
+    var proj1: String = "1"
+    var platform: MutableIterable<Platform> = this.platformRepository.findAll()
+    val user: MutableIterable<User> = this.userRepository.findAll()
+
+    @GetMapping(value = ["/login"])
+    fun showLoginForm(model: Model): String {
+        val authentication: Authentication? = SecurityContextHolder.getContext().authentication
+        return if (authentication == null || authentication is AnonymousAuthenticationToken) {
+            "login"
+        } else "redirect:/inPro"
+    }
+
+    @RequestMapping(value = ["/"])
+    fun viewHomePage(model: Model, pForm: String? = "", programmer: String? = "", proj: String? = proj1): String {
+        val listBugs = this.listBugRepository.done(pForm ?: "", programmer ?: "", proj ?: proj1).sortedBy { it.date }
+        model.addAttribute("project", project)
+        model.addAttribute("platform", platform)
+        model.addAttribute("user", user)
+        model.addAttribute("listBugs", listBugs)
+        return "index"
+    }
+
+    @RequestMapping(value = ["/inPro"])
+    fun viewInProgress(model: Model, pForm: String? = "", programmer: String? = "", proj: String? = proj1): String {
+        val listBugs = this.listBugRepository.inPro(pForm ?: "", programmer ?: "", proj ?: proj1).sortedBy { it.date }
+        model.addAttribute("project", project)
+        model.addAttribute("platform", platform)
+        model.addAttribute("user", user)
+        model.addAttribute("listBugs", listBugs)
+        return "inPro"
+    }
+
+    @GetMapping(value = ["/new"])
+    fun showNewBugForm(model: Model, proj: String? = proj1): String {
+        val bug = ListBug()
+        model.addAttribute("bug", bug)
+        model.addAttribute("user", user)
+        model.addAttribute("platform", platform)
+        model.addAttribute("qcResultType", qcResultType)
+        return "add_bug"
+    }
+
+    @PostMapping(value = ["/new"])
+    fun submitNewBugForm(
+        @Valid @ModelAttribute("bug") bug: ListBug,
+        bindingResult: BindingResult,
+        redirectAttributes: RedirectAttributes,
+        model: Model,
+        proj: String? = proj1
+    ): String {
+        if (bug.qcId == null) {
+            val myUserDetails = SecurityContextHolder.getContext().authentication.name
+            val userLogin = userRepository.findByUsername(myUserDetails)
+            if (userLogin.isPresent) {
+                bug.qcId = userLogin.get()
+            }
+        }
+        println(bug)
+        return if (bindingResult.hasErrors()) {
+            model.addAttribute("user", user)
+            model.addAttribute("platform", platform)
+            model.addAttribute("qcResultType", qcResultType)
+            "add_bug"
+        } else {
+            service.save(bug)
+            redirectAttributes.addFlashAttribute("successMessage", "Success save bug")
+            "redirect:/inPro"
+        }
+    }
+
+    @RequestMapping(value = ["/save"], method = [RequestMethod.POST])
+    fun saveBug(
+        @Valid @ModelAttribute("bug") bug: ListBug,
+        redirectAttributes: RedirectAttributes,
+        result: BindingResult,
+        request: HttpServletRequest
+    ): String {
+        val referer: String = request.getHeader("Referer")
+        if (bug.qcId == null) {
+            val myUserDetails = SecurityContextHolder.getContext().authentication.name
+            val userLogin = userRepository.findByUsername(myUserDetails)
+            if (userLogin.isPresent) {
+                bug.qcId = userLogin.get()
+            }
+        }
+        val successMessage: String = if (isValid(bug)) {
+            service.save(bug)
+            "Success save bug"
+        } else {
+            "Failed ! Please try again"
+        }
+        redirectAttributes.addFlashAttribute("successMessage", successMessage)
+        return if (referer.endsWith("=index")) "redirect:/" else "redirect:/inPro"
+    }
+
+    @RequestMapping("/edit/{id}")
+    fun showEditBugForm(@PathVariable(name = "id") id: Long, @RequestParam page: String): ModelAndView {
+        val mav = ModelAndView("edit_bug")
+        val bug: ListBug = service[id]
+        val userQc: User = serUser[bug.qcId?.id]
+        val userPro: User = serUser[bug.proId?.id]
+        val plat: Platform = serPlatform[bug.platform!!.id]
+        mav.addObject("listQc", userQc)
+        mav.addObject("listPro", userPro)
+        mav.addObject("platform", plat)
+        mav.addObject("bug", bug)
+        mav.addObject("worList", worList)
+        mav.addObject("wStList", wStList)
+        mav.addObject("dStList", dStList)
+        mav.addObject("qcResultType", qcResultType)
+        return mav
+    }
+
+    @RequestMapping("/delete/{id}")
+    fun deleteBug(@PathVariable(name = "id") id: Long): String {
+        service[id]
+        service.delete(id)
+        return "redirect:/"
+    }
+
+    @RequestMapping("/delete2/{id}")
+    fun delete2Bug(@PathVariable(name = "id") id: Long): String {
+        service[id]
+        service.delete(id)
+        return "redirect:/inPro"
+    }
+
+}
+

+ 83 - 0
src/main/kotlin/com/server/alb/models/ListBug.kt

@@ -0,0 +1,83 @@
+package com.server.alb.models
+
+import jakarta.persistence.*
+import jakarta.validation.constraints.NotBlank
+import jakarta.validation.constraints.NotNull
+import org.springframework.format.annotation.DateTimeFormat
+import java.util.*
+import kotlin.jvm.Transient
+
+@Entity
+@Table(name = "list_bug")
+class ListBug {
+
+    @Id
+    @Column(name = "bug_id")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    var id: Long = 0
+
+    @NotNull(message = "Tanggal tidak boleh null")
+    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
+    var date: Date? = null
+
+    @ManyToOne
+    @JoinColumn(
+        name = "qcId", referencedColumnName = "user_id", foreignKey = ForeignKey(name = "FK_qcBug")
+    )
+    var qcId: User? = null
+
+    @ManyToOne
+    @JoinColumn(
+        name = "platform", referencedColumnName = "platform_id", foreignKey = ForeignKey(name = "FK_plaBug")
+    )
+    @NotNull(message = "Platform jangan blank")
+    var platform: Platform? = null
+
+    @NotBlank(message = "Link Good Day tidak boleh empty")
+    var link: String? = null
+
+    @NotBlank(message = "Hasil QC jangan blank")
+    var result: String? = null
+
+    @NotBlank(message = "Bug tidak boleh kosong")
+    @Column(columnDefinition = "varchar(500)")
+    var description: String = ""
+    var imgLink: String = ""
+
+    @ManyToOne
+    @JoinColumn(
+        name = "proId", referencedColumnName = "user_id", foreignKey = ForeignKey(name = "FK_proBug")
+    )
+    @NotNull(message = "Programmer jangan blank")
+    var proId: User? = null
+    var worked: String = "FALSE"
+    var workStat: String = "FALSE"
+    var development: String = ""
+    var devStat: String = "FALSE"
+
+    @Transient
+    var _displayWorked: String? = null
+
+    @Transient
+    var _displayWorkStat: String? = null
+
+    @Transient
+    var _displayDevStat: String? = null
+
+    @Transient
+    var _displayResult: String? = null
+
+    @PostLoad
+    fun onLoad() {
+        _displayWorked = Status.WorkedType.valueOf(worked).display
+        _displayWorkStat = Status.WorkedStatusType.valueOf(workStat).display
+        _displayDevStat = Status.DevStatusType.valueOf(devStat).display
+        _displayResult = Status.QCResultType.valueOf(result!!).display
+
+    }
+
+    override fun toString(): String {
+        return ("Bug [date=$date,description=$description, devStat=$devStat, development=$development, imgLink=$imgLink, link=$link, result=$result, workStat=$workStat, worked=$worked, platform=$platform, proId=$proId, qcId=$qcId]")
+    }
+
+}

+ 20 - 0
src/main/kotlin/com/server/alb/models/Platform.kt

@@ -0,0 +1,20 @@
+package com.server.alb.models
+
+import jakarta.persistence.*
+
+@Entity
+@Table(name = "platforms")
+class Platform {
+    @Id
+    @Column(name = "platform_id")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    var id: Long = 0
+    var name: String = ""
+
+    @OneToMany(mappedBy = "platform", cascade = [CascadeType.ALL], orphanRemoval = true)
+    var platform: List<ListBug> = mutableListOf()
+
+    @ManyToOne
+    @JoinColumn(name = "project", referencedColumnName = "project_id", foreignKey = ForeignKey(name = "FK_plaPro"))
+    var project: Project? = null
+}

+ 17 - 0
src/main/kotlin/com/server/alb/models/Project.kt

@@ -0,0 +1,17 @@
+package com.server.alb.models
+
+import jakarta.persistence.*
+
+@Entity
+@Table(name = "projects")
+class Project {
+    @Id
+    @Column(name = "project_id")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    var id: Long = 0
+    var name: String = ""
+    var description: String = ""
+
+    @OneToMany(mappedBy = "project", cascade = [CascadeType.ALL], orphanRemoval = true)
+    var project: List<Platform> = mutableListOf()
+}

+ 15 - 0
src/main/kotlin/com/server/alb/models/Role.kt

@@ -0,0 +1,15 @@
+package com.server.alb.models
+
+import jakarta.persistence.*
+
+@Entity
+@Table(name = "roles")
+class Role {
+
+    @Id
+    @Column(name = "role_id")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    var id: Long = 0
+    var name: String = ""
+
+}

+ 21 - 0
src/main/kotlin/com/server/alb/models/Status.kt

@@ -0,0 +1,21 @@
+package com.server.alb.models
+
+class Status {
+
+    enum class WorkedType(val display: String) {
+        TRUE("OK"), FALSE("-")
+    }
+
+    enum class WorkedStatusType(val display: String) {
+        DONE("DONE"), PENDING("Masih Kejadian"), FALSE("-")
+    }
+
+    enum class DevStatusType(val display: String) {
+        DONE("DONE"), FALSE("-")
+    }
+
+    enum class QCResultType(val display: String) {
+        XMINOR("X - MINOR"), XMAJOR("X - MAJOR"), XMODERATE("X - MODERATE"), NOTE("NOTE")
+    }
+
+}

+ 32 - 0
src/main/kotlin/com/server/alb/models/User.kt

@@ -0,0 +1,32 @@
+package com.server.alb.models
+
+import jakarta.persistence.*
+
+
+@Entity
+@Table(name = "users")
+class User {
+
+    @Id
+    @Column(name = "user_id")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    var id: Long = 0
+    var username: String = ""
+    var password: String = ""
+    var isEnabled = false
+
+    @ManyToMany(cascade = [CascadeType.ALL], fetch = FetchType.EAGER)
+    @JoinTable(
+        name = "users_roles",
+        joinColumns = [JoinColumn(name = "user_id")],
+        inverseJoinColumns = [JoinColumn(name = "role_id")]
+    )
+    var roles: Set<Role> = HashSet()
+
+    @OneToMany(mappedBy = "qcId", cascade = [CascadeType.ALL], orphanRemoval = true)
+    var qcId: List<ListBug> = mutableListOf()
+
+    @OneToMany(mappedBy = "proId", cascade = [CascadeType.ALL], orphanRemoval = true)
+    var proId: List<ListBug> = mutableListOf()
+
+}

+ 14 - 0
src/main/kotlin/com/server/alb/repositories/ListBugRepository.kt

@@ -0,0 +1,14 @@
+package com.server.alb.repositories
+
+import com.server.alb.models.ListBug
+import org.springframework.data.jpa.repository.JpaRepository
+import org.springframework.data.jpa.repository.Query
+
+interface ListBugRepository : JpaRepository<ListBug, Long> {
+
+    @Query("SELECT b.* FROM list_bug b WHERE (b.dev_stat = 'FALSE' AND b.work_stat = 'FALSE') AND platform LIKE %?1% AND pro_id LIKE %?2% AND platform IN (SELECT platform_id FROM platforms WHERE project LIKE %?3%)", nativeQuery = true)
+    fun inPro(pForm: String?, programmer: String?, project: String?): MutableList<ListBug>
+
+    @Query("SELECT b.* FROM list_bug b WHERE (b.dev_stat <> 'FALSE' OR b.work_stat <> 'FALSE') AND platform LIKE %?1% AND pro_id LIKE %?2% AND platform IN (SELECT platform_id FROM platforms WHERE project LIKE %?3%)", nativeQuery = true)
+    fun done(pForm: String?, programmer: String?, project: String?): MutableList<ListBug>
+}

+ 11 - 0
src/main/kotlin/com/server/alb/repositories/PlatformRepository.kt

@@ -0,0 +1,11 @@
+package com.server.alb.repositories
+
+import com.server.alb.models.Platform
+import org.springframework.data.jpa.repository.Query
+import org.springframework.data.repository.CrudRepository
+
+interface PlatformRepository : CrudRepository<Platform, Long> {
+
+    @Query("SELECT b.* FROM platforms b WHERE b.project LIKE %?1%", nativeQuery = true)
+    fun findByProject(project: String?): MutableList<Platform>
+}

+ 6 - 0
src/main/kotlin/com/server/alb/repositories/ProjectRepository.kt

@@ -0,0 +1,6 @@
+package com.server.alb.repositories
+
+import com.server.alb.models.Project
+import org.springframework.data.repository.CrudRepository
+
+interface ProjectRepository : CrudRepository<Project, Long>

+ 14 - 0
src/main/kotlin/com/server/alb/repositories/UserRepository.kt

@@ -0,0 +1,14 @@
+package com.server.alb.repositories
+
+import com.server.alb.models.User
+import org.springframework.data.jpa.repository.Query
+import org.springframework.data.repository.CrudRepository
+import java.util.*
+
+interface UserRepository : CrudRepository<User, Long> {
+
+    @Query("SELECT u FROM User u WHERE u.username = :username")
+    fun getUserByUsername(username: String): User
+
+    fun findByUsername(username: String): Optional<User>
+}

+ 27 - 0
src/main/kotlin/com/server/alb/services/BugService.kt

@@ -0,0 +1,27 @@
+package com.server.alb.services
+
+import com.server.alb.models.ListBug
+import com.server.alb.repositories.ListBugRepository
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+
+
+@Service
+class BugService {
+    @Autowired
+    private val repo: ListBugRepository? = null
+
+    fun save(bug: ListBug?) {
+        if (bug != null) {
+            repo!!.save(bug)
+        }
+    }
+
+    operator fun get(id: Long?): ListBug {
+        return repo!!.findById(id!!).get()
+    }
+
+    fun delete(id: Long?) {
+        repo!!.deleteById(id!!)
+    }
+}

+ 17 - 0
src/main/kotlin/com/server/alb/services/BugValidationService.kt

@@ -0,0 +1,17 @@
+package com.server.alb.services
+
+import com.server.alb.models.ListBug
+import io.micrometer.common.util.StringUtils
+import org.springframework.stereotype.Service
+
+
+@Service
+class BugValidationService {
+
+    companion object {
+        fun isValid(bug: ListBug?): Boolean {
+            return (bug != null && StringUtils.isNotBlank(bug.description) && StringUtils.isNotBlank(bug.link))
+        }
+    }
+
+}

+ 49 - 0
src/main/kotlin/com/server/alb/services/MyUserDetails.kt

@@ -0,0 +1,49 @@
+package com.server.alb.services
+
+import com.server.alb.models.Role
+import com.server.alb.models.User
+import org.springframework.security.core.GrantedAuthority
+import org.springframework.security.core.authority.SimpleGrantedAuthority
+import org.springframework.security.core.userdetails.UserDetails
+
+
+class MyUserDetails(user: User) : UserDetails {
+    private val user: User
+
+    init {
+        this.user = user
+    }
+
+    override fun getAuthorities(): Collection<GrantedAuthority?> {
+        val roles: Set<Role> = user.roles
+        val authorities: MutableList<SimpleGrantedAuthority?> = ArrayList()
+        for (role in roles) {
+            authorities.add(SimpleGrantedAuthority(role.name))
+        }
+        return authorities
+    }
+
+    override fun getPassword(): String {
+        return user.password
+    }
+
+    override fun getUsername(): String {
+        return user.username
+    }
+
+    override fun isAccountNonExpired(): Boolean {
+        return true
+    }
+
+    override fun isAccountNonLocked(): Boolean {
+        return true
+    }
+
+    override fun isCredentialsNonExpired(): Boolean {
+        return true
+    }
+
+    override fun isEnabled(): Boolean {
+        return user.isEnabled
+    }
+}

+ 18 - 0
src/main/kotlin/com/server/alb/services/PlatformService.kt

@@ -0,0 +1,18 @@
+package com.server.alb.services
+
+import com.server.alb.models.Platform
+import com.server.alb.repositories.PlatformRepository
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+
+
+@Service
+class PlatformService {
+    @Autowired
+    private val repo: PlatformRepository? = null
+
+    operator fun get(id: Long): Platform {
+        return repo!!.findById(id).get()
+    }
+
+}

+ 18 - 0
src/main/kotlin/com/server/alb/services/ProjectService.kt

@@ -0,0 +1,18 @@
+package com.server.alb.services
+
+import com.server.alb.models.Project
+import com.server.alb.repositories.ProjectRepository
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+
+
+@Service
+class ProjectService {
+    @Autowired
+    private val repo: ProjectRepository? = null
+
+    operator fun get(id: Long): Project {
+        return repo!!.findById(id).get()
+    }
+
+}

+ 19 - 0
src/main/kotlin/com/server/alb/services/UserDetailsServiceImpl.kt

@@ -0,0 +1,19 @@
+package com.server.alb.services
+
+import com.server.alb.repositories.UserRepository
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.security.core.userdetails.UserDetails
+import org.springframework.security.core.userdetails.UserDetailsService
+import org.springframework.security.core.userdetails.UsernameNotFoundException
+
+
+class UserDetailsServiceImpl : UserDetailsService {
+    @Autowired
+    private val userRepository: UserRepository? = null
+
+    @Throws(UsernameNotFoundException::class)
+    override fun loadUserByUsername(username: String): UserDetails {
+        val user = userRepository!!.getUserByUsername(username)
+        return MyUserDetails(user)
+    }
+}

+ 18 - 0
src/main/kotlin/com/server/alb/services/UserService.kt

@@ -0,0 +1,18 @@
+package com.server.alb.services
+
+import com.server.alb.models.User
+import com.server.alb.repositories.UserRepository
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.stereotype.Service
+
+
+@Service
+class UserService {
+    @Autowired
+    private val repo: UserRepository? = null
+
+    operator fun get(id: Long?): User {
+        return repo!!.findById(id!!).get()
+    }
+
+}

+ 4 - 0
src/main/resources/application.properties

@@ -0,0 +1,4 @@
+spring.jpa.hibernate.ddl-auto=update
+spring.datasource.url=jdbc:mysql://localhost:3306/bug3
+spring.datasource.username=root
+spring.datasource.password=root

+ 10 - 0
src/main/resources/templates/403.html

@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="ISO-8859-1">
+    <title>Access Denied</title>
+</head>
+<body>
+<h2>Sorry, you don't have permission!</h2>
+</body>
+</html>

+ 65 - 0
src/main/resources/templates/add_bug.html

@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+    <meta charset="ISO-8859-1">
+    <title>Add New Bug</title>
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet"
+          integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
+</head>
+<body>
+<div class="container py-5 h-100">
+    <h1>Add New Bug</h1>
+    <br/>
+    <form action="#" th:action="@{/new}" th:object="${bug}" method="post">
+        <table>
+            <tr>
+                <td>Tanggal QC</td>
+                <td><input type="date" pattern="dd-MM-yyyy" th:field="*{date}" class="form-control"></td>
+                <td th:if="${#fields.hasErrors('date')}" th:errors="*{date}" style="color:red">Tanggal Error</td>
+            </tr>
+            <tr>
+                <td>Platform:</td>
+                <td><select th:field="*{platform}">
+                    <option th:each="platform: ${platform}" th:value="${platform.id}" th:text="${platform.name}"/>
+                </select></td>
+                <td th:if="${#fields.hasErrors('platform')}" th:errors="*{platform}" style="color:red">Platform Error</td>
+            </tr>
+            <tr>
+                <td>Link Good Day:</td>
+                <td><input type="text" th:field="*{link}" class="form-control"/></td>
+                <td th:if="${#fields.hasErrors('link')}" th:errors="*{link}" style="color:red">Link Error</td>
+            </tr>
+            <tr>
+                <td>Hasil QC:</td>
+                <td><select th:field="*{result}">
+                    <option th:each="qcResultType: ${qcResultType}" th:value="${qcResultType}"
+                            th:text="${qcResultType.display}"/>
+                </select></td>
+                <td th:if="${#fields.hasErrors('result')}" th:errors="*{result}" style="color:red">Hasil QC Error</td>
+            </tr>
+            <tr>
+                <td>Bug:</td>
+                <td><input type="text" th:field="*{description}" class="form-control"/></td>
+                <td th:if="${#fields.hasErrors('description')}" th:errors="*{description}" style="color:red">Bug Error</td>
+            </tr>
+            <tr>
+                <td>Link Image:</td>
+                <td><input type="text" th:field="*{imgLink}" class="form-control"/></td>
+            </tr>
+            <tr>
+                <td>Programmer:</td>
+                <td><select th:field="*{proId}">
+                    <option th:each="user: ${user}" th:value="${user.id}" th:text="${user.username}"/>
+                </select></td>
+                <td th:if="${#fields.hasErrors('proId')}" th:errors="*{proId}" style="color:red">Programmer Error</td>
+            </tr>
+            <tr>
+                <td colspan="2">
+                    <button type="submit">Save</button>
+                </td>
+            </tr>
+        </table>
+    </form>
+</div>
+</body>
+</html>

+ 106 - 0
src/main/resources/templates/edit_bug.html

@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
+<head>
+    <meta charset="ISO-8859-1">
+    <title>Edit Bug</title>
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet"
+          integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
+</head>
+<body>
+<div class="container py-5 h-100">
+    <h1>Edit Bug</h1>
+    <br/>
+    <form action="#" th:action="@{/save}" th:object="${bug}" method="post">
+        <table>
+            <tr>
+                <td>Bug ID:</td>
+                <td><input type="text" th:field="*{id}" class="form-control"/></td>
+            </tr>
+            <tr>
+                <td>Tanggal QC</td>
+                <td><input type="date" pattern="dd-MM-yyyy" th:field="*{date}" class="form-control">
+                </td>
+            </tr>
+            <tr>
+                <td>Tim QC:</td>
+                <td><select th:field="*{qcId}">
+                    <option th:each="user: ${listQc}" th:value="${user.id}" th:text="${user.username}"/>
+                </select></td>
+            </tr>
+            <tr>
+                <td>Platform:</td>
+                <td><select th:field="*{platform}">
+                    <option value="">Pilih..</option>
+                    <option th:each="platform: ${platform}" th:value="${platform.id}" th:text="${platform.name}"/>
+                </select></td>
+            </tr>
+            <tr>
+                <td>Link Good Day:</td>
+                <td><input type="text" th:field="*{link}" class="form-control"/></td>
+            </tr>
+            <tr>
+                <td>Hasil QC:</td>
+                <td><select th:field="*{result}">
+                    <option value="">Pilih..</option>
+                    <option th:each="qcResultType: ${qcResultType}" th:value="${qcResultType}"
+                            th:text="${qcResultType.display}"/>
+                </select></td>
+            </tr>
+            <tr>
+                <td>Bug:</td>
+                <td><input type="text" th:field="*{description}" class="form-control"/></td>
+            </tr>
+            <tr>
+                <td>Programmer:</td>
+                <td><select th:field="*{proId}">
+                    <option th:each="user: ${listPro}" th:value="${user.id}" th:text="${user.username}"/>
+                </select></td>
+            </tr>
+            <tr>
+                <td>Link Image:</td>
+                <td><input type="text" th:field="*{imgLink}"
+                           class="form-control"/></td>
+            </tr>
+            <tr>
+                <td>Sudah Dikerjakan:</td>
+                <td>
+                    <select th:field="*{worked}">
+                        <option th:each="worList: ${worList}" th:value="${worList}"
+                                th:text="${worList.display}"></option>
+                    </select>
+                </td>
+            </tr>
+            <tr>
+                <td>QC:</td>
+                <td>
+                    <select th:field="*{workStat}">
+                        <option th:each="wStList: ${wStList}" th:value="${wStList}"
+                                th:text="${wStList.display}"></option>
+                    </select>
+                </td>
+            </tr>
+            <tr>
+                <td>Development:</td>
+                <td><input type="text" th:field="*{development}"
+                           class="form-control"/></td>
+            </tr>
+            <tr>
+                <td>QC:</td>
+                <td sec:authorize="hasAnyAuthority('ADMIN', 'QC')">
+                    <select th:field="*{devStat}">
+                        <option th:each="dStList: ${dStList}" th:value="${dStList}"
+                                th:text="${dStList.display}"></option>
+                    </select>
+                </td>
+            </tr>
+            <tr>
+                <td colspan="2">
+                    <button type="submit">Save</button>
+                </td>
+            </tr>
+        </table>
+    </form>
+</div>
+</body>
+</html>

+ 90 - 0
src/main/resources/templates/inPro.html

@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
+<head>
+    <meta charset="UTF-8">
+    <title>Aplikasi List Bug</title>
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet"
+          integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
+</head>
+<body>
+<div>
+    <div class="text-center">
+        <div sec:authorize="isAuthenticated()">
+            Welcome <b><span sec:authentication="name">Username</span></b>
+            &nbsp;
+            <i><span sec:authentication="principal.authorities">Roles</span></i>
+        </div>
+
+        <form th:action="@{/logout}" method="post">
+            <input type="submit" value="Logout"/>
+        </form>
+
+        <h1>Aplikasi List Bug</h1>
+        <div sec:authorize="hasAnyAuthority('QC', 'ADMIN')">
+            <a href="new">Add New Bug</a>
+<!--            <form th:action="@{'/new?proj=${project.id}'}"><input type="submit" value="Add New Bug"/></form>-->
+        </div>
+        <div>
+            List InProgress | <a href="/">List Done</a>
+        </div>
+        <span th:text="${successMessage}" style="color:green"></span>
+        <form th:action="@{'/inPro' + '?pForm=${platform.id}&programmer=${user.id}&proj=${project.id}'}">
+            <div>Project <select name="proj">
+                <option value="">Pilih</option>
+                <option th:each="project: ${project}" th:value="${project.id}" th:text="${project.name}"/>
+            </select> | Platform <select name="pForm">
+                <option value="">Pilih</option>
+                <option th:each="platform: ${platform}" th:value="${platform.id}" th:text="${platform.name}"/>
+            </select> | Programmer <select name="programmer">
+                <option value="">Pilih</option>
+                <option th:each="user: ${user}" th:value="${user.id}" th:text="${user.username}"/>
+            </select></div>
+            <div><input type="submit" value="Filter"/></div>
+        </form>
+    </div>
+    <br/><br/>
+    <table class="table table table-striped">
+        <thead>
+        <tr>
+            <th scope="col">No</th>
+            <th scope="col">Tanggal QC</th>
+            <th scope="col">Tim QC</th>
+            <th scope="col">Platform</th>
+            <th scope="col">Link Good Day</th>
+            <th scope="col">Hasil QC</th>
+            <th scope="col">Bug</th>
+            <th scope="col">Link Image</th>
+            <th scope="col">Programmer</th>
+            <th scope="col">Sudah Dikerjakan</th>
+            <th scope="col">QC</th>
+            <th scope="col">Development</th>
+            <th scope="col">QC</th>
+            <th scope="col">Actions</th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr th:each="bug : ${listBugs}">
+            <td th:text="${bug.id}">Bug ID</td>
+            <td th:text="${bug.date}">Tanggal QC</td>
+            <td th:text="${bug.qcId.username}">Tim QC</td>
+            <td th:text="${bug.platform.name}">Platform</td>
+            <td th:text="${bug.link}">Link Good Day</td>
+            <td th:text="${bug._displayResult}">Hasil QC</td>
+            <td th:text="${bug.description}">Bug</td>
+            <td th:text="${bug.imgLink}">Link Image</td>
+            <td th:text="${bug.proId.username}">Programmer</td>
+            <td th:text="${bug._displayWorked}">Sudah Dikerjakan</td>
+            <td th:text="${bug._displayWorkStat}">QC</td>
+            <td th:text="${bug.development}">Development</td>
+            <td th:text="${bug._displayDevStat}">QC</td>
+            <td sec:authorize="hasAnyAuthority('ADMIN', 'QC')">
+                <a th:href="@{'/edit/' + ${bug.id} + '?page=inPro'}">Edit</a> &nbsp;&nbsp;&nbsp;&nbsp;
+                <a sec:authorize="hasAnyAuthority('ADMIN', 'QC')" th:href="@{'/delete2/' + ${bug.id}}">Delete</a>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>

+ 90 - 0
src/main/resources/templates/index.html

@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
+<head>
+    <meta charset="UTF-8">
+    <title>Aplikasi List Bug</title>
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet"
+          integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
+</head>
+<body>
+<div>
+    <div class="text-center">
+        <div sec:authorize="isAuthenticated()">
+            Welcome <b><span sec:authentication="name">Username</span></b>
+            &nbsp;
+            <i><span sec:authentication="principal.authorities">Roles</span></i>
+        </div>
+
+        <form th:action="@{/logout}" method="post">
+            <input type="submit" value="Logout"/>
+        </form>
+
+        <h1>Aplikasi List Bug</h1>
+        <div sec:authorize="hasAnyAuthority('QC', 'ADMIN')">
+            <a href="new">Add New Bug</a>
+<!--            <form th:action="@{'/new?proj=${project.id}'}"><input type="submit" value="Add New Bug"/></form>-->
+        </div>
+        <div>
+            <a href="inPro">List InProgress</a> | List Done
+        </div>
+        <span th:text="${successMessage}" style="color:green"></span>
+        <form th:action="@{'/' + '?pForm=${platform.id}&programmer=${user.id}&proj=${project.id}'}">
+            <div>Project <select name="proj">
+                <option value="">Pilih</option>
+                <option th:each="project: ${project}" th:value="${project.id}" th:text="${project.name}"/>
+            </select> | Platform <select name="pForm">
+                <option value="">Pilih</option>
+                <option th:each="platform: ${platform}" th:value="${platform.id}" th:text="${platform.name}"/>
+            </select> | Programmer <select name="programmer">
+                <option value="">Pilih</option>
+                <option th:each="user: ${user}" th:value="${user.id}" th:text="${user.username}"/>
+            </select></div>
+            <div><input type="submit" value="Filter"/></div>
+        </form>
+    </div>
+    <br/><br/>
+    <table class="table table table-striped">
+        <thead>
+        <tr>
+            <th scope="col">No</th>
+            <th scope="col">Tanggal QC</th>
+            <th scope="col">Tim QC</th>
+            <th scope="col">Platform</th>
+            <th scope="col">Link Good Day</th>
+            <th scope="col">Hasil QC</th>
+            <th scope="col">Bug</th>
+            <th scope="col">Link Image</th>
+            <th scope="col">Programmer</th>
+            <th scope="col">Sudah Dikerjakan</th>
+            <th scope="col">QC</th>
+            <th scope="col">Development</th>
+            <th scope="col">QC</th>
+            <th scope="col">Actions</th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr th:each="bug : ${listBugs}">
+            <td th:text="${bug.id}">Bug ID</td>
+            <td th:text="${bug.date}">Tanggal QC</td>
+            <td th:text="${bug.qcId.username}">Tim QC</td>
+            <td th:text="${bug.platform.name}">Platform</td>
+            <td th:text="${bug.link}">Link Good Day</td>
+            <td th:text="${bug._displayResult}">Hasil QC</td>
+            <td th:text="${bug.description}">Bug</td>
+            <td th:text="${bug.imgLink}">Link Image</td>
+            <td th:text="${bug.proId.username}">Programmer</td>
+            <td th:text="${bug._displayWorked}">Sudah Dikerjakan</td>
+            <td th:text="${bug._displayWorkStat}">QC</td>
+            <td th:text="${bug.development}">Development</td>
+            <td th:text="${bug._displayDevStat}">QC</td>
+            <td sec:authorize="hasAnyAuthority('ADMIN', 'QC')">
+                <a th:href="@{'/edit/' + ${bug.id} + '?page=index'}">Edit</a> &nbsp;&nbsp;&nbsp;&nbsp;
+                <a sec:authorize="hasAnyAuthority('ADMIN', 'QC')" th:href="@{'/delete/' + ${bug.id}}">Delete</a>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>

+ 39 - 0
src/main/resources/templates/login.html

@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org">
+<head>
+    <title>Login</title>
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet"
+          integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
+</head>
+<body>
+
+<section class="vh-100 gradient-custom">
+    <div class="container py-5 h-100">
+        <div th:if="${param.error}">
+            <p style="color:red">Invalid username and password.</p>
+        </div>
+        <div th:if="${param.logout}">
+            <p style="color:red">You have been logged out.</p>
+        </div>
+        <form th:action="@{/login}" method="post">
+            <h2 class="fw-bold mb-2 text-uppercase">Login</h2>
+            <p class="text-black-50 mb-5">Please Sign In!</p>
+            <div class="form-outline mb-4"><label class="form-label"> User Name : <input type="text" name="username"
+                                                                                         class="form-control"/> </label>
+            </div>
+            <div class="form-outline mb-4"><label class="form-label"> Password: <input type="password" name="password"
+                                                                                       class="form-control"/> </label>
+            </div>
+<!--            <div class="form-outline mb-4"><label class="form-label"> Project:-->
+<!--                <select name="proj">-->
+<!--                    <option value="">Pilih</option>-->
+<!--                    <option th:each="proj: ${proj}" th:value="${proj.id}" th:text="${proj.description}"/>-->
+<!--                </select>-->
+<!--            </label></div>-->
+            <div class="form-outline mb-4"><input type="submit" value="Sign In"/></div>
+
+        </form>
+    </div>
+</section>
+</body>
+</html>

+ 13 - 0
src/test/kotlin/com/server/alb/AlbApplicationTests.kt

@@ -0,0 +1,13 @@
+package com.server.alb
+
+import org.junit.jupiter.api.Test
+import org.springframework.boot.test.context.SpringBootTest
+
+@SpringBootTest
+class AlbApplicationTests {
+
+	@Test
+	fun contextLoads() {
+	}
+
+}