Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

이미지 에러해결중 #59

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void sendImageRequest(UploadImageRequestDto requestDto, boolean isProduct
.path(url)
.build()
.toUri();

System.out.println(uri.toString());
// 요청 본문 생성
MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
body.add("id", requestDto.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public class ChatBotController {
@PostMapping("/productImage")
public String productImageUpload(@RequestParam("id") Long id,
@RequestParam("files") List<MultipartFile> files) {

System.out.println("id: "+id);
files.stream().forEach((s)-> System.out.println(s.getName()));
chatBotService.setImages(id, files, PRODUCT);
return "/index";
}
Expand Down Expand Up @@ -92,7 +93,7 @@ public Map<String, Object> getModalContent1(@CookieValue(name = "id") String id)
@ResponseBody
public Map<String, Object> createProduct(@RequestBody CreateProductRequestDto createProductRequestDto){
Map<String, Object> response = new HashMap<>();
response.put("productId", productService.create(createProductRequestDto));
response.put("productId",productService.create(createProductRequestDto));
return response;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ public ChatBotService(ChatBotAdaptor chatBotAdaptor) {

public void setImages(Long id, List<MultipartFile> multipartFile,boolean isProduct) {
UploadImageRequestDto dto = new UploadImageRequestDto(multipartFile,id);
System.out.println(dto.toString());
try {
chatBotAdaptor.sendImageRequest(dto,isProduct);
System.out.println("어댑터끝");
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
Expand All @@ -18,6 +19,7 @@
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UploadImageRequestDto {
private List<MultipartFile> files;

Expand Down
Loading