2025-05-07 16:45:44 +09:00
|
|
|
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;
|
2025-05-12 15:09:01 +09:00
|
|
|
import co.jp.app.service.UploadService;
|
2025-05-07 16:45:44 +09:00
|
|
|
|
|
|
|
@CrossOrigin("http://192.168.1.50:5173")
|
|
|
|
@Controller
|
2025-05-07 17:56:35 +09:00
|
|
|
public class UploadController {
|
2025-05-07 16:45:44 +09:00
|
|
|
|
|
|
|
@Autowired
|
2025-05-12 15:09:01 +09:00
|
|
|
private UploadService service;
|
2025-05-07 16:45:44 +09:00
|
|
|
|
|
|
|
@PostMapping("/api/dogs/upload")
|
|
|
|
public String upload() {
|
|
|
|
List<PetEntity> list = new ArrayList<PetEntity>();
|
|
|
|
|
2025-05-12 15:09:01 +09:00
|
|
|
service.saveAllPets(list);
|
2025-05-07 16:45:44 +09:00
|
|
|
|
|
|
|
return "upload";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|