File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/main/java/com/example/FixLog Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 44import com .example .FixLog .dto .Response ;
55import com .example .FixLog .dto .post .PostResponseDto ;
66import com .example .FixLog .service .PostService ;
7- import com .example .FixLog .service .S3Service ;
87import org .springframework .web .bind .annotation .*;
98import org .springframework .web .multipart .MultipartFile ;
109
1110@ RestController
1211@ RequestMapping ("/posts" )
1312public class PostController {
1413 private final PostService postService ;
15- private final S3Service s3Service ;
1614
17- public PostController (PostService postService , S3Service s3Service ){
15+ public PostController (PostService postService ){
1816 this .postService = postService ;
19- this .s3Service = s3Service ;
2017 }
2118
2219 @ PostMapping
Original file line number Diff line number Diff line change 1919import com .example .FixLog .repository .post .PostRepository ;
2020import com .example .FixLog .repository .tag .TagRepository ;
2121import jakarta .transaction .Transactional ;
22+ import org .springframework .security .core .Authentication ;
23+ import org .springframework .security .core .context .SecurityContextHolder ;
2224import org .springframework .stereotype .Service ;
2325import org .springframework .web .multipart .MultipartFile ;
2426
@@ -99,6 +101,8 @@ public void createPost(PostRequestDto postRequestDto){
99101
100102 // 이미지 파일 마크다운으로 변경
101103 public String uploadImage (MultipartFile imageFile ){
104+ SecurityContextHolder .getContext ().getAuthentication ();
105+
102106 if (imageFile == null || imageFile .isEmpty ()){
103107 throw new CustomException (ErrorCode .IMAGE_UPLOAD_FAILED );
104108 }
You can’t perform that action at this time.
0 commit comments