-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from dnd-side-project/main
Develop에 Main Merge
- Loading branch information
Showing
9 changed files
with
89 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../java/com/dnd/dndtravel/map/controller/swagger/MultipartJackson2HttpMessageConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.dnd.dndtravel.map.controller.swagger; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
import org.springframework.http.MediaType; | ||
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
/** | ||
* 스웨거에서 Multipart 요청시 발생하는 "Content-Type 'application/octet-stream' is not supported" 문제를 해결하기위한 클래스 | ||
* Postman같은 프로그램으로 보낼시 사진과 json객체에 대한 타입을 별도로 지정할 수 있지만, 스웨거는 파라미터별로 별도 타입을 지정할수 없었던것이 원인 | ||
*/ | ||
@Component | ||
public class MultipartJackson2HttpMessageConverter extends AbstractJackson2HttpMessageConverter { | ||
|
||
public MultipartJackson2HttpMessageConverter(ObjectMapper objectMapper) { | ||
super(objectMapper, MediaType.APPLICATION_OCTET_STREAM); | ||
} | ||
|
||
@Override | ||
public boolean canWrite(Class<?> clazz, MediaType mediaType) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean canWrite(Type type, Class<?> clazz, MediaType mediaType) { | ||
return false; | ||
} | ||
|
||
@Override | ||
protected boolean canWrite(MediaType mediaType) { | ||
return false; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
src/main/java/com/dnd/dndtravel/map/exception/MemberAttractionNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package com.dnd.dndtravel.map.exception; | ||
|
||
public class MemberAttractionNotFoundException extends RuntimeException { | ||
private static final String MESSAGE = "존재하지 않는 방문기록 [memberAttractionId=%s]"; | ||
private static final String MESSAGE = "존재하지 않는 방문기록 혹은 멤버 [memberAttractionId=%s] [memberId=%s]"; | ||
|
||
public MemberAttractionNotFoundException(long memberAttractionId) { | ||
super(String.format(MESSAGE, memberAttractionId)); | ||
public MemberAttractionNotFoundException(long memberAttractionId, long memberId) { | ||
super(String.format(MESSAGE, memberAttractionId, memberId)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters