diff --git a/src/main/java/co/jp/app/controller/PetController.java b/src/main/java/co/jp/app/controller/PetController.java index 530a677..8be5908 100644 --- a/src/main/java/co/jp/app/controller/PetController.java +++ b/src/main/java/co/jp/app/controller/PetController.java @@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestParam; import co.jp.app.service.PetService; - @Controller public class PetController { @@ -19,7 +18,7 @@ public class PetController { @GetMapping("/api/dogs/pet") public String getListByEntities(@RequestParam List id) { - service.getPetByID(id); + service.getPetByID(id); return "pet"; } } diff --git a/src/main/java/co/jp/app/controller/UploadController.java b/src/main/java/co/jp/app/controller/UploadController.java index c76027a..1ef704a 100644 --- a/src/main/java/co/jp/app/controller/UploadController.java +++ b/src/main/java/co/jp/app/controller/UploadController.java @@ -9,20 +9,19 @@ import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PostMapping; import co.jp.app.entity.PetEntity; -import co.jp.app.service.UploadService; @CrossOrigin("http://192.168.1.50:5173") @Controller public class UploadController { @Autowired - private UploadService service; + //private UploadService service; @PostMapping("/api/dogs/upload") public String upload() { List list = new ArrayList(); - service.saveAll(list); + //service.saveAll(list); return "upload"; diff --git a/src/main/java/co/jp/app/entity/PetEntity.java b/src/main/java/co/jp/app/entity/PetEntity.java index 8b8f9ed..b10d7d2 100644 --- a/src/main/java/co/jp/app/entity/PetEntity.java +++ b/src/main/java/co/jp/app/entity/PetEntity.java @@ -5,10 +5,11 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; + @Entity @Table(name = "Pet") -public class PetEntity{ -@GeneratedValue(strategy = GenerationType.IDENTITY) +public class PetEntity { + @GeneratedValue(strategy = GenerationType.IDENTITY) @Id private int ID; @@ -27,15 +28,15 @@ public class PetEntity{ //犬の健康状態 private String status; //犬の圖片 - private String image; - - public String getImage() { - return image; - } + private String image; - public void setImage(String image) { - this.image = image; - } + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } public String getName() { return name; @@ -92,6 +93,7 @@ public class PetEntity{ public void setStatus(String status) { this.status = status; } + public int getID() { return ID; } @@ -99,5 +101,5 @@ public class PetEntity{ public void setID(int iD) { ID = iD; } - + } diff --git a/src/main/java/co/jp/app/repository/PetRepository.java b/src/main/java/co/jp/app/repository/PetRepository.java index 9c5b065..ecb3674 100644 --- a/src/main/java/co/jp/app/repository/PetRepository.java +++ b/src/main/java/co/jp/app/repository/PetRepository.java @@ -1,6 +1,5 @@ package co.jp.app.repository; - import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; @@ -9,10 +8,8 @@ import co.jp.app.entity.PetEntity; public interface PetRepository extends JpaRepository { -@Override -default List findAllById(Iterable id) { - return findAllById(id); + @Override + default List findAllById(Iterable id) { + return findAllById(id); } } - - diff --git a/src/main/java/co/jp/app/service/PetService.java b/src/main/java/co/jp/app/service/PetService.java index 97d6c7c..a820cda 100644 --- a/src/main/java/co/jp/app/service/PetService.java +++ b/src/main/java/co/jp/app/service/PetService.java @@ -8,7 +8,6 @@ import org.springframework.stereotype.Service; import co.jp.app.entity.PetEntity; import co.jp.app.repository.PetRepository; - @Service public class PetService { @Autowired @@ -17,6 +16,6 @@ public class PetService { public List getPetByID(Iterable id) { return dao.findAllById(id); - + } } diff --git a/target/classes/.gitignore b/target/classes/.gitignore new file mode 100644 index 0000000..9bd6d3a --- /dev/null +++ b/target/classes/.gitignore @@ -0,0 +1 @@ +/co/ diff --git a/target/classes/META-INF/maven/co.jp.app/dog-2/pom.properties b/target/classes/META-INF/maven/co.jp.app/dog-2/pom.properties index 2d965ad..5f2c654 100644 --- a/target/classes/META-INF/maven/co.jp.app/dog-2/pom.properties +++ b/target/classes/META-INF/maven/co.jp.app/dog-2/pom.properties @@ -1,6 +1,6 @@ #Generated by Maven Integration for Eclipse -#Wed May 07 16:32:03 JST 2025 -m2e.projectLocation=C\:\\Users\\ichbi\\OneDrive\\\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\\dog-1 +#Mon May 12 11:38:52 JST 2025 +m2e.projectLocation=E\:\\jugyo\\asciimg-master\\Dog-1 m2e.projectName=dog-1 groupId=co.jp.app artifactId=dog-2 diff --git a/target/classes/META-INF/maven/co.jp.app/dog-2/pom.xml b/target/classes/META-INF/maven/co.jp.app/dog-2/pom.xml index e38e0de..b3d201c 100644 --- a/target/classes/META-INF/maven/co.jp.app/dog-2/pom.xml +++ b/target/classes/META-INF/maven/co.jp.app/dog-2/pom.xml @@ -1,87 +1,118 @@ - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.4.5 - - - co.jp.app - dog-2 - 0.0.1-SNAPSHOT - dog-1 - dog introduce project for Spring Boot - - - - - - - - - - - - - - - 17 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.4.5 + + + co.jp.app + dog-2 + 0.0.1-SNAPSHOT + dog-1 + dog introduce project for Spring Boot + + + + + + + + + + + + + + + 17 + + - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-data-jpa - - - com.mysql - mysql-connector-j - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - com.fasterxml.jackson.core - jackson-databind - - + + org.springframework.boot + spring-boot-starter-web + + + io.jsonwebtoken + jjwt-api + 0.11.5 + + + io.jsonwebtoken + jjwt-impl + 0.11.5 + runtime + + + io.jsonwebtoken + jjwt-jackson + 0.11.5 + runtime + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.mysql + mysql-connector-j + runtime + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-security + + + com.fasterxml.jackson.core + jackson-databind + + + org.jetbrains + annotations + 13.0 + compile + + - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.projectlombok - lombok - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.projectlombok - lombok - - - - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.projectlombok + lombok + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + \ No newline at end of file diff --git a/target/classes/application.properties b/target/classes/application.properties index e435626..618861c 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -7,4 +7,7 @@ spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect spring.datasource.url=jdbc:mysql://192.168.1.192:3306/dog spring.datasource.username=coder spring.datasource.password=coder -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver \ No newline at end of file +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +jwt.secret=wM7Pz4BxvZ5NcLaBpgJm0eRQ5ztc3W5+OPH0E7g3gcQ= +jwt.token-expiration-ms==900000 \ No newline at end of file diff --git a/target/classes/co/jp/app/Dog1Application.class b/target/classes/co/jp/app/Dog1Application.class index afb8abe..30bb284 100644 Binary files a/target/classes/co/jp/app/Dog1Application.class and b/target/classes/co/jp/app/Dog1Application.class differ diff --git a/target/classes/co/jp/app/controller/PetController.class b/target/classes/co/jp/app/controller/PetController.class index f48a338..3e8803f 100644 Binary files a/target/classes/co/jp/app/controller/PetController.class and b/target/classes/co/jp/app/controller/PetController.class differ diff --git a/target/classes/co/jp/app/controller/loginController.class b/target/classes/co/jp/app/controller/loginController.class deleted file mode 100644 index aaa222a..0000000 Binary files a/target/classes/co/jp/app/controller/loginController.class and /dev/null differ diff --git a/target/classes/co/jp/app/controller/uploadController.class b/target/classes/co/jp/app/controller/uploadController.class deleted file mode 100644 index e076c44..0000000 Binary files a/target/classes/co/jp/app/controller/uploadController.class and /dev/null differ diff --git a/target/classes/co/jp/app/entity/ErrorEntity.class b/target/classes/co/jp/app/entity/ErrorEntity.class index eccb95c..0b00d1c 100644 Binary files a/target/classes/co/jp/app/entity/ErrorEntity.class and b/target/classes/co/jp/app/entity/ErrorEntity.class differ diff --git a/target/classes/co/jp/app/entity/PetEntity.class b/target/classes/co/jp/app/entity/PetEntity.class index 9e8e0e9..0bd3793 100644 Binary files a/target/classes/co/jp/app/entity/PetEntity.class and b/target/classes/co/jp/app/entity/PetEntity.class differ diff --git a/target/classes/co/jp/app/entity/UserEntity.class b/target/classes/co/jp/app/entity/UserEntity.class index 9864bfe..910213f 100644 Binary files a/target/classes/co/jp/app/entity/UserEntity.class and b/target/classes/co/jp/app/entity/UserEntity.class differ diff --git a/target/classes/co/jp/app/repository/PetRepository.class b/target/classes/co/jp/app/repository/PetRepository.class index 4138eb6..0605933 100644 Binary files a/target/classes/co/jp/app/repository/PetRepository.class and b/target/classes/co/jp/app/repository/PetRepository.class differ diff --git a/target/classes/co/jp/app/repository/erraRepository.class b/target/classes/co/jp/app/repository/erraRepository.class deleted file mode 100644 index 59125c6..0000000 Binary files a/target/classes/co/jp/app/repository/erraRepository.class and /dev/null differ diff --git a/target/classes/co/jp/app/repository/uploadRepository.class b/target/classes/co/jp/app/repository/uploadRepository.class deleted file mode 100644 index dde1f62..0000000 Binary files a/target/classes/co/jp/app/repository/uploadRepository.class and /dev/null differ diff --git a/target/classes/co/jp/app/repository/userRepository.class b/target/classes/co/jp/app/repository/userRepository.class deleted file mode 100644 index 8b068cf..0000000 Binary files a/target/classes/co/jp/app/repository/userRepository.class and /dev/null differ diff --git a/target/classes/co/jp/app/service/PetService.class b/target/classes/co/jp/app/service/PetService.class index 19c59c8..257099f 100644 Binary files a/target/classes/co/jp/app/service/PetService.class and b/target/classes/co/jp/app/service/PetService.class differ diff --git a/target/classes/co/jp/app/service/erraService.class b/target/classes/co/jp/app/service/erraService.class deleted file mode 100644 index 8d2358c..0000000 Binary files a/target/classes/co/jp/app/service/erraService.class and /dev/null differ diff --git a/target/classes/co/jp/app/service/uploadService.class b/target/classes/co/jp/app/service/uploadService.class deleted file mode 100644 index 8d71483..0000000 Binary files a/target/classes/co/jp/app/service/uploadService.class and /dev/null differ diff --git a/target/classes/co/jp/app/service/userService.class b/target/classes/co/jp/app/service/userService.class deleted file mode 100644 index c5c1d66..0000000 Binary files a/target/classes/co/jp/app/service/userService.class and /dev/null differ