Compare commits
5 Commits
cd6cc9812a
...
typescript
| Author | SHA1 | Date | |
|---|---|---|---|
| 890aedd380 | |||
|
|
68b7143fb2 | ||
|
|
c8993a67d1 | ||
|
|
31906f2010 | ||
|
|
41cb2eb470 |
22
pom.xml
22
pom.xml
@@ -75,7 +75,29 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>cz.habarta.typescript-generator</groupId>
|
||||
<artifactId>typescript-generator-maven-plugin</artifactId>
|
||||
<version>3.2.1263</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate</id>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<jsonLibrary>jackson2</jsonLibrary>
|
||||
<classes>
|
||||
<class>com.example.video_downloader.dto.SaveNewVideoRequest</class>
|
||||
</classes>
|
||||
<outputKind>module</outputKind>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.example.video_downloader.controllers;
|
||||
|
||||
import com.example.video_downloader.dto.SaveNewVideoRequest;
|
||||
import com.example.video_downloader.entity.Video;
|
||||
import com.example.video_downloader.repositories.VideoRepository;
|
||||
import com.example.video_downloader.services.VideoService;
|
||||
import lombok.Data;
|
||||
@@ -8,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(path = "/video" )
|
||||
@RequestMapping(path="/video")
|
||||
@CrossOrigin(origins = "http://localhost:3000")
|
||||
public class VideoController {
|
||||
|
||||
@@ -20,12 +21,12 @@ public class VideoController {
|
||||
private Long id;
|
||||
}
|
||||
|
||||
@PostMapping(path = "/video")
|
||||
@PostMapping(path = "/videos")
|
||||
public Response saveNewVideo(@RequestBody SaveNewVideoRequest request){
|
||||
|
||||
videoService.saveNewVideo(request);
|
||||
Response response = new Response();
|
||||
response.setId(videoService.saveNewVideo(request).getId());
|
||||
Video video = videoService.saveNewVideo(request);
|
||||
response.setId(video.getId());
|
||||
|
||||
return response;
|
||||
|
||||
|
||||
@@ -14,8 +14,11 @@ public class Video {
|
||||
private Long id;
|
||||
|
||||
private String url;
|
||||
private String ytld;
|
||||
private String ytdl;
|
||||
private String ytMetaData;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private StatusEnum status;
|
||||
|
||||
private String fullPath;
|
||||
}
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
spring.application.name=video_downloader
|
||||
spring.datasource.url = jdbc:postgresql://localhost:5432/videos
|
||||
spring.datasource.username = postgres
|
||||
spring.datasource.password = 5995
|
||||
spring.jpa.hibernate.ddl-auto = update
|
||||
Reference in New Issue
Block a user