Compare commits
10 Commits
63b7aba82a
...
h-hein
| Author | SHA1 | Date | |
|---|---|---|---|
| dc5f6494cf | |||
|
|
7c69955988 | ||
| 67f88c89a1 | |||
|
|
edd0ae6f95 | ||
|
|
5716327a06 | ||
| e238c6b223 | |||
| 8392c6d2da | |||
| 9b0323aed0 | |||
| 75af719656 | |||
| 4d4aabdc72 |
@@ -1,139 +1,2 @@
|
||||
<?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>4.1.1</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>book-rent</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>book-rent</name>
|
||||
<description/>
|
||||
<url/>
|
||||
<licenses>
|
||||
<license/>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer/>
|
||||
</developers>
|
||||
<scm>
|
||||
<connection/>
|
||||
<developerConnection/>
|
||||
<tag/>
|
||||
<url/>
|
||||
</scm>
|
||||
<properties>
|
||||
<java.version>21</java.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-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-webmvc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webmvc-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>default-testCompile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.common;
|
||||
|
||||
public class BusinessException {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.common;
|
||||
|
||||
public class Const {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.common;
|
||||
|
||||
public class LoginUser {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.config;
|
||||
|
||||
public class LoginCheckInterceptor {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.config;
|
||||
|
||||
public class WebConfig {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
public class AdminBookController {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
public class AdminLoanController {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
public class BookController {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
public class EmployeeController {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
public class LoanContorller {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
public class LoginController {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class MenuController {
|
||||
|
||||
@GetMapping("/menu")
|
||||
public String showMenu(Model model) {
|
||||
|
||||
// 仮のログインユーザー名
|
||||
model.addAttribute("loginUserName", "テストユーザー");
|
||||
|
||||
// menu.htmlを表示
|
||||
return "menu";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.dto;
|
||||
|
||||
public class BorrowView {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
public class BookCollection {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
public class BorrowBook {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
public class Employee {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.form;
|
||||
|
||||
public class BookForm {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.form;
|
||||
|
||||
public class EmployeeForm {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.repository;
|
||||
|
||||
public class BookCollectionRepository {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.repository;
|
||||
|
||||
public class BorrowBookRepository {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.repository;
|
||||
|
||||
public class EmployeeRepository {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
public class AuthService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
public class BookAdminService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
public class BookService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
public class EmployeeService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.example.demo.service;
|
||||
|
||||
public class LoanService {
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
spring.application.name=book-rent
|
||||
|
||||
# --- MySQL (CREATE DATABASE.sql \u3067\u4f5c\u6210\u3057\u305f book_manage) ---
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/book_manage?serverTimezone=Asia/Tokyo&characterEncoding=UTF-8
|
||||
spring.datasource.username=bookuser
|
||||
spring.datasource.password=Book2026
|
||||
|
||||
# \u30c6\u30fc\u30d6\u30eb\u306fSQL\u3067\u4f5c\u6210\u6e08\u307f\u3002JPA\u3067\u306f\u5909\u66f4\u3057\u306a\u3044
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.jpa.open-in-view=false
|
||||
spring.jpa.properties.hibernate.jdbc.time_zone=Asia/Tokyo
|
||||
|
||||
spring.thymeleaf.cache=false
|
||||
server.servlet.session.timeout=30m
|
||||
94
book-rent/src/main/resources/templates/login.html
Normal file
94
book-rent/src/main/resources/templates/login.html
Normal file
@@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- 外部スクリプトの読み込み -->
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
|
||||
<!-- CSSの読み込み -->
|
||||
<link rel="stylesheet" th:href="@{/css/all.css}" type="text/css">
|
||||
<link rel="stylesheet" th:href="@{/css/style.css}" type="text/css">
|
||||
|
||||
<title>ログイン</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="loginContainer">
|
||||
|
||||
<h1>ログイン</h1>
|
||||
|
||||
<form th:action="@{/doLogin}"
|
||||
method="post"
|
||||
th:object="${loginInfoForm}">
|
||||
|
||||
<!-- エラーメッセージ -->
|
||||
<div class="msgBox error"
|
||||
th:if="${messageError != null}">
|
||||
<span class="error"
|
||||
th:text="${messageError.message}"></span>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<!-- メールアドレス -->
|
||||
<tr>
|
||||
<th class="header">メールアドレス</th>
|
||||
<td>
|
||||
<input
|
||||
id="mailAddress"
|
||||
type="text"
|
||||
th:field="*{mailAddress}"
|
||||
placeholder="メールアドレス"
|
||||
required
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- パスワード -->
|
||||
<tr>
|
||||
<th class="header">パスワード</th>
|
||||
<td>
|
||||
<input
|
||||
id="password"
|
||||
type="password"
|
||||
th:field="*{password}"
|
||||
placeholder="パスワード"
|
||||
required
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- ボタン -->
|
||||
<tr>
|
||||
<td class="btnArea" colspan="2">
|
||||
<input
|
||||
type="submit"
|
||||
value="ログイン"
|
||||
/>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick="clearInput()">
|
||||
リセット
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 入力内容のリセット -->
|
||||
<script>
|
||||
function clearInput() {
|
||||
document.getElementById('mailAddress').value = '';
|
||||
document.getElementById('password').value = '';
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
36
book-rent/src/main/resources/templates/menu.html
Normal file
36
book-rent/src/main/resources/templates/menu.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>メニュー</title>
|
||||
|
||||
<link rel="stylesheet" th:href="@{/css/all.css}">
|
||||
<link rel="stylesheet" th:href="@{/css/style.css}">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>メニュー</h1>
|
||||
|
||||
<div class="userInfo">
|
||||
<span>ログインユーザー:</span>
|
||||
<span th:text="${loginUserName}">ユーザー名</span>
|
||||
|
||||
<form th:action="@{/logout}" method="post">
|
||||
<button type="submit">ログアウト</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="menuArea">
|
||||
<form th:action="@{/book/list}" method="get">
|
||||
<button type="submit">書籍一覧</button>
|
||||
</form>
|
||||
|
||||
<form th:action="@{/book/rent}" method="get">
|
||||
<button type="submit">書籍貸出申請一覧</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user