This commit is contained in:
s-sakiyama
2026-10-07 15:31:33 +09:00
parent 85e95d5104
commit c7eb251d1f
4 changed files with 21 additions and 10 deletions

View File

@@ -1,6 +1,5 @@
package com.example.demo.application;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.example.demo.logic.Q3Logic;
@@ -8,10 +7,13 @@ import com.example.demo.service.Q3Service;
@Controller
public class Q3Controller {
@Autowired
Q3Service ser;
@Autowired
Q3Logic log;
private final Q3Service ser;
private final Q3Logic log;
public Q3Controller(Q3Service ser, Q3Logic log) {
this.ser = ser;
this.log = log;
}
public String usernameSearch(String mail, String pass) {
if (mail.length() > 256) {

View File

@@ -1,5 +1,7 @@
package com.example.demo.persistence;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@@ -8,4 +10,5 @@ import com.example.demo.domain.Employee;
@Repository
public interface EmployeeRepository extends JpaRepository<Employee, Integer> {
public List<Employee> findAll();
}

View File

@@ -2,15 +2,19 @@ package com.example.demo.presentation;
import java.util.Scanner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.example.demo.application.Q3Controller;
@Component
public class Q3View {
@Autowired
Q3Controller con;
private final Q3Controller con;
public Q3View(Q3Controller con) {
this.con = con;
}
Scanner scan = new Scanner(System.in);
public void usernameSearch() {

View File

@@ -2,7 +2,6 @@ package com.example.demo.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.domain.Employee;
@@ -10,9 +9,12 @@ import com.example.demo.persistence.EmployeeRepository;
@Service
public class Q3Service {
@Autowired
EmployeeRepository empre;
public Q3Service(EmployeeRepository empre) {
this.empre = empre;
}
public List<Employee> allDateGet() {
return empre.findAll();
}