Compare commits
4 Commits
36af7db10b
...
ab48f30b6e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab48f30b6e | ||
|
|
0723c559f0 | ||
| 47fb36b066 | |||
| 771d28edfe |
@@ -0,0 +1,14 @@
|
||||
package com.example.demo.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class PasswordChangeController {
|
||||
|
||||
@GetMapping("/passwordChange")
|
||||
public String showPasswordChange() {
|
||||
|
||||
return "passwordChange";
|
||||
}
|
||||
}
|
||||
43
src/main/java/com/example/demo/entity/BookLend.java
Normal file
43
src/main/java/com/example/demo/entity/BookLend.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity // このクラスがDBのテーブルに対応することを表す
|
||||
@Data
|
||||
@Table(name = "book_lend")
|
||||
public class BookLend {
|
||||
//貸出ID
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "lend_Id", nullable = false)
|
||||
private int lendId;
|
||||
|
||||
// 図書管理ID(BK-1など)
|
||||
@Column(name = "book_manage_id", nullable = false)
|
||||
private String bookManageId;
|
||||
|
||||
// 図書管理ID(BK-1など)
|
||||
@Column(name = "employee_id", nullable = false)
|
||||
private Integer employeeId;
|
||||
|
||||
// 貸出日
|
||||
@Column(name = "book_lend_date", nullable = false)
|
||||
private Date bookLendDate;
|
||||
|
||||
// 返却日
|
||||
@Column(name = "book_return_date", nullable = false)
|
||||
private Date bookReturnDate;
|
||||
|
||||
// 貸出状態
|
||||
@Column(name = "book_status", nullable = false)
|
||||
private Integer bookStatus;
|
||||
}
|
||||
29
src/main/java/com/example/demo/entity/Employee.java
Normal file
29
src/main/java/com/example/demo/entity/Employee.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.example.demo.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Entity // このクラスがDBのテーブルに対応することを表す
|
||||
@Data
|
||||
@Table(name = "employee")
|
||||
public class Employee {
|
||||
//社員ID
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "employee_Id", nullable = false)
|
||||
private int employeeId;
|
||||
|
||||
// 社員名
|
||||
@Column(name = "employee_name", nullable = false)
|
||||
private String employeeName;
|
||||
|
||||
//部署ID
|
||||
@Column(name = "department_id", nullable = false)
|
||||
private Integer departmentId;
|
||||
}
|
||||
62
src/main/resources/static/js/passwordChange.js
Normal file
62
src/main/resources/static/js/passwordChange.js
Normal file
@@ -0,0 +1,62 @@
|
||||
function togglePassword(id) {
|
||||
|
||||
const input = document.getElementById(id);
|
||||
|
||||
if (input === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (input.type === "password") {
|
||||
input.type = "text";
|
||||
} else {
|
||||
input.type = "password";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function clearForm() {
|
||||
|
||||
const form = document.getElementById("pwForm");
|
||||
|
||||
if (form === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.reset();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showCompletedPopup() {
|
||||
|
||||
const completedDialog = document.getElementById("completedDialog");
|
||||
|
||||
if (completedDialog === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
completedDialog.showModal();
|
||||
}
|
||||
|
||||
function goTopMenu() {
|
||||
|
||||
const topMenuUrl = document.body.dataset.topmenuUrl;
|
||||
|
||||
if (topMenuUrl) {
|
||||
window.location.href = topMenuUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = "/topmenu";
|
||||
}
|
||||
|
||||
function goLogin(){
|
||||
const loginUrl = document.body.dataset.loginUrl;
|
||||
|
||||
if (loginUrl){
|
||||
window.location.href = loginUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href="/login"
|
||||
}
|
||||
377
src/main/resources/templates/passwordChange.html
Normal file
377
src/main/resources/templates/passwordChange.html
Normal file
@@ -0,0 +1,377 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" lang="ja">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ShareBooks|パスワード変更</title>
|
||||
</head>
|
||||
|
||||
<body th:data-topmenu-url="@{/topmenu}">
|
||||
|
||||
<!-- ヘッダー -->
|
||||
<div class="header-bar">
|
||||
|
||||
<div class="header-left">
|
||||
ShareBooks
|
||||
</div>
|
||||
|
||||
<div class="header-right">
|
||||
|
||||
<span class="bell">
|
||||
🔔
|
||||
<span class="badge">3</span>
|
||||
</span>
|
||||
|
||||
<span class="user">
|
||||
テストユーザー(一般)
|
||||
</span>
|
||||
|
||||
<button type="button" class="logout">
|
||||
ログアウト
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layout">
|
||||
|
||||
<!-- サイドバー -->
|
||||
<div class="sidebar">
|
||||
|
||||
<div class="section-label">
|
||||
共通画面
|
||||
</div>
|
||||
|
||||
<a class="side-menu" th:href="@{/topmenu}">
|
||||
トップメニュー
|
||||
</a>
|
||||
|
||||
<div class="active">
|
||||
パスワード再設定
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- メイン -->
|
||||
<div class="main-area">
|
||||
|
||||
<!-- パンくずリスト -->
|
||||
<div class="breadcrumb">
|
||||
|
||||
<a th:href="@{/topmenu}">
|
||||
トップメニュー
|
||||
</a>
|
||||
|
||||
> パスワード再設定
|
||||
|
||||
</div>
|
||||
|
||||
<h1 class="page-title">
|
||||
パスワード再設定
|
||||
</h1>
|
||||
|
||||
<p class="page-desc">
|
||||
現在のパスワードと新しいパスワードを入力し、
|
||||
「確定」ボタンを押してください。
|
||||
</p>
|
||||
|
||||
<p class="required-note">
|
||||
(※)は必須項目です。
|
||||
</p>
|
||||
|
||||
<div class="content-columns">
|
||||
|
||||
<!-- 左カラム -->
|
||||
<div class="left-column">
|
||||
|
||||
<div class="form-card">
|
||||
|
||||
<h2>
|
||||
パスワード再設定入力
|
||||
</h2>
|
||||
|
||||
<!--
|
||||
簡易実装のため、フォーム送信は行いません。
|
||||
-->
|
||||
<form id="pwForm" onsubmit="return false;">
|
||||
|
||||
<!-- 現在のパスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="currentPassword">
|
||||
現在のパスワード
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="currentPassword"
|
||||
name="currentPassword"
|
||||
autocomplete="current-password"
|
||||
placeholder="現在のパスワードを入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="現在のパスワードの表示を切り替える"
|
||||
onclick="togglePassword('currentPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新しいパスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="newPassword">
|
||||
新しいパスワード
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="newPassword"
|
||||
name="newPassword"
|
||||
autocomplete="new-password"
|
||||
placeholder="新しいパスワードを入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="新しいパスワードの表示を切り替える"
|
||||
onclick="togglePassword('newPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="field-hint">
|
||||
※ 半角英数字・記号を含む8文字以上16文字以下で入力してください。
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 確認用パスワード -->
|
||||
<div class="form-group">
|
||||
|
||||
<label for="confirmPassword">
|
||||
新しいパスワードの確認
|
||||
<span class="req">(※)</span>
|
||||
</label>
|
||||
|
||||
<div class="input-with-icon">
|
||||
|
||||
<input
|
||||
type="password"
|
||||
id="confirmPassword"
|
||||
name="confirmPassword"
|
||||
autocomplete="new-password"
|
||||
placeholder="新しいパスワードをもう一度入力してください">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="toggle-password"
|
||||
aria-label="確認用パスワードの表示を切り替える"
|
||||
onclick="togglePassword('confirmPassword')">
|
||||
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
|
||||
<path
|
||||
d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z">
|
||||
</path>
|
||||
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="3">
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="field-hint">
|
||||
※ 確認のため、もう一度新しいパスワードを入力してください。
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 注意事項 -->
|
||||
<div class="notice-box">
|
||||
|
||||
<div class="notice-title">
|
||||
注意事項
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 操作ボタン -->
|
||||
<div class="button-row">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="goTopMenu()">
|
||||
トップメニューへ戻る
|
||||
</button>
|
||||
|
||||
<div class="btn-group-right">
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary"
|
||||
onclick="clearForm()">
|
||||
クリア
|
||||
</button>
|
||||
|
||||
<!-- ダイアログを表示 -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
onclick="showCompletedPopup()">
|
||||
確定
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 右カラム -->
|
||||
<div class="right-column">
|
||||
|
||||
<div class="constraint-panel">
|
||||
|
||||
<div class="panel-title">
|
||||
パスワードの制約
|
||||
</div>
|
||||
|
||||
<div class="group-label">
|
||||
使用可能文字
|
||||
</div>
|
||||
|
||||
<div class="chars-value">
|
||||
半角英数字・記号
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="group-label">
|
||||
制約
|
||||
</div>
|
||||
|
||||
<ul class="constraint-list">
|
||||
<li>✓ 8文字以上16文字以下</li>
|
||||
<li>✓ 1つ以上の小文字を使用</li>
|
||||
<li>✓ 1つ以上の大文字を使用</li>
|
||||
<li>✓ 1つ以上の数字を使用</li>
|
||||
<li>✓ 1つ以上の記号を使用</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-box">
|
||||
|
||||
<div class="example-label">
|
||||
設定例
|
||||
</div>
|
||||
|
||||
<div class="example-value">
|
||||
Abcdef12!
|
||||
</div>
|
||||
|
||||
<div class="example-note">
|
||||
(9文字、英字大小・数字・記号を含む)
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
© 2026 ShareBooks
|
||||
</div>
|
||||
|
||||
<dialog id="completedDialog">
|
||||
|
||||
<h2>
|
||||
変更完了
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
パスワードの変更が完了しました。
|
||||
</p>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick="goLogin()">
|
||||
完了
|
||||
</button>
|
||||
|
||||
</dialog>
|
||||
|
||||
<script th:src="@{/js/passwordChange.js}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -70,6 +70,16 @@
|
||||
寄贈申請の<br> 受信一覧を確認します。
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<a class="card" href="/passwordChange">
|
||||
<h3>パスワード変更</h3>
|
||||
|
||||
<p>
|
||||
初期パスワードを<br> 変更します。
|
||||
</p>
|
||||
</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user