Skip to content

Commit

Permalink
Merge pull request #59 from We-Food-C-I-A/hotfix/57
Browse files Browse the repository at this point in the history
이미지 에러해결중
  • Loading branch information
JBumLee authored Aug 24, 2024
2 parents f927890 + 48a1c88 commit 015e3c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
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

0 comments on commit 015e3c7

Please sign in to comment.