diff --git a/src/backend/file_server/build.gradle b/src/backend/file_server/build.gradle index 23040886..d81ed064 100644 --- a/src/backend/file_server/build.gradle +++ b/src/backend/file_server/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.4.2' + id 'org.springframework.boot' version '3.3.7' id 'io.spring.dependency-management' version '1.1.7' } @@ -39,6 +39,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'commons-fileupload:commons-fileupload:1.4' + //common-module + implementation project(":common_module") } tasks.named('test') { diff --git a/src/backend/file_server/settings.gradle b/src/backend/file_server/settings.gradle index 41f961be..03d2a6f2 100644 --- a/src/backend/file_server/settings.gradle +++ b/src/backend/file_server/settings.gradle @@ -1 +1,4 @@ rootProject.name = 'file_server' + +include(":common_module") +findProject(":common_module")?.projectDir = file("../common_module") \ No newline at end of file diff --git a/src/backend/file_server/src/main/java/com/jootalkpia/file_server/FileServerApplication.java b/src/backend/file_server/src/main/java/com/jootalkpia/file_server/FileServerApplication.java index 9ceb45c4..ef9b67cb 100644 --- a/src/backend/file_server/src/main/java/com/jootalkpia/file_server/FileServerApplication.java +++ b/src/backend/file_server/src/main/java/com/jootalkpia/file_server/FileServerApplication.java @@ -3,7 +3,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -@SpringBootApplication +@SpringBootApplication(scanBasePackages = { + "com.jootalkpia.file_server", + "com.jootalkpia.passport", + "com.jootalkpia.config", +}) public class FileServerApplication { public static void main(String[] args) { diff --git a/src/backend/file_server/src/main/java/com/jootalkpia/file_server/controller/FileController.java b/src/backend/file_server/src/main/java/com/jootalkpia/file_server/controller/FileController.java index d5a5948b..9c6fe9af 100644 --- a/src/backend/file_server/src/main/java/com/jootalkpia/file_server/controller/FileController.java +++ b/src/backend/file_server/src/main/java/com/jootalkpia/file_server/controller/FileController.java @@ -8,6 +8,8 @@ import com.jootalkpia.file_server.dto.UploadFilesResponseDto; import com.jootalkpia.file_server.service.FileService; import com.jootalkpia.file_server.utils.ValidationUtils; +import com.jootalkpia.passport.anotation.CurrentUser; +import com.jootalkpia.passport.component.UserInfo; import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -120,14 +122,14 @@ public ResponseEntity downloadFile(@PathVariable Long fileI .body(new InputStreamResource(s3InputStream)); } - @PostMapping("/{userId}/profile-image") + @PostMapping("/profile-image") public ResponseEntity changeProfile( - @PathVariable Long userId, - @RequestParam("newImage") MultipartFile newImage) { + @RequestParam("newImage") MultipartFile newImage, + @CurrentUser UserInfo userInfo) { log.info("got new profile Image: {}", newImage); ValidationUtils.validateFile(newImage); - ChangeProfileResponseDto response = fileService.changeProfile(userId, newImage); + ChangeProfileResponseDto response = fileService.changeProfile(userInfo.userId(), newImage); return ResponseEntity.ok(response); } } \ No newline at end of file