Skip to content

Commit

Permalink
[setting] file API setting #46
Browse files Browse the repository at this point in the history
  • Loading branch information
gdakate committed Mar 27, 2023
1 parent 7ea78bf commit 01c2b8c
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/SollutionChallenge/HighLight/File/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ public class File {
@Column(nullable = false)
private String fileUrl;

private static File createFile(Long id, User userId, String fileName, String fileUrl) {
public static File createFile(User userId, String fileName, String fileUrl) {
File file= new File();
file.id=id;
file.userId=userId;
file.fileName=fileName;
file.fileUrl=fileUrl;
return new File();
return file;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.SollutionChallenge.HighLight.File;

import org.springframework.web.bind.annotation.RestController;

import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
public class FileController {
private final FileService fileService;


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.SollutionChallenge.HighLight.File;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class FilePostResponseDto {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.SollutionChallenge.HighLight.File;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface FileRepository extends JpaRepository<Long, File> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.SollutionChallenge.HighLight.File;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class FileRequestDto {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.SollutionChallenge.HighLight.File;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.SollutionChallenge.HighLight.Folder.Folder;
import com.SollutionChallenge.HighLight.Folder.FolderRepository;

import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Service
public class FileService {
private final FileRepository fileRepository;
private final File file;

@Autowired
public FileService(FileRepository fileRepository) {
this.fileRepository = fileRepository;
this.file = File.createFile(null, null, null);
}

}

0 comments on commit 01c2b8c

Please sign in to comment.