Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-05-12 14:07:05 +09:00
24 changed files with 139 additions and 108 deletions

View File

@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import co.jp.app.service.PetService; import co.jp.app.service.PetService;
@Controller @Controller
public class PetController { public class PetController {

View File

@ -9,20 +9,19 @@ import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import co.jp.app.entity.PetEntity; import co.jp.app.entity.PetEntity;
import co.jp.app.service.UploadService;
@CrossOrigin("http://192.168.1.50:5173") @CrossOrigin("http://192.168.1.50:5173")
@Controller @Controller
public class UploadController { public class UploadController {
@Autowired @Autowired
private UploadService service; //private UploadService service;
@PostMapping("/api/dogs/upload") @PostMapping("/api/dogs/upload")
public String upload() { public String upload() {
List<PetEntity> list = new ArrayList<PetEntity>(); List<PetEntity> list = new ArrayList<PetEntity>();
service.saveAll(list); //service.saveAll(list);
return "upload"; return "upload";

View File

@ -5,10 +5,11 @@ import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType; import jakarta.persistence.GenerationType;
import jakarta.persistence.Id; import jakarta.persistence.Id;
import jakarta.persistence.Table; import jakarta.persistence.Table;
@Entity @Entity
@Table(name = "Pet") @Table(name = "Pet")
public class PetEntity{ public class PetEntity {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Id @Id
private int ID; private int ID;
@ -92,6 +93,7 @@ public class PetEntity{
public void setStatus(String status) { public void setStatus(String status) {
this.status = status; this.status = status;
} }
public int getID() { public int getID() {
return ID; return ID;
} }

View File

@ -1,6 +1,5 @@
package co.jp.app.repository; package co.jp.app.repository;
import java.util.List; import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
@ -9,10 +8,8 @@ import co.jp.app.entity.PetEntity;
public interface PetRepository extends JpaRepository<PetEntity, Integer> { public interface PetRepository extends JpaRepository<PetEntity, Integer> {
@Override @Override
default List<PetEntity> findAllById(Iterable<Integer> id) { default List<PetEntity> findAllById(Iterable<Integer> id) {
return findAllById(id); return findAllById(id);
} }
} }

View File

@ -8,7 +8,6 @@ import org.springframework.stereotype.Service;
import co.jp.app.entity.PetEntity; import co.jp.app.entity.PetEntity;
import co.jp.app.repository.PetRepository; import co.jp.app.repository.PetRepository;
@Service @Service
public class PetService { public class PetService {
@Autowired @Autowired

1
target/classes/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/co/

View File

@ -1,6 +1,6 @@
#Generated by Maven Integration for Eclipse #Generated by Maven Integration for Eclipse
#Wed May 07 16:32:03 JST 2025 #Mon May 12 11:38:52 JST 2025
m2e.projectLocation=C\:\\Users\\ichbi\\OneDrive\\\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\\dog-1 m2e.projectLocation=E\:\\jugyo\\asciimg-master\\Dog-1
m2e.projectName=dog-1 m2e.projectName=dog-1
groupId=co.jp.app groupId=co.jp.app
artifactId=dog-2 artifactId=dog-2

View File

@ -35,6 +35,23 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.11.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.11.5</version>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId> <artifactId>spring-boot-starter-data-jpa</artifactId>
@ -44,15 +61,29 @@
<artifactId>mysql-connector-j</artifactId> <artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>13.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -8,3 +8,6 @@ spring.datasource.url=jdbc:mysql://192.168.1.192:3306/dog
spring.datasource.username=coder spring.datasource.username=coder
spring.datasource.password=coder spring.datasource.password=coder
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
jwt.secret=wM7Pz4BxvZ5NcLaBpgJm0eRQ5ztc3W5+OPH0E7g3gcQ=
jwt.token-expiration-ms==900000