sos
This commit is contained in:
31
src/main/java/co/jp/app/controller/uploadController.java
Normal file
31
src/main/java/co/jp/app/controller/uploadController.java
Normal file
@ -0,0 +1,31 @@
|
||||
package co.jp.app.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
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;
|
||||
|
||||
@PostMapping("/api/dogs/upload")
|
||||
public String upload() {
|
||||
List<PetEntity> list = new ArrayList<PetEntity>();
|
||||
|
||||
service.saveAll(list);
|
||||
|
||||
return "upload";
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user