-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### ๐ฉ ๊ด๋ จ์ฌํญ ### ๐ข ์ ๋ฌ์ฌํญ ๊ธฐ์กด์ ํ์ผ๊ณผ ๊ฐ์ด ์ ๋ก๋ ํ ๊ฒฝ์ฐ, json ๋ฐ์ดํฐ์ ๋ํด application/octet-stream ์ผ๋ก ์๋ ๋ณ๊ฒฝ์ด ๋์ด ๋ฐ์ดํฐ๋ฅผ ์ฒ๋ฆฌํ ์ ์๋ ๋ฌธ์ ์ํฉ์ ๋ฐ๊ฒฌํ์ฌ ํด๋น ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ์ค์ ํ์ผ์ ์ถ๊ฐํ์์ต๋๋ค. swagger์ postman ๋ชจ๋ ์ ์ ์๋ ํ์ธํ์์ต๋๋ค. ### ๐ธ ์คํฌ๋ฆฐ์ท <img width="1280" alt="image" src="https://github.com/user-attachments/assets/946e1c20-41f8-4f10-b400-fdaca29ff817"> <img width="1665" alt="image" src="https://github.com/user-attachments/assets/9aa5aee7-0d92-4002-86a3-4a22beae688a"> ### ๐ ์งํ์ฌํญ - [ ] done1 - [ ] done2 (์งํ๋์์ด์ผ ํ๋๋ฐ ๋ฏธ์ฒ ํ์ง ๋ชปํ ๋ถ๋ถ ํน์ ๊ด๋ จํ์ฌ ์์ผ๋ก ์งํ๋์ด์ผ ํ๋ ๋ถ๋ถ๋ ์ ๋ถ ์ ์ด์ ์ฒดํฌ ํ์๋ก ๊ด๋ฆฌํด์ฃผ์ธ์.) ### โ๏ธ ๊ธฐํ์ฌํญ ๊ธฐํ ์ฐธ๊ณ ์ฌํญ์ ์ ์ด์ฃผ์ธ์. ๊ฐ๋ฐ๊ธฐ๊ฐ:
- Loading branch information
Showing
9 changed files
with
76 additions
and
14 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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/net/causw/config/security/OctetStreamReadMsgConverter.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,32 @@ | ||
package net.causw.config.security; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
@Component | ||
public class OctetStreamReadMsgConverter extends AbstractJackson2HttpMessageConverter { | ||
@Autowired | ||
public OctetStreamReadMsgConverter(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; | ||
} | ||
} |
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,23 @@ | ||
package net.causw.config.security; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.converter.HttpMessageConverter; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
import java.util.List; | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
private OctetStreamReadMsgConverter octetStreamReadMsgConverter; | ||
|
||
@Autowired | ||
public WebConfig(OctetStreamReadMsgConverter octetStreamReadMsgConverter) { | ||
this.octetStreamReadMsgConverter = octetStreamReadMsgConverter; | ||
} | ||
|
||
@Override | ||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { | ||
converters.add(octetStreamReadMsgConverter); | ||
} | ||
} |