changed format
This commit is contained in:
@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import co.jp.app.service.PetService;
|
||||
|
||||
|
||||
@Controller
|
||||
|
||||
public class PetController {
|
||||
|
@ -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<PetEntity> list = new ArrayList<PetEntity>();
|
||||
|
||||
service.saveAll(list);
|
||||
//service.saveAll(list);
|
||||
|
||||
return "upload";
|
||||
|
||||
|
@ -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;
|
||||
@ -92,6 +93,7 @@ public class PetEntity{
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return ID;
|
||||
}
|
||||
|
@ -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<PetEntity, Integer> {
|
||||
|
||||
@Override
|
||||
default List<PetEntity> findAllById(Iterable<Integer> id) {
|
||||
@Override
|
||||
default List<PetEntity> findAllById(Iterable<Integer> id) {
|
||||
return findAllById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
1
target/classes/.gitignore
vendored
Normal file
1
target/classes/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/co/
|
@ -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
|
||||
|
@ -35,6 +35,23 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</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>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
@ -44,15 +61,29 @@
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>13.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -8,3 +8,6 @@ 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
|
||||
|
||||
jwt.secret=wM7Pz4BxvZ5NcLaBpgJm0eRQ5ztc3W5+OPH0E7g3gcQ=
|
||||
jwt.token-expiration-ms==900000
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user