From c4e74ff8c9623ab33cfb2ff06dbf87e55324c52c Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 27 Jul 2023 18:21:46 +0900 Subject: [PATCH 01/76] =?UTF-8?q?feat=20:=20Comment=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 170 ++++++++++++++++++ .../kr/jurumarble/comment/domain/Comment.java | 95 ++++++++++ .../dto/request/CommentCreateRequest.java | 15 ++ .../dto/request/CommentGetRequest.java | 24 +++ .../dto/request/CommentUpdateRequest.java | 13 ++ .../dto/response/CommentGetResponse.java | 53 ++++++ .../comment/repository/CommentRepository.java | 25 +++ .../comment/service/CommentService.java | 108 +++++++++++ .../java/co/kr/jurumarble/enums/SortType.java | 24 +++ 9 files changed, 527 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/comment/controller/CommentController.java create mode 100644 src/main/java/co/kr/jurumarble/comment/domain/Comment.java create mode 100644 src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java create mode 100644 src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java create mode 100644 src/main/java/co/kr/jurumarble/comment/dto/request/CommentUpdateRequest.java create mode 100644 src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java create mode 100644 src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java create mode 100644 src/main/java/co/kr/jurumarble/comment/service/CommentService.java create mode 100644 src/main/java/co/kr/jurumarble/enums/SortType.java diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java new file mode 100644 index 00000000..1dbdd91c --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -0,0 +1,170 @@ +package co.kr.jurumarble.comment.controller; + +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.dto.request.CommentGetRequest; +import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; +import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; +import co.kr.jurumarble.comment.dto.response.CommentGetResponse; +import co.kr.jurumarble.comment.service.CommentService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Slice; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +@RequestMapping("/api") +@RestController +@RequiredArgsConstructor +@Slf4j +@Tag(name = "comment", description = "comment api") +public class CommentController { + + private final CommentService commentService; + + @Operation(summary = "댓글 생성", description = "헤더에 토큰, 파라미터에 voteId, 바디에 {parentId, content} json 형식으로 보내주시면 됩니다.") + @PostMapping("/votes/{voteId}/comments") + public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute Long userId, @RequestBody @Valid CommentCreateRequest commentCreateRequest) { + + commentService.createComment(voteId, userId, commentCreateRequest); + + return new ResponseEntity(HttpStatus.CREATED); + } + + +// @Operation(summary = "댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") +// @GetMapping("/votes/{voteId}/comments") +// public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { +// +// commentService.getComments(voteId, commentGetRequest); +// +// List comments = commentListWithCount.getComments(); +// +// Pageable pageable = PageRequest.of(commentGetRequest.getPage(), commentGetRequest.getSize()); +// +// int totalCommentCount = commentListWithCount.getCommentCount(); +// int lastPageNumber = (int) Math.ceil((double) totalCommentCount / commentGetRequest.getSize()); +// +// List commentGetResponse = new ArrayList<>(); +// Map map = new HashMap<>(); +// +// for (Comment comment : comments) { +// CommentGetResponse dto = CommentGetResponse.builder() +// .id(comment.getId()) +// .userId(comment.getCommentUser().getId()) +// .content(comment.getContent()) +// .gender(comment.getGender()) +// .imageUrl(comment.getCommentUser().getImageUrl()) +// .age(comment.getAge()) +// .mbti(comment.getMbti()) +// .nickName(comment.getCommentUser().getNickname()) +// .createdDate(comment.getCreatedDate()) +// .likeCount(comment.getLikeCount()) +// .hateCount(comment.getHateCount()) +// .children(new ArrayList<>()) //NullPointerException 발생 +// .build(); +// if (comment.getParent() != null) { +// dto.setParentId(comment.getParent().getId()); +// } +// map.put(dto.getId(), dto); +// +// if (comment.getParent() != null) { +// map.get(comment.getParent().getId()).getChildren().add(dto); +// } else commentGetResponse.add(dto); +// } +// boolean hasNext = commentGetRequest.getPage() < lastPageNumber - 1; +// +// +// Slice slice = new SliceImpl<>(commentGetResponse, pageable, hasNext); +// return ResponseEntity.ok().body(slice); +// } + +// @Operation(summary = "맛보기 댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") +// @GetMapping("/votes/{voteId}/comments/hot") +// public ResponseEntity> getHotComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { +// List comments = commentService.getHotComments(voteId, commentGetRequest.getGender(), commentGetRequest.getAge(), commentGetRequest.getMbti()); +// List commentGetResponse = new ArrayList<>(); +// Map map = new HashMap<>(); +// +// for (Comment comment : comments) { +// CommentGetResponse dto = CommentGetResponse.builder() +// .id(comment.getId()) +// .userId(comment.getCommentUser().getId()) +// .content(comment.getContent()) +// .gender(comment.getGender()) +// .imageUrl(comment.getCommentUser().getImageUrl()) +// .age(comment.getAge()) +// .mbti(comment.getMbti()) +// .nickName(comment.getCommentUser().getNickname()) +// .createdDate(comment.getCreatedDate()) +// .likeCount(comment.getLikeCount()) +// .hateCount(comment.getHateCount()) +// .children(new ArrayList<>()) //NullPointerException 발생 +// .build(); +// if (comment.getParent() != null) { +// dto.setParentId(comment.getParent().getId()); +// } +// map.put(dto.getId(), dto); +// +// if (comment.getParent() != null) { +// map.get(comment.getParent().getId()).getChildren().add(dto); +// } else commentGetResponse.add(dto); +// } +// return ResponseEntity.ok().body(commentGetResponse); +// } + + @Operation(summary = "댓글 수정", description = "파라미터에 voteId, commentId {content} json 형식으로 보내주시면 됩니다.") + @PatchMapping("/votes/{voteId}/comments/{commentId}") + public ResponseEntity updateComment(@PathVariable Long voteId, @PathVariable Long commentId, @Valid @RequestBody CommentUpdateRequest commentUpdateRequest, @RequestAttribute Long userId) { + + commentService.updateComment(voteId, commentId, userId, commentUpdateRequest); + + return new ResponseEntity(HttpStatus.OK); + } + + + @Operation(summary = "댓글 삭제", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다.") + @DeleteMapping("/votes/{voteId}/comments/{commentId}") + public ResponseEntity deleteComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId) { + + commentService.deleteComment(voteId, commentId, userId); + + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + +// @Operation(summary = "댓글 좋아요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다.") +// @PostMapping("/votes/{voteId}/comments/{commentId}/likers") +// public ResponseEntity> likeComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Claims claims) throws UserNotFoundException { +// Integer userId = (int) claims.get("userId"); +// Long longId = Long.valueOf(userId); +// +// commentService.emoteComment(voteId, commentId, longId, Emotion.LIKE); +// +// Map result = new HashMap<>(); +// result.put("message", "좋아요 성공 코드"); +// +// return ResponseEntity.ok().body(result); +// } +// +// @Operation(summary = "댓글 싫어요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") +// @PostMapping("/votes/{voteId}/comments/{commentId}/haters") +// public ResponseEntity> hateComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Claims claims) throws UserNotFoundException { +// Integer userId = (int) claims.get("userId"); +// Long longId = Long.valueOf(userId); +// +// commentService.emoteComment(voteId, commentId, longId, Emotion.HATE); +// +// Map result = new HashMap<>(); +// result.put("message", "싫어요 성공 코드"); +// +// return ResponseEntity.ok().body(result); +// } + +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java new file mode 100644 index 00000000..dff2c559 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -0,0 +1,95 @@ +package co.kr.jurumarble.comment.domain; + +import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; +import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; +import co.kr.jurumarble.common.domain.BaseTimeEntity; +import co.kr.jurumarble.enums.AgeType; +import co.kr.jurumarble.enums.GenderType; +import co.kr.jurumarble.enums.MBTIType; +import co.kr.jurumarble.user.domain.User; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Comment extends BaseTimeEntity { + + @Id + @GeneratedValue + @Column + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "USER_ID") + private User user; + + @Column + private Long voteId; + @Column + private String content; + + @Enumerated(EnumType.STRING) + @Column + private AgeType age; + + @Enumerated(EnumType.STRING) + @Column + private MBTIType mbti; + + @Enumerated(EnumType.STRING) + @Column + private GenderType gender; + @Column + private Long likeCount; + @Column + private Long hateCount; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "PARENT_ID") + private Comment parent; + + @OneToMany(mappedBy = "parent", orphanRemoval = true) + private List children = new ArrayList<>(); + + public Comment(CommentCreateRequest request, Comment parentComment) { + this.parent = parentComment; + this.content = request.getContent(); + } + +// @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment") +// private List commentEmotionList = new ArrayList<>(); +// +// public void mappingCommentEmotion(CommentEmotion commentEmotion) { +// this.commentEmotionList.add(commentEmotion); +// } + +// public void updateLikeHateCount() { +// int likecnt = 0; +// int hatecnt = 0; +// for (CommentEmotion commentEmotion : commentEmotionList) { +// if (commentEmotion.getEmotion().equals(Emotion.LIKE)) { +// likecnt += 1; +// } else { +// hatecnt += 1; +// } +// } +// this.likeCount = (long) likecnt; +// this.hateCount = (long) hatecnt; +// } + +// public void removeEmotion(CommentEmotion commentEmotion) { +// this.commentEmotionList.remove(commentEmotion); +// } + + public void updateContent(CommentUpdateRequest commentUpdateRequest) { + this.content = commentUpdateRequest.getContent(); + } + + +} diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java new file mode 100644 index 00000000..8dde6c53 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java @@ -0,0 +1,15 @@ +package co.kr.jurumarble.comment.dto.request; + +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Getter +@NoArgsConstructor +public class CommentCreateRequest { + private Long parentId; + + @NotBlank + private String content; +} diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java new file mode 100644 index 00000000..f3d64359 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java @@ -0,0 +1,24 @@ +package co.kr.jurumarble.comment.dto.request; + +import co.kr.jurumarble.enums.AgeType; +import co.kr.jurumarble.enums.GenderType; +import co.kr.jurumarble.enums.MBTIType; +import co.kr.jurumarble.enums.SortType; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +@Getter +@NoArgsConstructor +public class CommentGetRequest { + + @NotNull + private SortType sortBy; + + @NotNull + private int page; + + @NotNull + private int size; +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentUpdateRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentUpdateRequest.java new file mode 100644 index 00000000..eea2e7a9 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentUpdateRequest.java @@ -0,0 +1,13 @@ +package co.kr.jurumarble.comment.dto.request; + +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Getter +@NoArgsConstructor +public class CommentUpdateRequest { + @NotBlank + private String content; +} diff --git a/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java b/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java new file mode 100644 index 00000000..d9e2451b --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java @@ -0,0 +1,53 @@ +package co.kr.jurumarble.comment.dto.response; + + +import co.kr.jurumarble.enums.AgeType; +import co.kr.jurumarble.enums.GenderType; +import co.kr.jurumarble.enums.MBTIType; +import lombok.Builder; +import lombok.Getter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Getter +public class CommentGetResponse { + + private Long id; + + private Long userId; + + private String nickName; + + private Long parentId; + + private String content; + + private String imageUrl; + + private GenderType gender; + + private AgeType age; + + private MBTIType mbti; + + private LocalDateTime createdDate; + + private List children; + + @Builder + public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MBTIType mbti, LocalDateTime createdDate, List children) { + this.id = id; + this.userId = userId; + this.nickName = nickName; + this.parentId = parentId; + this.content = content; + this.imageUrl = imageUrl; + this.gender = gender; + this.age = age; + this.mbti = mbti; + this.createdDate = createdDate; + this.children = children; + } +} diff --git a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java new file mode 100644 index 00000000..0e545191 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java @@ -0,0 +1,25 @@ +package co.kr.jurumarble.comment.repository; + +import co.kr.jurumarble.comment.domain.Comment; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface CommentRepository extends JpaRepository { + + + @Query(value = "SELECT c FROM Comment c WHERE c.voteId = :postId AND c.parent IS NULL ORDER BY (c.likeCount + c.hateCount) DESC , c.createdDate DESC") + List findHotComments(@Param("voteId") Long voteId, Pageable pageable); //인기순 댓글 불러오기 + + @Query(value = "SELECT c FROM Comment c WHERE c.voteId = :postId AND c.parent IS NULL Order By c.createdDate DESC") + List findNewestComments(@Param("voteId") Long voteId, Pageable pageable); //최신순 댓글 불러오기 + + int countCommentsByVoteId(@Param("voteId") Long voteId); + + List findByParentComment(Comment parentComment); +} diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java new file mode 100644 index 00000000..2166a7f3 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -0,0 +1,108 @@ +package co.kr.jurumarble.comment.service; + +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; +import co.kr.jurumarble.comment.dto.request.CommentGetRequest; +import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; +import co.kr.jurumarble.comment.repository.CommentRepository; +import co.kr.jurumarble.exception.comment.CommentNotFoundException; +import co.kr.jurumarble.exception.user.UserNotFoundException; +import co.kr.jurumarble.exception.vote.VoteNotFoundException; +import co.kr.jurumarble.user.repository.UserRepository; +import co.kr.jurumarble.vote.repository.VoteRepository; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Slice; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +@Service +@RequiredArgsConstructor +@Transactional +public class CommentService { + private final UserRepository userRepository; + private final VoteRepository voteRepository; + private final CommentRepository commentRepository; + + public void createComment(Long voteId, Long userId, CommentCreateRequest request) { + validateUserAndVote(voteId, userId); + Comment parentComment = checkParentComment(request); + + Comment comment = new Comment(request, parentComment); + commentRepository.save(comment); + + } + + public Slice getCommentsBySortType(Long voteId, CommentGetRequest request) { + + Pageable pageable = PageRequest.of(request.getPage(), request.getSize()); + + getCommentBySortType(voteId, request, pageable); + + + } + + private void getCommentBySortType(Long voteId, CommentGetRequest request, Pageable pageable) { + List comments; //댓글 + List childComments = new ArrayList<>(); //대댓글 + + List comments = getCommentsBySortType(voteId, request, pageable); + + int countComments = commentRepository.countCommentsByVoteId(voteId); + + //대댓글 가져오기 + for (Comment parentComment : comments) { + childComments.addAll(commentRepository.findByParentComment(parentComment)); + } + + comments.addAll(childComments); + } + + private List getCommentsBySortType(Long voteId, CommentGetRequest request, Pageable pageable) { + List comments; + switch (request.getSortBy()) { + case ByTime: + comments = commentRepository.findNewestComments(voteId, pageable); + break; + case ByPopularity: + comments = commentRepository.findHotComments(voteId, pageable); + break; + default: + throw new IllegalArgumentException("적절한 정렬 방식이 아닙니다."); //예외처리 분리해야 함 + } + return comments; + } + + + public void updateComment(Long voteId, Long commentId, Long userId, CommentUpdateRequest request) { + validateUserAndVote(voteId, userId); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + + comment.updateContent(request); + } + + public void deleteComment(Long voteId, Long commentId, Long userId) { + validateUserAndVote(voteId, userId); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + + commentRepository.delete(comment); + } + + private void validateUserAndVote(Long voteId, Long userId) { + userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + } + + private Comment checkParentComment(CommentCreateRequest request) { + Comment parentComment = null != request.getParentId() + ? commentRepository.findById(request.getParentId()) + .orElseThrow(() -> new CommentNotFoundException()) + : null; + return parentComment; + } + +} diff --git a/src/main/java/co/kr/jurumarble/enums/SortType.java b/src/main/java/co/kr/jurumarble/enums/SortType.java new file mode 100644 index 00000000..8b8ef2db --- /dev/null +++ b/src/main/java/co/kr/jurumarble/enums/SortType.java @@ -0,0 +1,24 @@ +package co.kr.jurumarble.enums; + +import co.kr.jurumarble.common.enums.EnumModel; + +public enum SortType implements EnumModel { + ByTime("최신순"), + ByPopularity("인기순"); + + private String value; + + SortType(String value) { + this.value = value; + } + + @Override + public String getKey() { + return name(); + } + + @Override + public String getValue() { + return value; + } +} From 62dbe520b7789f286dbea783df8a98db7971fc55 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 27 Jul 2023 22:24:15 +0900 Subject: [PATCH 02/76] =?UTF-8?q?feat=20:=20Comment=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/domain/Comment.java | 9 ++- .../comment/repository/CommentRepository.java | 8 +-- .../comment/service/CommentService.java | 64 +++++++++---------- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index dff2c559..70609eb4 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -45,8 +45,10 @@ public class Comment extends BaseTimeEntity { @Enumerated(EnumType.STRING) @Column private GenderType gender; + @Column private Long likeCount; + @Column private Long hateCount; @@ -57,9 +59,14 @@ public class Comment extends BaseTimeEntity { @OneToMany(mappedBy = "parent", orphanRemoval = true) private List children = new ArrayList<>(); - public Comment(CommentCreateRequest request, Comment parentComment) { + public Comment(CommentCreateRequest request, Comment parentComment, User user, Long voteId) { + this.user = user; + this.voteId = voteId; this.parent = parentComment; this.content = request.getContent(); + this.age = user.classifyAge(user.getAge()); + this.mbti = user.getMbti(); + this.gender = user.getGender(); } // @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment") diff --git a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java index 0e545191..b66f4ca9 100644 --- a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java +++ b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java @@ -13,13 +13,13 @@ public interface CommentRepository extends JpaRepository { - @Query(value = "SELECT c FROM Comment c WHERE c.voteId = :postId AND c.parent IS NULL ORDER BY (c.likeCount + c.hateCount) DESC , c.createdDate DESC") + @Query(value = "SELECT c FROM Comment c WHERE c.voteId = :voteId AND c.parent IS NULL ORDER BY (c.likeCount + c.hateCount) DESC , c.createdDate DESC") List findHotComments(@Param("voteId") Long voteId, Pageable pageable); //인기순 댓글 불러오기 - @Query(value = "SELECT c FROM Comment c WHERE c.voteId = :postId AND c.parent IS NULL Order By c.createdDate DESC") + @Query(value = "SELECT c FROM Comment c WHERE c.voteId = :voteId AND c.parent IS NULL Order By c.createdDate DESC") List findNewestComments(@Param("voteId") Long voteId, Pageable pageable); //최신순 댓글 불러오기 - int countCommentsByVoteId(@Param("voteId") Long voteId); + int countByVoteIdAndParentIsNull(Long voteId); - List findByParentComment(Comment parentComment); + List findByParent(Comment parent); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 2166a7f3..9aa92833 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -8,12 +8,11 @@ import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.user.UserNotFoundException; import co.kr.jurumarble.exception.vote.VoteNotFoundException; +import co.kr.jurumarble.user.domain.User; import co.kr.jurumarble.user.repository.UserRepository; import co.kr.jurumarble.vote.repository.VoteRepository; import lombok.RequiredArgsConstructor; -import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Slice; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -29,36 +28,51 @@ public class CommentService { private final CommentRepository commentRepository; public void createComment(Long voteId, Long userId, CommentCreateRequest request) { - validateUserAndVote(voteId, userId); + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = checkParentComment(request); - Comment comment = new Comment(request, parentComment); + Comment comment = new Comment(request, parentComment, user, voteId); commentRepository.save(comment); } - public Slice getCommentsBySortType(Long voteId, CommentGetRequest request) { + private void getComments(Long voteId, CommentGetRequest request, Pageable pageable) { + List comments = getCommentsBySortType(voteId, request, pageable); //정렬방식에 따라 Pageable 적용하여 부모댓글 가져오기 + + getChildCommentByParentComment(comments); //부모댓글에 속한 대댓글들 다가져오기 + + int countComments = commentRepository.countByVoteIdAndParentIsNull(voteId); //투표에 속한 부모 댓글수 전부 가져오기 + - Pageable pageable = PageRequest.of(request.getPage(), request.getSize()); - getCommentBySortType(voteId, request, pageable); } - private void getCommentBySortType(Long voteId, CommentGetRequest request, Pageable pageable) { - List comments; //댓글 - List childComments = new ArrayList<>(); //대댓글 + public void updateComment(Long voteId, Long commentId, Long userId, CommentUpdateRequest request) { + userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - List comments = getCommentsBySortType(voteId, request, pageable); + comment.updateContent(request); + } + + public void deleteComment(Long voteId, Long commentId, Long userId) { + userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + + commentRepository.delete(comment); + } - int countComments = commentRepository.countCommentsByVoteId(voteId); + private void getChildCommentByParentComment(List comments) { + List childComments = new ArrayList<>(); //대댓글 //대댓글 가져오기 - for (Comment parentComment : comments) { - childComments.addAll(commentRepository.findByParentComment(parentComment)); + for (Comment parent : comments) { + childComments.addAll(commentRepository.findByParent(parent)); } - comments.addAll(childComments); } @@ -77,26 +91,6 @@ private List getCommentsBySortType(Long voteId, CommentGetRequest reque return comments; } - - public void updateComment(Long voteId, Long commentId, Long userId, CommentUpdateRequest request) { - validateUserAndVote(voteId, userId); - Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - - comment.updateContent(request); - } - - public void deleteComment(Long voteId, Long commentId, Long userId) { - validateUserAndVote(voteId, userId); - Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - - commentRepository.delete(comment); - } - - private void validateUserAndVote(Long voteId, Long userId) { - userRepository.findById(userId).orElseThrow(UserNotFoundException::new); - voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); - } - private Comment checkParentComment(CommentCreateRequest request) { Comment parentComment = null != request.getParentId() ? commentRepository.findById(request.getParentId()) From 75a8e626cbf8eb66d4950cab97ab900ef22ac10b Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 28 Jul 2023 03:10:43 +0900 Subject: [PATCH 03/76] =?UTF-8?q?feat=20:=20=EB=8C=93=EA=B8=80=20CRUD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/co/kr/jurumarble/EbHealthCheck.java | 2 +- .../comment/controller/CommentController.java | 94 ++----------------- .../kr/jurumarble/comment/domain/Comment.java | 17 ++-- .../dto/request/CommentCreateRequest.java | 1 + .../dto/request/CommentGetRequest.java | 7 +- .../dto/response/CommentGetResponse.java | 38 +++++++- .../{user => comment}/enums/SortType.java | 2 +- .../comment/service/CommentService.java | 57 +++++++++-- 8 files changed, 107 insertions(+), 111 deletions(-) rename src/main/java/co/kr/jurumarble/{user => comment}/enums/SortType.java (90%) diff --git a/src/main/java/co/kr/jurumarble/EbHealthCheck.java b/src/main/java/co/kr/jurumarble/EbHealthCheck.java index 014cf9be..b747bcdf 100644 --- a/src/main/java/co/kr/jurumarble/EbHealthCheck.java +++ b/src/main/java/co/kr/jurumarble/EbHealthCheck.java @@ -10,7 +10,7 @@ @RestController @RequiredArgsConstructor @Controller -public class EbHealthCheck { +public class EbHealthCheck { @Value("${swagger.url}") private String swaggerUrl; diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index 1dbdd91c..ebdecb6b 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -1,24 +1,20 @@ package co.kr.jurumarble.comment.controller; -import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; import co.kr.jurumarble.comment.dto.request.CommentGetRequest; import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; -import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; import co.kr.jurumarble.comment.dto.response.CommentGetResponse; import co.kr.jurumarble.comment.service.CommentService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; -import java.util.List; @RequestMapping("/api") @RestController @@ -39,86 +35,16 @@ public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute } -// @Operation(summary = "댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") -// @GetMapping("/votes/{voteId}/comments") -// public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { -// -// commentService.getComments(voteId, commentGetRequest); -// -// List comments = commentListWithCount.getComments(); -// -// Pageable pageable = PageRequest.of(commentGetRequest.getPage(), commentGetRequest.getSize()); -// -// int totalCommentCount = commentListWithCount.getCommentCount(); -// int lastPageNumber = (int) Math.ceil((double) totalCommentCount / commentGetRequest.getSize()); -// -// List commentGetResponse = new ArrayList<>(); -// Map map = new HashMap<>(); -// -// for (Comment comment : comments) { -// CommentGetResponse dto = CommentGetResponse.builder() -// .id(comment.getId()) -// .userId(comment.getCommentUser().getId()) -// .content(comment.getContent()) -// .gender(comment.getGender()) -// .imageUrl(comment.getCommentUser().getImageUrl()) -// .age(comment.getAge()) -// .mbti(comment.getMbti()) -// .nickName(comment.getCommentUser().getNickname()) -// .createdDate(comment.getCreatedDate()) -// .likeCount(comment.getLikeCount()) -// .hateCount(comment.getHateCount()) -// .children(new ArrayList<>()) //NullPointerException 발생 -// .build(); -// if (comment.getParent() != null) { -// dto.setParentId(comment.getParent().getId()); -// } -// map.put(dto.getId(), dto); -// -// if (comment.getParent() != null) { -// map.get(comment.getParent().getId()).getChildren().add(dto); -// } else commentGetResponse.add(dto); -// } -// boolean hasNext = commentGetRequest.getPage() < lastPageNumber - 1; -// -// -// Slice slice = new SliceImpl<>(commentGetResponse, pageable, hasNext); -// return ResponseEntity.ok().body(slice); -// } + @Operation(summary = "댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") + @GetMapping("/votes/{voteId}/comments") + public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { + + Slice commentGetResponses = commentService.getComments(voteId, commentGetRequest); + + return new ResponseEntity(commentGetResponses, HttpStatus.OK); + } + -// @Operation(summary = "맛보기 댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") -// @GetMapping("/votes/{voteId}/comments/hot") -// public ResponseEntity> getHotComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { -// List comments = commentService.getHotComments(voteId, commentGetRequest.getGender(), commentGetRequest.getAge(), commentGetRequest.getMbti()); -// List commentGetResponse = new ArrayList<>(); -// Map map = new HashMap<>(); -// -// for (Comment comment : comments) { -// CommentGetResponse dto = CommentGetResponse.builder() -// .id(comment.getId()) -// .userId(comment.getCommentUser().getId()) -// .content(comment.getContent()) -// .gender(comment.getGender()) -// .imageUrl(comment.getCommentUser().getImageUrl()) -// .age(comment.getAge()) -// .mbti(comment.getMbti()) -// .nickName(comment.getCommentUser().getNickname()) -// .createdDate(comment.getCreatedDate()) -// .likeCount(comment.getLikeCount()) -// .hateCount(comment.getHateCount()) -// .children(new ArrayList<>()) //NullPointerException 발생 -// .build(); -// if (comment.getParent() != null) { -// dto.setParentId(comment.getParent().getId()); -// } -// map.put(dto.getId(), dto); -// -// if (comment.getParent() != null) { -// map.get(comment.getParent().getId()).getChildren().add(dto); -// } else commentGetResponse.add(dto); -// } -// return ResponseEntity.ok().body(commentGetResponse); -// } @Operation(summary = "댓글 수정", description = "파라미터에 voteId, commentId {content} json 형식으로 보내주시면 됩니다.") @PatchMapping("/votes/{voteId}/comments/{commentId}") diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index 70609eb4..8830f536 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -3,10 +3,10 @@ import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; import co.kr.jurumarble.common.domain.BaseTimeEntity; -import co.kr.jurumarble.enums.AgeType; -import co.kr.jurumarble.enums.GenderType; -import co.kr.jurumarble.enums.MBTIType; import co.kr.jurumarble.user.domain.User; +import co.kr.jurumarble.user.enums.AgeType; +import co.kr.jurumarble.user.enums.GenderType; +import co.kr.jurumarble.user.enums.MbtiType; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; @@ -40,7 +40,7 @@ public class Comment extends BaseTimeEntity { @Enumerated(EnumType.STRING) @Column - private MBTIType mbti; + private MbtiType mbti; @Enumerated(EnumType.STRING) @Column @@ -59,16 +59,21 @@ public class Comment extends BaseTimeEntity { @OneToMany(mappedBy = "parent", orphanRemoval = true) private List children = new ArrayList<>(); - public Comment(CommentCreateRequest request, Comment parentComment, User user, Long voteId) { + public Comment(CommentCreateRequest request, Comment parent, User user, Long voteId) { this.user = user; this.voteId = voteId; - this.parent = parentComment; this.content = request.getContent(); this.age = user.classifyAge(user.getAge()); this.mbti = user.getMbti(); this.gender = user.getGender(); + this.parent = parent; } + public void updateParent(Comment parent) { + this.parent = parent; + } + + // @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment") // private List commentEmotionList = new ArrayList<>(); // diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java index 8dde6c53..6984d43a 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java @@ -8,6 +8,7 @@ @Getter @NoArgsConstructor public class CommentCreateRequest { + private Long parentId; @NotBlank diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java index f3d64359..02b99dfc 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java @@ -1,15 +1,14 @@ package co.kr.jurumarble.comment.dto.request; -import co.kr.jurumarble.enums.AgeType; -import co.kr.jurumarble.enums.GenderType; -import co.kr.jurumarble.enums.MBTIType; -import co.kr.jurumarble.enums.SortType; +import co.kr.jurumarble.comment.enums.SortType; import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; import javax.validation.constraints.NotNull; @Getter +@Setter @NoArgsConstructor public class CommentGetRequest { diff --git a/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java b/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java index d9e2451b..d9f5a87f 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java @@ -1,17 +1,21 @@ package co.kr.jurumarble.comment.dto.response; -import co.kr.jurumarble.enums.AgeType; -import co.kr.jurumarble.enums.GenderType; -import co.kr.jurumarble.enums.MBTIType; +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.dto.request.CommentGetRequest; +import co.kr.jurumarble.user.enums.AgeType; +import co.kr.jurumarble.user.enums.GenderType; +import co.kr.jurumarble.user.enums.MbtiType; import lombok.Builder; import lombok.Getter; +import lombok.Setter; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Getter +@Setter public class CommentGetResponse { private Long id; @@ -30,14 +34,14 @@ public class CommentGetResponse { private AgeType age; - private MBTIType mbti; + private MbtiType mbti; private LocalDateTime createdDate; private List children; @Builder - public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MBTIType mbti, LocalDateTime createdDate, List children) { + public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MbtiType mbti, LocalDateTime createdDate, List children) { this.id = id; this.userId = userId; this.nickName = nickName; @@ -50,4 +54,28 @@ public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, this.createdDate = createdDate; this.children = children; } + + @Builder + public CommentGetResponse(Comment comment) { + this.id = comment.getId(); + this.userId = comment.getUser().getId(); + this.content = comment.getContent(); + this.gender = comment.getGender(); + this.imageUrl = comment.getUser().getImageUrl(); + this.age = comment.getAge(); + this.mbti = comment.getMbti(); + this.nickName = comment.getUser().getNickname(); + this.createdDate = comment.getCreatedDate(); + this.children = new ArrayList<>(); + + if (comment.getParent() != null) { + this.parentId = comment.getParent().getId(); + } else { + this.parentId = null; + } + } + + + + } diff --git a/src/main/java/co/kr/jurumarble/user/enums/SortType.java b/src/main/java/co/kr/jurumarble/comment/enums/SortType.java similarity index 90% rename from src/main/java/co/kr/jurumarble/user/enums/SortType.java rename to src/main/java/co/kr/jurumarble/comment/enums/SortType.java index 8b8ef2db..8cf782e8 100644 --- a/src/main/java/co/kr/jurumarble/user/enums/SortType.java +++ b/src/main/java/co/kr/jurumarble/comment/enums/SortType.java @@ -1,4 +1,4 @@ -package co.kr.jurumarble.enums; +package co.kr.jurumarble.comment.enums; import co.kr.jurumarble.common.enums.EnumModel; diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 9aa92833..8074ec3c 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -4,6 +4,7 @@ import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; import co.kr.jurumarble.comment.dto.request.CommentGetRequest; import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; +import co.kr.jurumarble.comment.dto.response.CommentGetResponse; import co.kr.jurumarble.comment.repository.CommentRepository; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.user.UserNotFoundException; @@ -12,12 +13,17 @@ import co.kr.jurumarble.user.repository.UserRepository; import co.kr.jurumarble.vote.repository.VoteRepository; import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Slice; +import org.springframework.data.domain.SliceImpl; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Service @RequiredArgsConstructor @@ -33,22 +39,27 @@ public void createComment(Long voteId, Long userId, CommentCreateRequest request Comment parentComment = checkParentComment(request); Comment comment = new Comment(request, parentComment, user, voteId); + commentRepository.save(comment); } - private void getComments(Long voteId, CommentGetRequest request, Pageable pageable) { - List comments = getCommentsBySortType(voteId, request, pageable); //정렬방식에 따라 Pageable 적용하여 부모댓글 가져오기 + public Slice getComments(Long voteId, CommentGetRequest request) { + Pageable pageable = PageRequest.of(request.getPage(), request.getSize()); + + List comments = findCommentsBySortType(voteId, request, pageable); //정렬방식에 따라 Pageable 적용하여 부모댓글 가져오기 getChildCommentByParentComment(comments); //부모댓글에 속한 대댓글들 다가져오기 - int countComments = commentRepository.countByVoteIdAndParentIsNull(voteId); //투표에 속한 부모 댓글수 전부 가져오기 + List commentGetResponse = convertToCommentGetResponseList(comments); // 댓글 목록을 매개 변수로 받아, CommentGetResponse 목록을 반환 + Slice slice = getSliceCommentGetResponses(voteId, request, pageable, commentGetResponse); // Response 리스트를 Slice 객체로 만들어주기 + return slice; + } - } public void updateComment(Long voteId, Long commentId, Long userId, CommentUpdateRequest request) { userRepository.findById(userId).orElseThrow(UserNotFoundException::new); @@ -76,7 +87,7 @@ private void getChildCommentByParentComment(List comments) { comments.addAll(childComments); } - private List getCommentsBySortType(Long voteId, CommentGetRequest request, Pageable pageable) { + private List findCommentsBySortType(Long voteId, CommentGetRequest request, Pageable pageable) { List comments; switch (request.getSortBy()) { case ByTime: @@ -92,11 +103,37 @@ private List getCommentsBySortType(Long voteId, CommentGetRequest reque } private Comment checkParentComment(CommentCreateRequest request) { - Comment parentComment = null != request.getParentId() - ? commentRepository.findById(request.getParentId()) - .orElseThrow(() -> new CommentNotFoundException()) - : null; - return parentComment; + if (request.getParentId() == null) { + return null; + } + return commentRepository.findById(request.getParentId()) + .orElseThrow(() -> new CommentNotFoundException()); + } + + private List convertToCommentGetResponseList(List parentComments) { + List commentGetResponse = new ArrayList<>(); + Map map = new HashMap<>(); + + for (Comment comment : parentComments) { + CommentGetResponse response = new CommentGetResponse(comment); + map.put(response.getId(), response); + + if (response.getParentId() != null) { + map.get(response.getParentId()).getChildren().add(response); + } else { + commentGetResponse.add(response); + } + } + return commentGetResponse; + } + + private Slice getSliceCommentGetResponses(Long voteId, CommentGetRequest request, Pageable pageable, List commentGetResponse) { + int countComments = commentRepository.countByVoteIdAndParentIsNull(voteId); //투표에 속한 부모 댓글수 전부 가져오기 + int lastPageNumber = (int) Math.ceil((double) countComments / request.getSize()); + boolean hasNext = request.getPage() < lastPageNumber - 1; + + Slice slice = new SliceImpl<>(commentGetResponse, pageable, hasNext); + return slice; } } From 55d296770c8ffe90bd0a9d3fd21d70ed8515f4c6 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 28 Jul 2023 03:11:05 +0900 Subject: [PATCH 04/76] =?UTF-8?q?fix=20:=20BaseTimeEntity=EA=B0=80=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/co/kr/jurumarble/JurumarbleApplication.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/co/kr/jurumarble/JurumarbleApplication.java b/src/main/java/co/kr/jurumarble/JurumarbleApplication.java index 9dbcf69a..61c0bf4a 100644 --- a/src/main/java/co/kr/jurumarble/JurumarbleApplication.java +++ b/src/main/java/co/kr/jurumarble/JurumarbleApplication.java @@ -2,7 +2,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +@EnableJpaAuditing @SpringBootApplication public class JurumarbleApplication { From 38b27a094448ee82630e6f2661d1a2334581805c Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 28 Jul 2023 03:12:09 +0900 Subject: [PATCH 05/76] =?UTF-8?q?chore=20:=20=EC=9D=B8=ED=84=B0=EC=85=89?= =?UTF-8?q?=ED=84=B0=20Comment=20=EA=B2=BD=EB=A1=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/co/kr/jurumarble/config/WebConfig.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/co/kr/jurumarble/config/WebConfig.java b/src/main/java/co/kr/jurumarble/config/WebConfig.java index 9012691a..29a5133e 100644 --- a/src/main/java/co/kr/jurumarble/config/WebConfig.java +++ b/src/main/java/co/kr/jurumarble/config/WebConfig.java @@ -18,7 +18,14 @@ public class WebConfig implements WebMvcConfigurer { public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(tokenInterceptor) .order(1) - .addPathPatterns("/api/users/additional-info"); + .addPathPatterns("/api/users/additional-info") + .addPathPatterns("/api/votes") + .addPathPatterns("/api/votes/{voteId}") + .addPathPatterns("/api/votes/{voteId}/vote") + .addPathPatterns("/api/votes/{voteId}/comments") + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}"); + + } @Override From 73d1e2bb3cc2b1dbedd5824850097a1da132e947 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 29 Jul 2023 03:50:25 +0900 Subject: [PATCH 06/76] =?UTF-8?q?feat=20:=20=EB=8C=93=EA=B8=80=20CRUD=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/co/kr/jurumarble/comment/service/CommentService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 8074ec3c..448c3510 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -53,7 +53,7 @@ public Slice getComments(Long voteId, CommentGetRequest requ List commentGetResponse = convertToCommentGetResponseList(comments); // 댓글 목록을 매개 변수로 받아, CommentGetResponse 목록을 반환 - Slice slice = getSliceCommentGetResponses(voteId, request, pageable, commentGetResponse); // Response 리스트를 Slice 객체로 만들어주기 + Slice slice = convertToSlice(voteId, request, pageable, commentGetResponse); // Response 리스트를 Slice 객체로 만들어주기 return slice; @@ -127,7 +127,7 @@ private List convertToCommentGetResponseList(List p return commentGetResponse; } - private Slice getSliceCommentGetResponses(Long voteId, CommentGetRequest request, Pageable pageable, List commentGetResponse) { + private Slice convertToSlice(Long voteId, CommentGetRequest request, Pageable pageable, List commentGetResponse) { int countComments = commentRepository.countByVoteIdAndParentIsNull(voteId); //투표에 속한 부모 댓글수 전부 가져오기 int lastPageNumber = (int) Math.ceil((double) countComments / request.getSize()); boolean hasNext = request.getPage() < lastPageNumber - 1; From 64ba0ea4e9f7675f3898541ce584e040b60cd7b2 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 30 Jul 2023 20:46:31 +0900 Subject: [PATCH 07/76] =?UTF-8?q?feat=20:=20=EB=8C=93=EA=B8=80=20=EC=A2=8B?= =?UTF-8?q?=EC=95=84=EC=9A=94=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 48 ++++++--------- .../kr/jurumarble/comment/domain/Comment.java | 55 +++++++++-------- .../comment/domain/CommentEmotion.java | 53 ++++++++++++++++ .../dto/response/CommentGetResponse.java | 13 ++-- .../kr/jurumarble/comment/enums/Emotion.java | 25 ++++++++ .../repository/CommentEmotionRepository.java | 16 +++++ .../comment/service/CommentService.java | 61 +++++++++++++++++-- .../co/kr/jurumarble/config/WebConfig.java | 4 +- .../CommentEmotionNotFoundException.java | 15 +++++ .../user/controller/UserController.java | 1 + .../co/kr/jurumarble/user/domain/User.java | 14 ++++- 11 files changed, 241 insertions(+), 64 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java create mode 100644 src/main/java/co/kr/jurumarble/comment/enums/Emotion.java create mode 100644 src/main/java/co/kr/jurumarble/comment/repository/CommentEmotionRepository.java create mode 100644 src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index ebdecb6b..54c77553 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -4,6 +4,7 @@ import co.kr.jurumarble.comment.dto.request.CommentGetRequest; import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; import co.kr.jurumarble.comment.dto.response.CommentGetResponse; +import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.comment.service.CommentService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.Map; @RequestMapping("/api") @RestController @@ -45,7 +47,6 @@ public ResponseEntity> getComment(@PathVariable Long v } - @Operation(summary = "댓글 수정", description = "파라미터에 voteId, commentId {content} json 형식으로 보내주시면 됩니다.") @PatchMapping("/votes/{voteId}/comments/{commentId}") public ResponseEntity updateComment(@PathVariable Long voteId, @PathVariable Long commentId, @Valid @RequestBody CommentUpdateRequest commentUpdateRequest, @RequestAttribute Long userId) { @@ -65,32 +66,23 @@ public ResponseEntity deleteComment(@PathVariable Long voteId, @PathVariable Lon return new ResponseEntity(HttpStatus.NO_CONTENT); } -// @Operation(summary = "댓글 좋아요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다.") -// @PostMapping("/votes/{voteId}/comments/{commentId}/likers") -// public ResponseEntity> likeComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Claims claims) throws UserNotFoundException { -// Integer userId = (int) claims.get("userId"); -// Long longId = Long.valueOf(userId); -// -// commentService.emoteComment(voteId, commentId, longId, Emotion.LIKE); -// -// Map result = new HashMap<>(); -// result.put("message", "좋아요 성공 코드"); -// -// return ResponseEntity.ok().body(result); -// } -// -// @Operation(summary = "댓글 싫어요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") -// @PostMapping("/votes/{voteId}/comments/{commentId}/haters") -// public ResponseEntity> hateComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Claims claims) throws UserNotFoundException { -// Integer userId = (int) claims.get("userId"); -// Long longId = Long.valueOf(userId); -// -// commentService.emoteComment(voteId, commentId, longId, Emotion.HATE); -// -// Map result = new HashMap<>(); -// result.put("message", "싫어요 성공 코드"); -// -// return ResponseEntity.ok().body(result); -// } + @Operation(summary = "댓글 좋아요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다.") + @PostMapping("/votes/{voteId}/comments/{commentId}/likers") + public ResponseEntity likeComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId) { + + commentService.emoteComment(voteId, commentId, userId, Emotion.LIKE); + + return new ResponseEntity(HttpStatus.OK); + } + + @Operation(summary = "댓글 싫어요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @PostMapping("/votes/{voteId}/comments/{commentId}/haters") + public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId) { + + commentService.emoteComment(voteId, commentId, userId, Emotion.HATE); + + + return new ResponseEntity(HttpStatus.OK); + } } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index 8830f536..7ae5eaac 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -2,6 +2,7 @@ import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; +import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.common.domain.BaseTimeEntity; import co.kr.jurumarble.user.domain.User; import co.kr.jurumarble.user.enums.AgeType; @@ -47,10 +48,10 @@ public class Comment extends BaseTimeEntity { private GenderType gender; @Column - private Long likeCount; + private Integer likeCount; @Column - private Long hateCount; + private Integer hateCount; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PARENT_ID") @@ -59,6 +60,10 @@ public class Comment extends BaseTimeEntity { @OneToMany(mappedBy = "parent", orphanRemoval = true) private List children = new ArrayList<>(); + @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment") + private List commentEmotionList = new ArrayList<>(); + + public Comment(CommentCreateRequest request, Comment parent, User user, Long voteId) { this.user = user; this.voteId = voteId; @@ -67,41 +72,39 @@ public Comment(CommentCreateRequest request, Comment parent, User user, Long vot this.mbti = user.getMbti(); this.gender = user.getGender(); this.parent = parent; + this.likeCount = 0; + this.hateCount = 0; } public void updateParent(Comment parent) { this.parent = parent; } + public void mappingCommentEmotion(CommentEmotion commentEmotion) { + this.commentEmotionList.add(commentEmotion); + } -// @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment") -// private List commentEmotionList = new ArrayList<>(); -// -// public void mappingCommentEmotion(CommentEmotion commentEmotion) { -// this.commentEmotionList.add(commentEmotion); -// } - -// public void updateLikeHateCount() { -// int likecnt = 0; -// int hatecnt = 0; -// for (CommentEmotion commentEmotion : commentEmotionList) { -// if (commentEmotion.getEmotion().equals(Emotion.LIKE)) { -// likecnt += 1; -// } else { -// hatecnt += 1; -// } -// } -// this.likeCount = (long) likecnt; -// this.hateCount = (long) hatecnt; -// } - -// public void removeEmotion(CommentEmotion commentEmotion) { -// this.commentEmotionList.remove(commentEmotion); -// } + public void updateLikeHateCount() { + int likecnt = 0; + int hatecnt = 0; + for (CommentEmotion commentEmotion : commentEmotionList) { + if (commentEmotion.getEmotion().equals(Emotion.LIKE)) { + likecnt += 1; + } else { + hatecnt += 1; + } + } + this.likeCount = likecnt; + this.hateCount = hatecnt; + } public void updateContent(CommentUpdateRequest commentUpdateRequest) { this.content = commentUpdateRequest.getContent(); } + public void removeEmotion(CommentEmotion commentEmotion) { + this.commentEmotionList.remove(commentEmotion); + } + } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java b/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java new file mode 100644 index 00000000..83ab5464 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java @@ -0,0 +1,53 @@ +package co.kr.jurumarble.comment.domain; + +import co.kr.jurumarble.comment.enums.Emotion; +import co.kr.jurumarble.user.domain.User; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.persistence.*; + +@Entity +@Getter +@NoArgsConstructor +public class CommentEmotion { + @Id + @GeneratedValue + @Column + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "USER_ID") + private User user; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "COMMENT_ID") + private Comment comment; + + @Column + @Enumerated(EnumType.STRING) + private Emotion emotion; + + @Builder + public CommentEmotion(User user, Comment comment, Emotion emotion) { + this.user = user; + this.comment = comment; + this.emotion = emotion; + } + + public void mappingComment(Comment comment) { + this.comment = comment; + comment.mappingCommentEmotion(this); + } + + public void mappingUser(User user) { + this.user = user; + user.mappingCommentLike(this); + } + + public void setEmote(Emotion emotion) { + this.emotion = emotion; + } + +} diff --git a/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java b/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java index d9f5a87f..1e653b97 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java @@ -2,7 +2,6 @@ import co.kr.jurumarble.comment.domain.Comment; -import co.kr.jurumarble.comment.dto.request.CommentGetRequest; import co.kr.jurumarble.user.enums.AgeType; import co.kr.jurumarble.user.enums.GenderType; import co.kr.jurumarble.user.enums.MbtiType; @@ -40,8 +39,12 @@ public class CommentGetResponse { private List children; + private Integer likeCount; + + private Integer hateCount; + @Builder - public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MbtiType mbti, LocalDateTime createdDate, List children) { + public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MbtiType mbti, LocalDateTime createdDate, List children, Integer likeCount, Integer hateCount) { this.id = id; this.userId = userId; this.nickName = nickName; @@ -53,6 +56,8 @@ public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, this.mbti = mbti; this.createdDate = createdDate; this.children = children; + this.likeCount = likeCount; + this.hateCount = hateCount; } @Builder @@ -67,6 +72,8 @@ public CommentGetResponse(Comment comment) { this.nickName = comment.getUser().getNickname(); this.createdDate = comment.getCreatedDate(); this.children = new ArrayList<>(); + this.likeCount = comment.getLikeCount(); + this.hateCount = comment.getHateCount(); if (comment.getParent() != null) { this.parentId = comment.getParent().getId(); @@ -76,6 +83,4 @@ public CommentGetResponse(Comment comment) { } - - } diff --git a/src/main/java/co/kr/jurumarble/comment/enums/Emotion.java b/src/main/java/co/kr/jurumarble/comment/enums/Emotion.java new file mode 100644 index 00000000..f90dd2a5 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/enums/Emotion.java @@ -0,0 +1,25 @@ +package co.kr.jurumarble.comment.enums; + +import co.kr.jurumarble.common.enums.EnumModel; + +public enum Emotion implements EnumModel { + + LIKE("좋아요"), + HATE("싫어요"); + + private String value; + + Emotion(String value) { + this.value = value; + } + + @Override + public String getKey() { + return name(); + } + + @Override + public String getValue() { + return value; + } +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/repository/CommentEmotionRepository.java b/src/main/java/co/kr/jurumarble/comment/repository/CommentEmotionRepository.java new file mode 100644 index 00000000..7e418fab --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/repository/CommentEmotionRepository.java @@ -0,0 +1,16 @@ +package co.kr.jurumarble.comment.repository; + +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.domain.CommentEmotion; +import co.kr.jurumarble.user.domain.User; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +@Repository +public interface CommentEmotionRepository extends JpaRepository { + Optional findByCommentAndUser(Comment comment, User user); + + +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 448c3510..0cb5e32d 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -1,16 +1,21 @@ package co.kr.jurumarble.comment.service; import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.domain.CommentEmotion; import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; import co.kr.jurumarble.comment.dto.request.CommentGetRequest; import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; import co.kr.jurumarble.comment.dto.response.CommentGetResponse; +import co.kr.jurumarble.comment.enums.Emotion; +import co.kr.jurumarble.comment.repository.CommentEmotionRepository; import co.kr.jurumarble.comment.repository.CommentRepository; +import co.kr.jurumarble.exception.comment.CommentEmotionNotFoundException; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.user.UserNotFoundException; import co.kr.jurumarble.exception.vote.VoteNotFoundException; import co.kr.jurumarble.user.domain.User; import co.kr.jurumarble.user.repository.UserRepository; +import co.kr.jurumarble.vote.domain.Vote; import co.kr.jurumarble.vote.repository.VoteRepository; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.PageRequest; @@ -20,10 +25,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Service @RequiredArgsConstructor @@ -33,6 +35,8 @@ public class CommentService { private final VoteRepository voteRepository; private final CommentRepository commentRepository; + private final CommentEmotionRepository commentEmotionRepository; + public void createComment(Long voteId, Long userId, CommentCreateRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -136,4 +140,53 @@ private Slice convertToSlice(Long voteId, CommentGetRequest return slice; } + public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emotion) { + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + + doEmote(emotion, user, comment); + } + + private void doEmote(Emotion emotion, User user, Comment comment) { //책임에 맞게 리팩토링 해야함 + Optional byCommentAndUser = commentEmotionRepository.findByCommentAndUser(comment, user); + + byCommentAndUser.ifPresentOrElse(commentEmotion -> { + + //좋아요(싫어요)를 기존에 눌렀는데 또 눌렀을 경우 좋아요(싫어요) 취소 + if (emotion == commentEmotion.getEmotion()) { + commentEmotionRepository.delete(commentEmotion); + comment.removeEmotion(commentEmotion); + comment.updateLikeHateCount(); + } + //싫어요(좋아요)를 기존에 누른 상태로 좋아요(싫어요)를 누른 경우 싫어요(좋아요) 취소 후 좋아요(싫어요)로 등록 + else { + commentEmotionRepository.delete(commentEmotion); + comment.removeEmotion(commentEmotion); + + CommentEmotion changeEmotion = new CommentEmotion(); + + changeEmotion.setEmote(emotion); + changeEmotion.mappingComment(comment); + changeEmotion.mappingUser(user); + comment.updateLikeHateCount(); + + commentEmotionRepository.save(changeEmotion); + } + + }, + // 좋아요(싫어요)가 없을 경우 좋아요(싫어요) 추가 + () -> { + CommentEmotion commentEmotion = new CommentEmotion(); + + commentEmotion.setEmote(emotion); + commentEmotion.mappingComment(comment); + commentEmotion.mappingUser(user); + comment.updateLikeHateCount(); + + commentEmotionRepository.save(commentEmotion); + }); + } + } + diff --git a/src/main/java/co/kr/jurumarble/config/WebConfig.java b/src/main/java/co/kr/jurumarble/config/WebConfig.java index 29a5133e..512f148f 100644 --- a/src/main/java/co/kr/jurumarble/config/WebConfig.java +++ b/src/main/java/co/kr/jurumarble/config/WebConfig.java @@ -23,7 +23,9 @@ public void addInterceptors(InterceptorRegistry registry) { .addPathPatterns("/api/votes/{voteId}") .addPathPatterns("/api/votes/{voteId}/vote") .addPathPatterns("/api/votes/{voteId}/comments") - .addPathPatterns("/api/votes/{voteId}/comments/{commentId}"); + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}") + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/likers") + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/haters"); } diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java new file mode 100644 index 00000000..9b09d4ca --- /dev/null +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java @@ -0,0 +1,15 @@ +package co.kr.jurumarble.exception.comment; + +import co.kr.jurumarble.exception.StatusEnum; +import lombok.Getter; + +@Getter +public class CommentEmotionNotFoundException extends IllegalArgumentException { + + private final StatusEnum status; + private static final String message = "해당 아이디를 가진 댓글이 없습니다 아이디 값을 다시 한번 확인하세요."; + public CommentEmotionNotFoundException() { + super(message); + this.status = StatusEnum.COMMENT_NOT_FOUND; + } +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/user/controller/UserController.java b/src/main/java/co/kr/jurumarble/user/controller/UserController.java index bf8c7bde..61306bcc 100644 --- a/src/main/java/co/kr/jurumarble/user/controller/UserController.java +++ b/src/main/java/co/kr/jurumarble/user/controller/UserController.java @@ -6,6 +6,7 @@ import co.kr.jurumarble.user.dto.request.NaverLoginRequest; import co.kr.jurumarble.user.dto.response.TokenResponse; import co.kr.jurumarble.user.service.UserService; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/src/main/java/co/kr/jurumarble/user/domain/User.java b/src/main/java/co/kr/jurumarble/user/domain/User.java index 2e33f140..19281d57 100644 --- a/src/main/java/co/kr/jurumarble/user/domain/User.java +++ b/src/main/java/co/kr/jurumarble/user/domain/User.java @@ -1,5 +1,6 @@ package co.kr.jurumarble.user.domain; +import co.kr.jurumarble.comment.domain.CommentEmotion; import co.kr.jurumarble.common.domain.BaseTimeEntity; import co.kr.jurumarble.user.dto.AddUserInfo; import co.kr.jurumarble.user.enums.AgeType; @@ -10,6 +11,8 @@ import javax.persistence.*; import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; @Entity @@ -49,6 +52,9 @@ public class User extends BaseTimeEntity { @Column private LocalDateTime modifiedMbtiDate; + @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.REMOVE) + private List commentEmotionList = new ArrayList<>(); + public AgeType classifyAge(Integer age) { AgeType ageGroup; @@ -96,7 +102,6 @@ private User(Long id, String nickname, String email, String imageUrl, String pas this.modifiedMbtiDate = modifiedMbtiDate; } - @Override public boolean equals(Object o) { if (this == o) return true; @@ -109,4 +114,11 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(id); } + + + public void mappingCommentLike(CommentEmotion commentEmotion) { + this.commentEmotionList.add(commentEmotion); + } + + } \ No newline at end of file From f87219ea8a1a4c8a6d1a62b60a1726075b6d2d3f Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 30 Jul 2023 23:21:03 +0900 Subject: [PATCH 08/76] =?UTF-8?q?chore=20:=20=EC=98=88=EC=99=B8=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EB=B0=8F=20=EC=99=B8=EB=B6=80=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/CommentService.java | 88 +++++++++---------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 0cb5e32d..eec0453d 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -9,7 +9,6 @@ import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.comment.repository.CommentEmotionRepository; import co.kr.jurumarble.comment.repository.CommentRepository; -import co.kr.jurumarble.exception.comment.CommentEmotionNotFoundException; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.user.UserNotFoundException; import co.kr.jurumarble.exception.vote.VoteNotFoundException; @@ -34,12 +33,11 @@ public class CommentService { private final UserRepository userRepository; private final VoteRepository voteRepository; private final CommentRepository commentRepository; - private final CommentEmotionRepository commentEmotionRepository; public void createComment(Long voteId, Long userId, CommentCreateRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); - voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = checkParentComment(request); Comment comment = new Comment(request, parentComment, user, voteId); @@ -64,23 +62,31 @@ public Slice getComments(Long voteId, CommentGetRequest requ } - public void updateComment(Long voteId, Long commentId, Long userId, CommentUpdateRequest request) { - userRepository.findById(userId).orElseThrow(UserNotFoundException::new); - voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); comment.updateContent(request); } public void deleteComment(Long voteId, Long commentId, Long userId) { - userRepository.findById(userId).orElseThrow(UserNotFoundException::new); - voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); commentRepository.delete(comment); } + public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emotion) { + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + + doEmote(emotion, user, comment); + } + + private void getChildCommentByParentComment(List comments) { List childComments = new ArrayList<>(); //대댓글 @@ -140,52 +146,44 @@ private Slice convertToSlice(Long voteId, CommentGetRequest return slice; } - public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emotion) { - User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); - Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); - Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - - doEmote(emotion, user, comment); - } - private void doEmote(Emotion emotion, User user, Comment comment) { //책임에 맞게 리팩토링 해야함 + private void doEmote(Emotion emotion, User user, Comment comment) { Optional byCommentAndUser = commentEmotionRepository.findByCommentAndUser(comment, user); - byCommentAndUser.ifPresentOrElse(commentEmotion -> { - - //좋아요(싫어요)를 기존에 눌렀는데 또 눌렀을 경우 좋아요(싫어요) 취소 + byCommentAndUser.ifPresentOrElse( + commentEmotion -> { if (emotion == commentEmotion.getEmotion()) { - commentEmotionRepository.delete(commentEmotion); - comment.removeEmotion(commentEmotion); - comment.updateLikeHateCount(); + //좋아요(싫어요)를 기존에 눌렀는데 또 눌렀을 경우 좋아요(싫어요) 취소 + cancelEmotion(commentEmotion, comment); + } else { + //싫어요(좋아요)를 기존에 누른 상태로 좋아요(싫어요)를 누른 경우 싫어요(좋아요) 취소 후 좋아요(싫어요)로 등록 + changeEmotion(commentEmotion, emotion, user, comment); } - //싫어요(좋아요)를 기존에 누른 상태로 좋아요(싫어요)를 누른 경우 싫어요(좋아요) 취소 후 좋아요(싫어요)로 등록 - else { - commentEmotionRepository.delete(commentEmotion); - comment.removeEmotion(commentEmotion); - - CommentEmotion changeEmotion = new CommentEmotion(); - - changeEmotion.setEmote(emotion); - changeEmotion.mappingComment(comment); - changeEmotion.mappingUser(user); - comment.updateLikeHateCount(); - - commentEmotionRepository.save(changeEmotion); - } - }, // 좋아요(싫어요)가 없을 경우 좋아요(싫어요) 추가 - () -> { - CommentEmotion commentEmotion = new CommentEmotion(); + () -> addEmotion(emotion, user, comment)); + } - commentEmotion.setEmote(emotion); - commentEmotion.mappingComment(comment); - commentEmotion.mappingUser(user); - comment.updateLikeHateCount(); - commentEmotionRepository.save(commentEmotion); - }); + private void cancelEmotion(CommentEmotion commentEmotion, Comment comment) { + commentEmotionRepository.delete(commentEmotion); + comment.removeEmotion(commentEmotion); + comment.updateLikeHateCount(); + } + + private void changeEmotion(CommentEmotion existingEmotion, Emotion newEmotion, User user, Comment comment) { + commentEmotionRepository.delete(existingEmotion); + comment.removeEmotion(existingEmotion); + addEmotion(newEmotion, user, comment); + } + + private void addEmotion(Emotion emotion, User user, Comment comment) { + CommentEmotion newEmotion = new CommentEmotion(); + newEmotion.setEmote(emotion); + newEmotion.mappingComment(comment); + newEmotion.mappingUser(user); + comment.updateLikeHateCount(); + commentEmotionRepository.save(newEmotion); } } From 7f37ec63b8f58d314a06e026d1e03e25dcc9d44a Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 31 Jul 2023 03:46:34 +0900 Subject: [PATCH 09/76] =?UTF-8?q?feat=20:=20=EB=8C=93=EA=B8=80=20=EC=98=88?= =?UTF-8?q?=EC=99=B8=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80(=EB=8C=80?= =?UTF-8?q?=EB=8C=93=EA=B8=80=EC=9D=98=20=EB=8C=80=EB=8C=93=EA=B8=80,=20?= =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=A0=95=EB=A0=AC=20=EB=B0=A9=EC=8B=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/enums/SortType.java | 10 +++++ .../comment/service/CommentService.java | 42 +++++++++++++------ .../kr/jurumarble/exception/StatusEnum.java | 3 +- .../CommentEmotionNotFoundException.java | 4 +- .../comment/CommentExceptionHandler.java | 21 +++++++++- .../InvalidSortingMethodException.java | 15 +++++++ .../NestedCommentNotAllowedException.java | 17 ++++++++ 7 files changed, 94 insertions(+), 18 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/exception/comment/InvalidSortingMethodException.java create mode 100644 src/main/java/co/kr/jurumarble/exception/comment/NestedCommentNotAllowedException.java diff --git a/src/main/java/co/kr/jurumarble/comment/enums/SortType.java b/src/main/java/co/kr/jurumarble/comment/enums/SortType.java index 8cf782e8..111e84c2 100644 --- a/src/main/java/co/kr/jurumarble/comment/enums/SortType.java +++ b/src/main/java/co/kr/jurumarble/comment/enums/SortType.java @@ -1,6 +1,7 @@ package co.kr.jurumarble.comment.enums; import co.kr.jurumarble.common.enums.EnumModel; +import co.kr.jurumarble.exception.comment.InvalidSortingMethodException; public enum SortType implements EnumModel { ByTime("최신순"), @@ -21,4 +22,13 @@ public String getKey() { public String getValue() { return value; } + + public static SortType fromValue(String value) { + for (SortType type : SortType.values()) { + if (type.getValue().equals(value)) { + return type; + } + } + throw new InvalidSortingMethodException(); + } } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index eec0453d..14e8c3cb 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -7,9 +7,12 @@ import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; import co.kr.jurumarble.comment.dto.response.CommentGetResponse; import co.kr.jurumarble.comment.enums.Emotion; +import co.kr.jurumarble.comment.enums.SortType; import co.kr.jurumarble.comment.repository.CommentEmotionRepository; import co.kr.jurumarble.comment.repository.CommentRepository; import co.kr.jurumarble.exception.comment.CommentNotFoundException; +import co.kr.jurumarble.exception.comment.InvalidSortingMethodException; +import co.kr.jurumarble.exception.comment.NestedCommentNotAllowedException; import co.kr.jurumarble.exception.user.UserNotFoundException; import co.kr.jurumarble.exception.vote.VoteNotFoundException; import co.kr.jurumarble.user.domain.User; @@ -26,6 +29,9 @@ import java.util.*; +import static co.kr.jurumarble.comment.enums.SortType.ByPopularity; +import static co.kr.jurumarble.comment.enums.SortType.ByTime; + @Service @RequiredArgsConstructor @Transactional @@ -38,7 +44,9 @@ public class CommentService { public void createComment(Long voteId, Long userId, CommentCreateRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); - Comment parentComment = checkParentComment(request); + Comment parentComment = checkParentComment(request); // 부모댓글이 있는지 없는지 확인 + + checkNestedCommentAllowed(parentComment); Comment comment = new Comment(request, parentComment, user, voteId); @@ -88,13 +96,18 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti - private void getChildCommentByParentComment(List comments) { - List childComments = new ArrayList<>(); //대댓글 - //대댓글 가져오기 - for (Comment parent : comments) { - childComments.addAll(commentRepository.findByParent(parent)); + private Comment checkParentComment(CommentCreateRequest request) { + if (request.getParentId() == null) { + return null; + } + return commentRepository.findById(request.getParentId()) + .orElseThrow(() -> new CommentNotFoundException()); + } + + private void checkNestedCommentAllowed(Comment parentComment) { + if (parentComment != null && parentComment.getParent() != null) { + throw new NestedCommentNotAllowedException(); } - comments.addAll(childComments); } private List findCommentsBySortType(Long voteId, CommentGetRequest request, Pageable pageable) { @@ -107,19 +120,22 @@ private List findCommentsBySortType(Long voteId, CommentGetRequest requ comments = commentRepository.findHotComments(voteId, pageable); break; default: - throw new IllegalArgumentException("적절한 정렬 방식이 아닙니다."); //예외처리 분리해야 함 + throw new InvalidSortingMethodException(); } return comments; } - private Comment checkParentComment(CommentCreateRequest request) { - if (request.getParentId() == null) { - return null; + private void getChildCommentByParentComment(List comments) { + List childComments = new ArrayList<>(); //대댓글 + //대댓글 가져오기 + for (Comment parent : comments) { + childComments.addAll(commentRepository.findByParent(parent)); } - return commentRepository.findById(request.getParentId()) - .orElseThrow(() -> new CommentNotFoundException()); + comments.addAll(childComments); } + + private List convertToCommentGetResponseList(List parentComments) { List commentGetResponse = new ArrayList<>(); Map map = new HashMap<>(); diff --git a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java index d43922a5..9194b897 100644 --- a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java +++ b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java @@ -6,8 +6,9 @@ public enum StatusEnum { BAD_REQUEST(400, "BAD_REQUEST"), USER_NOT_FOUND(404, "USER_NOT_FOUND"), - VOTE_NOT_FOUND(200, "VOTE_NOT_FOUND"), + VOTE_NOT_FOUND(404, "VOTE_NOT_FOUND"), COMMENT_NOT_FOUND(404, "COMMENT_NOT_FOUND"), + COMMENT_EMOTION_NOT_FOUND(404, "COMMENT_EMOTION_NOT_FOUND"), ALREADY_VOTE_RESULT_EXIST(403, "ALREADY_VOTE_RESULT_EXIST"), TOKEN_NOT_EXIST(404, "TOKEN_NOT_EXIST"), TOKEN_EXPIRED(401, "TOKEN_EXPIRED"), diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java index 9b09d4ca..5bab4874 100644 --- a/src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentEmotionNotFoundException.java @@ -7,9 +7,9 @@ public class CommentEmotionNotFoundException extends IllegalArgumentException { private final StatusEnum status; - private static final String message = "해당 아이디를 가진 댓글이 없습니다 아이디 값을 다시 한번 확인하세요."; + private static final String message = "해당 아이디를 가진 Emote 가 없습니다 아이디 값을 다시 한번 확인하세요."; public CommentEmotionNotFoundException() { super(message); - this.status = StatusEnum.COMMENT_NOT_FOUND; + this.status = StatusEnum.COMMENT_EMOTION_NOT_FOUND; } } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java index deb88523..a1ca7adc 100644 --- a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java @@ -4,7 +4,6 @@ import co.kr.jurumarble.exception.ExceptionMessage; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; @@ -16,7 +15,25 @@ public class CommentExceptionHandler { @ExceptionHandler(CommentNotFoundException.class) public ResponseEntity handle(CommentNotFoundException e) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST) + return ResponseEntity.status(e.getStatus().getStatusCode()) + .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); + } + + @ExceptionHandler(CommentEmotionNotFoundException.class) + public ResponseEntity handle(CommentEmotionNotFoundException e) { + return ResponseEntity.status(e.getStatus().getStatusCode()) + .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); + } + + @ExceptionHandler(NestedCommentNotAllowedException.class) + public ResponseEntity handle(NestedCommentNotAllowedException e) { + return ResponseEntity.status(e.getStatus().getStatusCode()) + .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); + } + + @ExceptionHandler(InvalidSortingMethodException.class) + public ResponseEntity handle(InvalidSortingMethodException e) { + return ResponseEntity.status(e.getStatus().getStatusCode()) .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); } } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/exception/comment/InvalidSortingMethodException.java b/src/main/java/co/kr/jurumarble/exception/comment/InvalidSortingMethodException.java new file mode 100644 index 00000000..676a1672 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/exception/comment/InvalidSortingMethodException.java @@ -0,0 +1,15 @@ +package co.kr.jurumarble.exception.comment; + +import co.kr.jurumarble.exception.StatusEnum; +import lombok.Getter; + +@Getter +public class InvalidSortingMethodException extends IllegalArgumentException{ + + private final StatusEnum status; + private static final String message = "적절한 정렬 방식이 아닙니다."; + public InvalidSortingMethodException() { + super(message); + this.status = StatusEnum.BAD_REQUEST; + } +} diff --git a/src/main/java/co/kr/jurumarble/exception/comment/NestedCommentNotAllowedException.java b/src/main/java/co/kr/jurumarble/exception/comment/NestedCommentNotAllowedException.java new file mode 100644 index 00000000..e273b12f --- /dev/null +++ b/src/main/java/co/kr/jurumarble/exception/comment/NestedCommentNotAllowedException.java @@ -0,0 +1,17 @@ +package co.kr.jurumarble.exception.comment; + +import co.kr.jurumarble.exception.StatusEnum; +import lombok.Getter; + +@Getter +public class NestedCommentNotAllowedException extends RuntimeException{ + + private final StatusEnum status; + private static final String message = "대댓글에는 대댓글을 달 수 없습니다."; + public NestedCommentNotAllowedException() { + super(message); + this.status = StatusEnum.BAD_REQUEST; + } + + +} From 4539afd5d1bb2263363c8de9c5714970f8e024ca Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 31 Jul 2023 16:24:02 +0900 Subject: [PATCH 10/76] =?UTF-8?q?refactor=20:=20=EC=A2=8B=EC=95=84?= =?UTF-8?q?=EC=9A=94,=EC=8B=AB=EC=96=B4=EC=9A=94=20=EC=B9=B4=EC=9A=B4?= =?UTF-8?q?=ED=8A=B8=20=EB=A1=9C=EC=A7=81=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/domain/Comment.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index 7ae5eaac..ae0355d2 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -85,17 +85,13 @@ public void mappingCommentEmotion(CommentEmotion commentEmotion) { } public void updateLikeHateCount() { - int likecnt = 0; - int hatecnt = 0; - for (CommentEmotion commentEmotion : commentEmotionList) { - if (commentEmotion.getEmotion().equals(Emotion.LIKE)) { - likecnt += 1; - } else { - hatecnt += 1; - } - } - this.likeCount = likecnt; - this.hateCount = hatecnt; + this.likeCount = (int) commentEmotionList.stream() + .filter(commentEmotion -> commentEmotion.getEmotion().equals(Emotion.LIKE)) + .count(); + + this.hateCount = (int) commentEmotionList.stream() + .filter(commentEmotion -> commentEmotion.getEmotion().equals(Emotion.HATE)) + .count(); } public void updateContent(CommentUpdateRequest commentUpdateRequest) { From 8eac7b333fb565011accd627166d4c2f66b9c458 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 31 Jul 2023 23:51:32 +0900 Subject: [PATCH 11/76] =?UTF-8?q?feat=20:=20=EC=95=88=EC=A3=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 10 ++++++++++ .../co/kr/jurumarble/comment/enums/SortType.java | 9 --------- .../jurumarble/comment/service/CommentService.java | 12 ++++++++++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index 54c77553..d4d07746 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -85,4 +85,14 @@ public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long return new ResponseEntity(HttpStatus.OK); } + @Operation(summary = "안주 추가", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @PatchMapping("/votes/{voteId}/comments/{commentId}/snack") + public ResponseEntity addSnackToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId){ + + commentService.addSnackToComment(voteId, commentId, userId); + + return new ResponseEntity(HttpStatus.OK); + } + + } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/enums/SortType.java b/src/main/java/co/kr/jurumarble/comment/enums/SortType.java index 111e84c2..f0a3b42f 100644 --- a/src/main/java/co/kr/jurumarble/comment/enums/SortType.java +++ b/src/main/java/co/kr/jurumarble/comment/enums/SortType.java @@ -1,7 +1,6 @@ package co.kr.jurumarble.comment.enums; import co.kr.jurumarble.common.enums.EnumModel; -import co.kr.jurumarble.exception.comment.InvalidSortingMethodException; public enum SortType implements EnumModel { ByTime("최신순"), @@ -23,12 +22,4 @@ public String getValue() { return value; } - public static SortType fromValue(String value) { - for (SortType type : SortType.values()) { - if (type.getValue().equals(value)) { - return type; - } - } - throw new InvalidSortingMethodException(); - } } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 14e8c3cb..5923242c 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -92,6 +92,18 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); doEmote(emotion, user, comment); + } + + public void addSnackToComment(Long voteId, Long commentId, Long userId) { + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + + + + + + } From 18b681d1606db7d074c5219d8df45dfe0506b285 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 31 Jul 2023 23:53:23 +0900 Subject: [PATCH 12/76] =?UTF-8?q?feat=20:=20=EC=A7=80=EC=97=AD=20enum=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/enums/Region.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/comment/enums/Region.java diff --git a/src/main/java/co/kr/jurumarble/comment/enums/Region.java b/src/main/java/co/kr/jurumarble/comment/enums/Region.java new file mode 100644 index 00000000..47720349 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/enums/Region.java @@ -0,0 +1,37 @@ +package co.kr.jurumarble.comment.enums; + +public enum Region { + SEOUL(1, "서울"), + INCHEON(2, "인천"), + DAEJEON(3, "대전"), + DAEGU(4, "대구"), + GWANGJU(5, "광주"), + BUSAN(6, "부산"), + ULSAN(7, "울산"), + SEJONG(8, "세종특별자치시"), + GYEONGGI(31, "경기도"), + GANGWON(32, "강원도"), + CHUNGBUK(33, "충청북도"), + CHUNGNAM(34, "충청남도"), + GYEONGBUK(35, "경상북도"), + GYEONGNAM(36, "경상남도"), + JEOLLABUK(37, "전라북도"), + JEOLLANAM(38, "전라남도"), + JEJU(39, "제주도"); + + private final int code; + private final String name; + + Region(int code, String name) { + this.code = code; + this.name = name; + } + + public int getCode() { + return code; + } + + public String getName() { + return name; + } +} \ No newline at end of file From 1883ccdb11f05248e1fd215eeb6bd0ba0369b4db Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Tue, 1 Aug 2023 16:07:14 +0900 Subject: [PATCH 13/76] =?UTF-8?q?chore=20:=20=EC=A7=80=EC=97=AD=20enum=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/co/kr/jurumarble/comment/enums/Region.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/enums/Region.java b/src/main/java/co/kr/jurumarble/comment/enums/Region.java index 47720349..d35553b8 100644 --- a/src/main/java/co/kr/jurumarble/comment/enums/Region.java +++ b/src/main/java/co/kr/jurumarble/comment/enums/Region.java @@ -15,8 +15,8 @@ public enum Region { CHUNGNAM(34, "충청남도"), GYEONGBUK(35, "경상북도"), GYEONGNAM(36, "경상남도"), - JEOLLABUK(37, "전라북도"), - JEOLLANAM(38, "전라남도"), + JEONBUK(37, "전라북도"), + JEONNAM(38, "전라남도"), JEJU(39, "제주도"); private final int code; From 8cf2f77a0e1744233675f5101e539af377adad89 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Tue, 1 Aug 2023 20:51:04 +0900 Subject: [PATCH 14/76] =?UTF-8?q?style=20:=20Dto=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...entCreateRequest.java => CreateCommentRequest.java} | 2 +- ...entUpdateRequest.java => UpdateCommentRequest.java} | 2 +- ...CommentGetResponse.java => GetCommentResponse.java} | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) rename src/main/java/co/kr/jurumarble/comment/dto/request/{CommentCreateRequest.java => CreateCommentRequest.java} (87%) rename src/main/java/co/kr/jurumarble/comment/dto/request/{CommentUpdateRequest.java => UpdateCommentRequest.java} (85%) rename src/main/java/co/kr/jurumarble/comment/dto/response/{CommentGetResponse.java => GetCommentResponse.java} (88%) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java similarity index 87% rename from src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java rename to src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java index 6984d43a..07b5a1f7 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentCreateRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java @@ -7,7 +7,7 @@ @Getter @NoArgsConstructor -public class CommentCreateRequest { +public class CreateCommentRequest { private Long parentId; diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentUpdateRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java similarity index 85% rename from src/main/java/co/kr/jurumarble/comment/dto/request/CommentUpdateRequest.java rename to src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java index eea2e7a9..188e89a3 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentUpdateRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java @@ -7,7 +7,7 @@ @Getter @NoArgsConstructor -public class CommentUpdateRequest { +public class UpdateCommentRequest { @NotBlank private String content; } diff --git a/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java b/src/main/java/co/kr/jurumarble/comment/dto/response/GetCommentResponse.java similarity index 88% rename from src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java rename to src/main/java/co/kr/jurumarble/comment/dto/response/GetCommentResponse.java index 1e653b97..7203391d 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/response/CommentGetResponse.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/response/GetCommentResponse.java @@ -15,7 +15,7 @@ @Getter @Setter -public class CommentGetResponse { +public class GetCommentResponse { private Long id; @@ -37,14 +37,16 @@ public class CommentGetResponse { private LocalDateTime createdDate; - private List children; + private List children; private Integer likeCount; private Integer hateCount; + + @Builder - public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MbtiType mbti, LocalDateTime createdDate, List children, Integer likeCount, Integer hateCount) { + public GetCommentResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MbtiType mbti, LocalDateTime createdDate, List children, Integer likeCount, Integer hateCount) { this.id = id; this.userId = userId; this.nickName = nickName; @@ -61,7 +63,7 @@ public CommentGetResponse(Long id, Long userId, String nickName, Long parentId, } @Builder - public CommentGetResponse(Comment comment) { + public GetCommentResponse(Comment comment) { this.id = comment.getId(); this.userId = comment.getUser().getId(); this.content = comment.getContent(); From 6ccb1092f5f349b72fcabfc5a1963b3239cbb660 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Wed, 2 Aug 2023 03:37:19 +0900 Subject: [PATCH 15/76] =?UTF-8?q?feat=20:=20=EC=95=88=EC=A3=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 35 ++++++++----- .../kr/jurumarble/comment/domain/Comment.java | 32 ++++++++++-- .../kr/jurumarble/comment/domain/Snack.java | 40 +++++++++++++++ .../dto/request/UpdateSnackRequest.java | 18 +++++++ .../comment/service/CommentService.java | 50 ++++++++++--------- 5 files changed, 133 insertions(+), 42 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/comment/domain/Snack.java create mode 100644 src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index d4d07746..be2507a0 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -1,9 +1,10 @@ package co.kr.jurumarble.comment.controller; -import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; import co.kr.jurumarble.comment.dto.request.CommentGetRequest; -import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; -import co.kr.jurumarble.comment.dto.response.CommentGetResponse; +import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; +import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; +import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; +import co.kr.jurumarble.comment.dto.response.GetCommentResponse; import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.comment.service.CommentService; import io.swagger.v3.oas.annotations.Operation; @@ -16,7 +17,6 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; -import java.util.Map; @RequestMapping("/api") @RestController @@ -29,9 +29,9 @@ public class CommentController { @Operation(summary = "댓글 생성", description = "헤더에 토큰, 파라미터에 voteId, 바디에 {parentId, content} json 형식으로 보내주시면 됩니다.") @PostMapping("/votes/{voteId}/comments") - public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute Long userId, @RequestBody @Valid CommentCreateRequest commentCreateRequest) { + public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute Long userId, @RequestBody @Valid CreateCommentRequest createCommentRequest) { - commentService.createComment(voteId, userId, commentCreateRequest); + commentService.createComment(voteId, userId, createCommentRequest); return new ResponseEntity(HttpStatus.CREATED); } @@ -39,19 +39,19 @@ public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute @Operation(summary = "댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") @GetMapping("/votes/{voteId}/comments") - public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { + public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { - Slice commentGetResponses = commentService.getComments(voteId, commentGetRequest); + Slice getCommentResponses = commentService.getComments(voteId, commentGetRequest); - return new ResponseEntity(commentGetResponses, HttpStatus.OK); + return new ResponseEntity(getCommentResponses, HttpStatus.OK); } @Operation(summary = "댓글 수정", description = "파라미터에 voteId, commentId {content} json 형식으로 보내주시면 됩니다.") @PatchMapping("/votes/{voteId}/comments/{commentId}") - public ResponseEntity updateComment(@PathVariable Long voteId, @PathVariable Long commentId, @Valid @RequestBody CommentUpdateRequest commentUpdateRequest, @RequestAttribute Long userId) { + public ResponseEntity updateComment(@PathVariable Long voteId, @PathVariable Long commentId, @Valid @RequestBody UpdateCommentRequest updateCommentRequest, @RequestAttribute Long userId) { - commentService.updateComment(voteId, commentId, userId, commentUpdateRequest); + commentService.updateComment(voteId, commentId, userId, updateCommentRequest); return new ResponseEntity(HttpStatus.OK); } @@ -87,9 +87,18 @@ public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long @Operation(summary = "안주 추가", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") @PatchMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity addSnackToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId){ + public ResponseEntity addSnackToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateSnackRequest updateSnackRequest) { - commentService.addSnackToComment(voteId, commentId, userId); + commentService.addSnackToComment(voteId, commentId, userId, updateSnackRequest); + + return new ResponseEntity(HttpStatus.OK); + } + + @Operation(summary = "안주 검색", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @GetMapping("/votes/{voteId}/comments/{commentId}/snack") + public ResponseEntity searchSnack(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword) { + + commentService.searchSnack(voteId, commentId, userId, keyword); return new ResponseEntity(HttpStatus.OK); } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index ae0355d2..4ba50f7b 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -1,7 +1,8 @@ package co.kr.jurumarble.comment.domain; -import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; -import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; +import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; +import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; +import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.common.domain.BaseTimeEntity; import co.kr.jurumarble.user.domain.User; @@ -63,8 +64,16 @@ public class Comment extends BaseTimeEntity { @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment") private List commentEmotionList = new ArrayList<>(); + @Embedded + @AttributeOverrides({ + @AttributeOverride(name = "snackImage", column = @Column(name = "snack_image")), + @AttributeOverride(name = "snackName", column = @Column(name = "snack_name")), + @AttributeOverride(name = "restaurantName", column = @Column(name = "restaurant_name")) + }) + private Snack snack; - public Comment(CommentCreateRequest request, Comment parent, User user, Long voteId) { + + public Comment(CreateCommentRequest request, Comment parent, User user, Long voteId) { this.user = user; this.voteId = voteId; this.content = request.getContent(); @@ -94,8 +103,8 @@ public void updateLikeHateCount() { .count(); } - public void updateContent(CommentUpdateRequest commentUpdateRequest) { - this.content = commentUpdateRequest.getContent(); + public void updateContent(UpdateCommentRequest updateCommentRequest) { + this.content = updateCommentRequest.getContent(); } public void removeEmotion(CommentEmotion commentEmotion) { @@ -103,4 +112,17 @@ public void removeEmotion(CommentEmotion commentEmotion) { } + public void updateSnack(UpdateSnackRequest request) { + if (request.getSnackImage() != null && !request.getSnackImage().isEmpty()) { + this.snack.updateSnackImage(request.getSnackImage()); + } + + if (request.getSnackName() != null && !request.getSnackName().isEmpty()) { + this.snack.updateSnackName(request.getSnackName()); + } + + if (request.getRestaurantName() != null && !request.getRestaurantName().isEmpty()) { + this.snack.updateRestaurantName(request.getRestaurantName()); + } + } } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Snack.java b/src/main/java/co/kr/jurumarble/comment/domain/Snack.java new file mode 100644 index 00000000..5593c7bf --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/domain/Snack.java @@ -0,0 +1,40 @@ +package co.kr.jurumarble.comment.domain; + +import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; +import lombok.*; + +import javax.persistence.Embeddable; + +@Embeddable +@Getter +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Snack { + + private String snackImage; + + private String snackName; + + private String restaurantName; + + public void updateSnackImage(String snackImage) { + this.snackImage = snackImage; + } + + public void updateSnackName(String snackName) { + this.snackName = snackName; + } + + public void updateRestaurantName(String restaurantName) { + this.restaurantName = restaurantName; + } + + + public Snack(UpdateSnackRequest updateSnackRequest){ + this.snackImage = updateSnackRequest.getSnackImage(); + this.snackName = updateSnackRequest.getSnackName(); + this.restaurantName = updateSnackRequest.getRestaurantName(); + } + +} + diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java new file mode 100644 index 00000000..2531ac4b --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java @@ -0,0 +1,18 @@ +package co.kr.jurumarble.comment.dto.request; + +import co.kr.jurumarble.comment.domain.Snack; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +public class UpdateSnackRequest { + + private String snackImage; + + private String snackName; + + private String restaurantName; + + +} diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 5923242c..98571758 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -2,12 +2,13 @@ import co.kr.jurumarble.comment.domain.Comment; import co.kr.jurumarble.comment.domain.CommentEmotion; -import co.kr.jurumarble.comment.dto.request.CommentCreateRequest; +import co.kr.jurumarble.comment.domain.Snack; +import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; import co.kr.jurumarble.comment.dto.request.CommentGetRequest; -import co.kr.jurumarble.comment.dto.request.CommentUpdateRequest; -import co.kr.jurumarble.comment.dto.response.CommentGetResponse; +import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; +import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; +import co.kr.jurumarble.comment.dto.response.GetCommentResponse; import co.kr.jurumarble.comment.enums.Emotion; -import co.kr.jurumarble.comment.enums.SortType; import co.kr.jurumarble.comment.repository.CommentEmotionRepository; import co.kr.jurumarble.comment.repository.CommentRepository; import co.kr.jurumarble.exception.comment.CommentNotFoundException; @@ -29,9 +30,6 @@ import java.util.*; -import static co.kr.jurumarble.comment.enums.SortType.ByPopularity; -import static co.kr.jurumarble.comment.enums.SortType.ByTime; - @Service @RequiredArgsConstructor @Transactional @@ -41,7 +39,7 @@ public class CommentService { private final CommentRepository commentRepository; private final CommentEmotionRepository commentEmotionRepository; - public void createComment(Long voteId, Long userId, CommentCreateRequest request) { + public void createComment(Long voteId, Long userId, CreateCommentRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = checkParentComment(request); // 부모댓글이 있는지 없는지 확인 @@ -54,23 +52,23 @@ public void createComment(Long voteId, Long userId, CommentCreateRequest request } - public Slice getComments(Long voteId, CommentGetRequest request) { + public Slice getComments(Long voteId, CommentGetRequest request) { Pageable pageable = PageRequest.of(request.getPage(), request.getSize()); List comments = findCommentsBySortType(voteId, request, pageable); //정렬방식에 따라 Pageable 적용하여 부모댓글 가져오기 getChildCommentByParentComment(comments); //부모댓글에 속한 대댓글들 다가져오기 - List commentGetResponse = convertToCommentGetResponseList(comments); // 댓글 목록을 매개 변수로 받아, CommentGetResponse 목록을 반환 + List getCommentResponse = convertToGetCommentResponseList(comments); // 댓글 목록을 매개 변수로 받아, GetCommentResponse 목록을 반환 - Slice slice = convertToSlice(voteId, request, pageable, commentGetResponse); // Response 리스트를 Slice 객체로 만들어주기 + Slice slice = convertToSlice(voteId, request, pageable, getCommentResponse); // Response 리스트를 Slice 객체로 만들어주기 return slice; } - public void updateComment(Long voteId, Long commentId, Long userId, CommentUpdateRequest request) { + public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommentRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); @@ -94,21 +92,26 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti doEmote(emotion, user, comment); } - public void addSnackToComment(Long voteId, Long commentId, Long userId) { + public void addSnackToComment(Long voteId, Long commentId, Long userId, UpdateSnackRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + comment.updateSnack(request); + } + public void searchSnack(Long voteId, Long commentId, Long userId, String keyword) { + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); } - - private Comment checkParentComment(CommentCreateRequest request) { + private Comment checkParentComment(CreateCommentRequest request) { if (request.getParentId() == null) { return null; } @@ -147,30 +150,29 @@ private void getChildCommentByParentComment(List comments) { } - - private List convertToCommentGetResponseList(List parentComments) { - List commentGetResponse = new ArrayList<>(); - Map map = new HashMap<>(); + private List convertToGetCommentResponseList(List parentComments) { + List getCommentResponse = new ArrayList<>(); + Map map = new HashMap<>(); for (Comment comment : parentComments) { - CommentGetResponse response = new CommentGetResponse(comment); + GetCommentResponse response = new GetCommentResponse(comment); map.put(response.getId(), response); if (response.getParentId() != null) { map.get(response.getParentId()).getChildren().add(response); } else { - commentGetResponse.add(response); + getCommentResponse.add(response); } } - return commentGetResponse; + return getCommentResponse; } - private Slice convertToSlice(Long voteId, CommentGetRequest request, Pageable pageable, List commentGetResponse) { + private Slice convertToSlice(Long voteId, CommentGetRequest request, Pageable pageable, List getCommentResponse) { int countComments = commentRepository.countByVoteIdAndParentIsNull(voteId); //투표에 속한 부모 댓글수 전부 가져오기 int lastPageNumber = (int) Math.ceil((double) countComments / request.getSize()); boolean hasNext = request.getPage() < lastPageNumber - 1; - Slice slice = new SliceImpl<>(commentGetResponse, pageable, hasNext); + Slice slice = new SliceImpl<>(getCommentResponse, pageable, hasNext); return slice; } From fc90f569dcff31b049e8c5198a0dd7b29ef8023b Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 6 Aug 2023 22:25:01 +0900 Subject: [PATCH 16/76] =?UTF-8?q?feat=20:=20tour=20api=20=EC=86=8C?= =?UTF-8?q?=EA=B0=9C=20=EC=A0=95=EB=B3=B4=20=ED=98=B8=EC=B6=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiClient.java | 37 +++++++++++++ .../client/tourApi/TourApiConfig.java | 10 ++++ .../client/tourApi/TourApiController.java | 19 +++++++ .../client/tourApi/TourApiService.java | 55 +++++++++++++++++++ .../client/tourApi/TourImageResponse.java | 5 ++ .../client/tourApi/TourIntroResponse.java | 40 ++++++++++++++ 6 files changed, 166 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourApiConfig.java create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java new file mode 100644 index 00000000..b5cfa560 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java @@ -0,0 +1,37 @@ +package co.kr.jurumarble.client.tourApi; + +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +@FeignClient(value = "tour-service", url = "${tour.api.url}") +public interface TourApiClient { + + + + + + //소개 정보 + @GetMapping(value = "/detailIntro1") + TourIntroResponse getDetailIntro(@RequestParam("ServiceKey") String serviceKey, + @RequestParam("contentTypeId") int contentTypeId, + @RequestParam("contentId") int contentId, + @RequestParam("MobileOS") String mobileOS, + @RequestParam("MobileApp") String mobileApp, + @RequestParam("_type") String responseType); + + + + + @GetMapping(value = "/detailImage1") + TourImageResponse getDetailImage(@RequestParam("ServiceKey") String serviceKey, + @RequestParam("contentTypeId") int contentTypeId, + @RequestParam("contentId") int contentId, + @RequestParam("MobileOS") String mobileOS, + @RequestParam("MobileApp") String mobileApp, + @RequestParam("_type") String responseType); + + + + +} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiConfig.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiConfig.java new file mode 100644 index 00000000..f504de00 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiConfig.java @@ -0,0 +1,10 @@ +package co.kr.jurumarble.client.tourApi; + + +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableFeignClients // Spring Boot 애플리케이션에서 Feign 클라이언트를 사용하도록 활성화 +public class TourApiConfig { +} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java new file mode 100644 index 00000000..a2414eb3 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java @@ -0,0 +1,19 @@ +package co.kr.jurumarble.client.tourApi; + +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +public class TourApiController { + + private final TourApiService tourApiService; + + @GetMapping("/treatMenu") + public String getTreatMenu(@RequestParam int contentTypeId, @RequestParam int contentId) { + + return tourApiService.getTreatMenu(contentTypeId, contentId); + } +} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java new file mode 100644 index 00000000..72ae535e --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -0,0 +1,55 @@ +package co.kr.jurumarble.client.tourApi; + +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; + +@Component +@RequiredArgsConstructor +public class TourApiService { + + private final TourApiClient tourApiClient; + + @Value("${tour.api.servicekey}") + private String serviceKey; + + @Value("${tour.api.mobile.os}") + private String mobileOS; + + @Value("${tour.api.mobile.app}") + private String mobileApp; + + @Value("${tour.api.response.type}") + private String responseType; + + public String getTreatMenu(int contentTypeId, int contentId) { + String decodedServiceKey = decodeServiceKey(serviceKey); + TourIntroResponse introResponse = tourApiClient.getDetailIntro( + decodedServiceKey, + contentTypeId, + contentId, + mobileOS, + mobileApp, + responseType); + + System.out.println("API response: " + introResponse); + + return introResponse.getTreatMenu(); + } + + + + private String decodeServiceKey(String encodedServiceKey) { + String decodedServiceKey = null; + try { + decodedServiceKey = URLDecoder.decode(encodedServiceKey, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return decodedServiceKey; + } + +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java new file mode 100644 index 00000000..e7cd02b4 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java @@ -0,0 +1,5 @@ +package co.kr.jurumarble.client.tourApi; + +public class TourImageResponse { + +} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java new file mode 100644 index 00000000..8a26f46a --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java @@ -0,0 +1,40 @@ +package co.kr.jurumarble.client.tourApi; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class TourIntroResponse { + @JsonProperty("response") + private Response response; + + public String getTreatMenu() { + return response.getBody().getItems().getItem().get(0).getTreatmenu(); + } +} + +@Data +class Response { + @JsonProperty("body") + private Body body; +} + +@Data +class Body { + @JsonProperty("items") + private Items items; +} + +@Data +class Items { + @JsonProperty("item") + private List item; +} + +@Data +class Item { + @JsonProperty("treatmenu") + private String treatmenu; +} \ No newline at end of file From 694d8cccd966f3dbe082b984f4a4897818820c8d Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 6 Aug 2023 23:39:16 +0900 Subject: [PATCH 17/76] =?UTF-8?q?feat=20:=20tour=20api=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EC=A0=95=EB=B3=B4=20=ED=98=B8=EC=B6=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiClient.java | 10 ++--- .../client/tourApi/TourApiController.java | 9 +++++ .../client/tourApi/TourApiService.java | 29 ++++++++++++++ .../client/tourApi/TourImageResponse.java | 40 +++++++++++++++++++ 4 files changed, 82 insertions(+), 6 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java index b5cfa560..7ab461a5 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java @@ -7,10 +7,6 @@ @FeignClient(value = "tour-service", url = "${tour.api.url}") public interface TourApiClient { - - - - //소개 정보 @GetMapping(value = "/detailIntro1") TourIntroResponse getDetailIntro(@RequestParam("ServiceKey") String serviceKey, @@ -24,11 +20,13 @@ TourIntroResponse getDetailIntro(@RequestParam("ServiceKey") String serviceKey, @GetMapping(value = "/detailImage1") - TourImageResponse getDetailImage(@RequestParam("ServiceKey") String serviceKey, - @RequestParam("contentTypeId") int contentTypeId, + TourImageResponse getDetailImages(@RequestParam("ServiceKey") String serviceKey, @RequestParam("contentId") int contentId, @RequestParam("MobileOS") String mobileOS, @RequestParam("MobileApp") String mobileApp, + @RequestParam("imageYN") String imageYN, + @RequestParam("subImageYN") String subImageYN, + @RequestParam("numOfRows") int numOfRows, @RequestParam("_type") String responseType); diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java index a2414eb3..d9491f1e 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java @@ -5,6 +5,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequiredArgsConstructor public class TourApiController { @@ -16,4 +18,11 @@ public String getTreatMenu(@RequestParam int contentTypeId, @RequestParam int co return tourApiService.getTreatMenu(contentTypeId, contentId); } + + + @GetMapping("/imgUrl") + public List getDetailImgUrl(@RequestParam int contentId){ + + return tourApiService.getDetailImages(contentId); + } } diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index 72ae535e..fd0e677c 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -3,9 +3,11 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestParam; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import java.util.List; @Component @RequiredArgsConstructor @@ -25,6 +27,13 @@ public class TourApiService { @Value("${tour.api.response.type}") private String responseType; + @Value("${tour.api.image.enabled}") + private String imageYN; + @Value("${tour.api.subimage.enabled}") + private String subImageYN; + @Value("${tour.api.num-of-rows}") + private int numOfRows; + public String getTreatMenu(int contentTypeId, int contentId) { String decodedServiceKey = decodeServiceKey(serviceKey); TourIntroResponse introResponse = tourApiClient.getDetailIntro( @@ -40,6 +49,26 @@ public String getTreatMenu(int contentTypeId, int contentId) { return introResponse.getTreatMenu(); } + public List getDetailImages(int contentId) { + String decodedServiceKey = decodeServiceKey(serviceKey); + TourImageResponse imageResponse = tourApiClient.getDetailImages( + decodedServiceKey, + contentId, + mobileOS, + mobileApp, + imageYN, + subImageYN, + numOfRows, + responseType); + + + System.out.println("API response: " + imageResponse); + + return imageResponse.getDetailImages(); + } + + + private String decodeServiceKey(String encodedServiceKey) { diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java index e7cd02b4..6483ce43 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java @@ -1,5 +1,45 @@ package co.kr.jurumarble.client.tourApi; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data public class TourImageResponse { + @JsonProperty("response") + private TourImageResponse.Response response; + + public List getDetailImages() { + List urls = new ArrayList<>(); + for (TourImageResponse.Item item : response.getBody().getItems().getItem()) { + urls.add(item.getOriginimgurl()); + } + return urls; + } + + @Data + static class Response { + @JsonProperty("body") + private TourImageResponse.Body body; + } + + @Data + static class Body { + @JsonProperty("items") + private TourImageResponse.Items items; + } + + @Data + static class Items { + @JsonProperty("item") + private List item; + } + @Data + static class Item { + @JsonProperty("originimgurl") + private String originimgurl; + } } From cc19633ada92ef03528bfe3a0d738c20bde5c910 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 6 Aug 2023 23:39:42 +0900 Subject: [PATCH 18/76] =?UTF-8?q?refactor=20:=20tour=20api=20=EC=86=8C?= =?UTF-8?q?=EA=B0=9C=20=EC=A0=95=EB=B3=B4=20=EC=A4=91=EB=B3=B5=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourIntroResponse.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java index 8a26f46a..ba11606f 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java @@ -8,33 +8,33 @@ @Data public class TourIntroResponse { @JsonProperty("response") - private Response response; + private TourIntroResponse.Response response; public String getTreatMenu() { return response.getBody().getItems().getItem().get(0).getTreatmenu(); } -} -@Data -class Response { - @JsonProperty("body") - private Body body; -} + @Data + static class Response { + @JsonProperty("body") + private TourIntroResponse.Body body; + } -@Data -class Body { - @JsonProperty("items") - private Items items; -} + @Data + static class Body { + @JsonProperty("items") + private TourIntroResponse.Items items; + } -@Data -class Items { - @JsonProperty("item") - private List item; -} + @Data + static class Items { + @JsonProperty("item") + private List item; + } -@Data -class Item { - @JsonProperty("treatmenu") - private String treatmenu; + @Data + static class Item { + @JsonProperty("treatmenu") + private String treatmenu; + } } \ No newline at end of file From 8d554fe62cd20c926949809166a5662ea7b286fd Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 7 Aug 2023 23:23:24 +0900 Subject: [PATCH 19/76] =?UTF-8?q?style=20:=20GetCommentRequest=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/{CommentGetRequest.java => GetCommentRequest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/main/java/co/kr/jurumarble/comment/dto/request/{CommentGetRequest.java => GetCommentRequest.java} (91%) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java similarity index 91% rename from src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java rename to src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java index 02b99dfc..501a5bb9 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CommentGetRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java @@ -10,7 +10,7 @@ @Getter @Setter @NoArgsConstructor -public class CommentGetRequest { +public class GetCommentRequest { @NotNull private SortType sortBy; From ab7ef7be95ae1a718c84bd87a79454bf3d311ffa Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Tue, 8 Aug 2023 02:43:38 +0900 Subject: [PATCH 20/76] =?UTF-8?q?feat=20:=20TourApi=20=EC=A7=80=EC=97=AD?= =?UTF-8?q?=20=EA=B8=B0=EB=B0=98=20=EC=A1=B0=ED=9A=8C=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/RestaurantInfoDto.java | 17 +++++ .../client/tourApi/TourApiClient.java | 51 +++++++++------ .../client/tourApi/TourApiController.java | 18 ++++-- .../client/tourApi/TourApiService.java | 60 +++++++++++++++-- .../tourApi/TourAreaBasedListResponse.java | 64 +++++++++++++++++++ ...onse.java => TourDetailImageResponse.java} | 12 ++-- ...onse.java => TourDetailIntroResponse.java} | 10 +-- .../comment/controller/CommentController.java | 6 +- .../comment/service/CommentService.java | 9 ++- .../kr/jurumarble/exception/StatusEnum.java | 1 + .../comment/CommentExceptionHandler.java | 6 ++ .../comment/NoDataFoundException.java | 16 +++++ 12 files changed, 220 insertions(+), 50 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/RestaurantInfoDto.java create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java rename src/main/java/co/kr/jurumarble/client/tourApi/{TourImageResponse.java => TourDetailImageResponse.java} (67%) rename src/main/java/co/kr/jurumarble/client/tourApi/{TourIntroResponse.java => TourDetailIntroResponse.java} (71%) create mode 100644 src/main/java/co/kr/jurumarble/exception/comment/NoDataFoundException.java diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/RestaurantInfoDto.java b/src/main/java/co/kr/jurumarble/client/tourApi/RestaurantInfoDto.java new file mode 100644 index 00000000..af955670 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/RestaurantInfoDto.java @@ -0,0 +1,17 @@ +package co.kr.jurumarble.client.tourApi; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor +@AllArgsConstructor +public class RestaurantInfoDto { + + private String contentId; + private String firstImage; + private String title; + + +} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java index 7ab461a5..dbc9196a 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java @@ -7,29 +7,42 @@ @FeignClient(value = "tour-service", url = "${tour.api.url}") public interface TourApiClient { - //소개 정보 + //소개 정보 조회 @GetMapping(value = "/detailIntro1") - TourIntroResponse getDetailIntro(@RequestParam("ServiceKey") String serviceKey, - @RequestParam("contentTypeId") int contentTypeId, - @RequestParam("contentId") int contentId, - @RequestParam("MobileOS") String mobileOS, - @RequestParam("MobileApp") String mobileApp, - @RequestParam("_type") String responseType); - - + TourDetailIntroResponse getDetailIntro(@RequestParam("ServiceKey") String serviceKey, + @RequestParam("contentTypeId") int contentTypeId, + @RequestParam("contentId") String contentId, + @RequestParam("MobileOS") String mobileOS, + @RequestParam("MobileApp") String mobileApp, + @RequestParam("_type") String responseType); + //이미지 정보 조회 @GetMapping(value = "/detailImage1") - TourImageResponse getDetailImages(@RequestParam("ServiceKey") String serviceKey, - @RequestParam("contentId") int contentId, - @RequestParam("MobileOS") String mobileOS, - @RequestParam("MobileApp") String mobileApp, - @RequestParam("imageYN") String imageYN, - @RequestParam("subImageYN") String subImageYN, - @RequestParam("numOfRows") int numOfRows, - @RequestParam("_type") String responseType); - - + TourDetailImageResponse getDetailImages(@RequestParam("ServiceKey") String serviceKey, + @RequestParam("contentId") String contentId, + @RequestParam("MobileOS") String mobileOS, + @RequestParam("MobileApp") String mobileApp, + @RequestParam("imageYN") String imageYN, + @RequestParam("subImageYN") String subImageYN, + @RequestParam("numOfRows") int numOfRows, + @RequestParam("_type") String responseType); + + + //지역 기반 정보 조회 + @GetMapping(value = "/areaBasedList1") + TourAreaBasedListResponse getRestaurantList(@RequestParam("ServiceKey") String serviceKey, + @RequestParam("contentTypeId") int contentTypeId, + @RequestParam("areaCode") int areaCode, + @RequestParam("MobileOS") String mobileOS, + @RequestParam("MobileApp") String mobileApp, + @RequestParam("numOfRows") int numOfRows, + @RequestParam("pageNo") int pageNo, + @RequestParam("listYN") String listYN, + @RequestParam("arrange") String arrange, + @RequestParam("cat1") String cat1, //대분류:음식 + @RequestParam("cat2") String cat2, //중분류:음식점 + @RequestParam("_type") String responseType); } diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java index d9491f1e..974d8f36 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java @@ -1,6 +1,7 @@ package co.kr.jurumarble.client.tourApi; import lombok.RequiredArgsConstructor; +import org.bouncycastle.cert.ocsp.Req; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -14,15 +15,22 @@ public class TourApiController { private final TourApiService tourApiService; @GetMapping("/treatMenu") - public String getTreatMenu(@RequestParam int contentTypeId, @RequestParam int contentId) { + public String getTreatMenu(@RequestParam String contentId) { - return tourApiService.getTreatMenu(contentTypeId, contentId); + return tourApiService.getTreatMenu( contentId); } @GetMapping("/imgUrl") - public List getDetailImgUrl(@RequestParam int contentId){ - + public List getDetailImgUrl(@RequestParam String contentId){ + return tourApiService.getDetailImages(contentId); - } + } + + @GetMapping("/restaurantInfo") + public List getRestaurantInfo(@RequestParam int areaCode, @RequestParam int pageNo){ + + return tourApiService.getRestaurantInfo(areaCode, pageNo); + } + } diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index fd0e677c..b0ef3b1d 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -1,12 +1,13 @@ package co.kr.jurumarble.client.tourApi; +import co.kr.jurumarble.exception.comment.NoDataFoundException; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.RequestParam; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; +import java.util.ArrayList; import java.util.List; @Component @@ -27,16 +28,28 @@ public class TourApiService { @Value("${tour.api.response.type}") private String responseType; - @Value("${tour.api.image.enabled}") + @Value("${tour.api.content-type-id}") + private int contentTypeId; + + @Value("${tour.api.image-yn}") private String imageYN; - @Value("${tour.api.subimage.enabled}") + @Value("${tour.api.subimage-yn}") private String subImageYN; @Value("${tour.api.num-of-rows}") private int numOfRows; + @Value("${tour.api.list-yn}") + private String listYN; + @Value("${tour.api.arrange}") + private String arrange; + @Value("${tour.api.cat1}") + private String cat1; + @Value("${tour.api.cat2}") + private String cat2; + - public String getTreatMenu(int contentTypeId, int contentId) { + public String getTreatMenu(String contentId) { String decodedServiceKey = decodeServiceKey(serviceKey); - TourIntroResponse introResponse = tourApiClient.getDetailIntro( + TourDetailIntroResponse introResponse = tourApiClient.getDetailIntro( decodedServiceKey, contentTypeId, contentId, @@ -49,9 +62,9 @@ public String getTreatMenu(int contentTypeId, int contentId) { return introResponse.getTreatMenu(); } - public List getDetailImages(int contentId) { + public List getDetailImages(String contentId) { String decodedServiceKey = decodeServiceKey(serviceKey); - TourImageResponse imageResponse = tourApiClient.getDetailImages( + TourDetailImageResponse imageResponse = tourApiClient.getDetailImages( decodedServiceKey, contentId, mobileOS, @@ -68,7 +81,39 @@ public List getDetailImages(int contentId) { } + public List getRestaurantInfo(int areaCode, int pageNo) { + String decodedServiceKey = decodeServiceKey(serviceKey); + + TourAreaBasedListResponse restaurantList = tourApiClient.getRestaurantList( + decodedServiceKey, + contentTypeId, + areaCode, + mobileOS, + mobileApp, + numOfRows, + pageNo, + listYN, + arrange, + cat1, + cat2, + responseType); + + List contentIds = restaurantList.getContentIds(); + List firstImages = restaurantList.getFirstImages(); + List titles = restaurantList.getTitles(); + + List restaurantInfoList = new ArrayList<>(); + for (int i = 0; i < contentIds.size(); i++) { + String contentId = contentIds.get(i); + String firstImage = firstImages.get(i); + String title = titles.get(i); + restaurantInfoList.add(new RestaurantInfoDto(contentId, firstImage, title)); + } + + System.out.println("API response: " + restaurantInfoList); + return restaurantInfoList; + } private String decodeServiceKey(String encodedServiceKey) { @@ -81,4 +126,5 @@ private String decodeServiceKey(String encodedServiceKey) { return decodedServiceKey; } + } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java new file mode 100644 index 00000000..a540f50c --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java @@ -0,0 +1,64 @@ +package co.kr.jurumarble.client.tourApi; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Data +public class TourAreaBasedListResponse { + @JsonProperty("response") + private TourAreaBasedListResponse.Response response; + + public List getContentIds() { + return response.getBody().getItems().getItem().stream() + .map(TourAreaBasedListResponse.Item::getContentid) + .collect(Collectors.toList()); + } + + public List getFirstImages() { + return response.getBody().getItems().getItem().stream() + .map(TourAreaBasedListResponse.Item::getFirstimage) + .collect(Collectors.toList()); + } + + public List getTitles() { + return response.getBody().getItems().getItem().stream() + .map(TourAreaBasedListResponse.Item::getTitle) + .collect(Collectors.toList()); + } + + @Data + static class Response { + @JsonProperty("body") + private TourAreaBasedListResponse.Body body; + } + + @Data + static class Body { + @JsonProperty("items") + private TourAreaBasedListResponse.Items items; + } + + @Data + static class Items { + @JsonProperty("item") + private List item; + } + + @Data + static class Item { + @JsonProperty("contentid") + private String contentid; + + @JsonProperty("firstimage") + private String firstimage; + + @JsonProperty("title") + private String title; + } + + +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourDetailImageResponse.java similarity index 67% rename from src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java rename to src/main/java/co/kr/jurumarble/client/tourApi/TourDetailImageResponse.java index 6483ce43..87a6f516 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourImageResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourDetailImageResponse.java @@ -7,13 +7,13 @@ import java.util.List; @Data -public class TourImageResponse { +public class TourDetailImageResponse { @JsonProperty("response") - private TourImageResponse.Response response; + private TourDetailImageResponse.Response response; public List getDetailImages() { List urls = new ArrayList<>(); - for (TourImageResponse.Item item : response.getBody().getItems().getItem()) { + for (TourDetailImageResponse.Item item : response.getBody().getItems().getItem()) { urls.add(item.getOriginimgurl()); } return urls; @@ -22,19 +22,19 @@ public List getDetailImages() { @Data static class Response { @JsonProperty("body") - private TourImageResponse.Body body; + private TourDetailImageResponse.Body body; } @Data static class Body { @JsonProperty("items") - private TourImageResponse.Items items; + private TourDetailImageResponse.Items items; } @Data static class Items { @JsonProperty("item") - private List item; + private List item; } @Data diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourDetailIntroResponse.java similarity index 71% rename from src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java rename to src/main/java/co/kr/jurumarble/client/tourApi/TourDetailIntroResponse.java index ba11606f..c1f02faf 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourIntroResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourDetailIntroResponse.java @@ -6,9 +6,9 @@ import java.util.List; @Data -public class TourIntroResponse { +public class TourDetailIntroResponse { @JsonProperty("response") - private TourIntroResponse.Response response; + private TourDetailIntroResponse.Response response; public String getTreatMenu() { return response.getBody().getItems().getItem().get(0).getTreatmenu(); @@ -17,19 +17,19 @@ public String getTreatMenu() { @Data static class Response { @JsonProperty("body") - private TourIntroResponse.Body body; + private TourDetailIntroResponse.Body body; } @Data static class Body { @JsonProperty("items") - private TourIntroResponse.Items items; + private TourDetailIntroResponse.Items items; } @Data static class Items { @JsonProperty("item") - private List item; + private List item; } @Data diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index be2507a0..d48b625b 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -1,6 +1,6 @@ package co.kr.jurumarble.comment.controller; -import co.kr.jurumarble.comment.dto.request.CommentGetRequest; +import co.kr.jurumarble.comment.dto.request.GetCommentRequest; import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; @@ -39,9 +39,9 @@ public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute @Operation(summary = "댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") @GetMapping("/votes/{voteId}/comments") - public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute CommentGetRequest commentGetRequest) { + public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute GetCommentRequest getCommentRequest) { - Slice getCommentResponses = commentService.getComments(voteId, commentGetRequest); + Slice getCommentResponses = commentService.getComments(voteId, getCommentRequest); return new ResponseEntity(getCommentResponses, HttpStatus.OK); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 98571758..bca287a2 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -2,9 +2,8 @@ import co.kr.jurumarble.comment.domain.Comment; import co.kr.jurumarble.comment.domain.CommentEmotion; -import co.kr.jurumarble.comment.domain.Snack; import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; -import co.kr.jurumarble.comment.dto.request.CommentGetRequest; +import co.kr.jurumarble.comment.dto.request.GetCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; import co.kr.jurumarble.comment.dto.response.GetCommentResponse; @@ -52,7 +51,7 @@ public void createComment(Long voteId, Long userId, CreateCommentRequest request } - public Slice getComments(Long voteId, CommentGetRequest request) { + public Slice getComments(Long voteId, GetCommentRequest request) { Pageable pageable = PageRequest.of(request.getPage(), request.getSize()); List comments = findCommentsBySortType(voteId, request, pageable); //정렬방식에 따라 Pageable 적용하여 부모댓글 가져오기 @@ -125,7 +124,7 @@ private void checkNestedCommentAllowed(Comment parentComment) { } } - private List findCommentsBySortType(Long voteId, CommentGetRequest request, Pageable pageable) { + private List findCommentsBySortType(Long voteId, GetCommentRequest request, Pageable pageable) { List comments; switch (request.getSortBy()) { case ByTime: @@ -167,7 +166,7 @@ private List convertToGetCommentResponseList(List p return getCommentResponse; } - private Slice convertToSlice(Long voteId, CommentGetRequest request, Pageable pageable, List getCommentResponse) { + private Slice convertToSlice(Long voteId, GetCommentRequest request, Pageable pageable, List getCommentResponse) { int countComments = commentRepository.countByVoteIdAndParentIsNull(voteId); //투표에 속한 부모 댓글수 전부 가져오기 int lastPageNumber = (int) Math.ceil((double) countComments / request.getSize()); boolean hasNext = request.getPage() < lastPageNumber - 1; diff --git a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java index 9194b897..248a324d 100644 --- a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java +++ b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java @@ -8,6 +8,7 @@ public enum StatusEnum { USER_NOT_FOUND(404, "USER_NOT_FOUND"), VOTE_NOT_FOUND(404, "VOTE_NOT_FOUND"), COMMENT_NOT_FOUND(404, "COMMENT_NOT_FOUND"), + NO_CONTENT(204,"NO_CONTENT"), COMMENT_EMOTION_NOT_FOUND(404, "COMMENT_EMOTION_NOT_FOUND"), ALREADY_VOTE_RESULT_EXIST(403, "ALREADY_VOTE_RESULT_EXIST"), TOKEN_NOT_EXIST(404, "TOKEN_NOT_EXIST"), diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java index a1ca7adc..c3c83b62 100644 --- a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java @@ -36,4 +36,10 @@ public ResponseEntity handle(InvalidSortingMethodException e) return ResponseEntity.status(e.getStatus().getStatusCode()) .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); } + + @ExceptionHandler(NoDataFoundException.class) + public ResponseEntity handle(NoDataFoundException e) { + return ResponseEntity.status(e.getStatus().getStatusCode()) + .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); + } } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/exception/comment/NoDataFoundException.java b/src/main/java/co/kr/jurumarble/exception/comment/NoDataFoundException.java new file mode 100644 index 00000000..6da92dcf --- /dev/null +++ b/src/main/java/co/kr/jurumarble/exception/comment/NoDataFoundException.java @@ -0,0 +1,16 @@ +package co.kr.jurumarble.exception.comment; + +import co.kr.jurumarble.exception.StatusEnum; +import lombok.Getter; + +@Getter +public class NoDataFoundException extends RuntimeException{ + + private final StatusEnum status; + private static final String message = "데이터가 존재하지 않습니다."; + public NoDataFoundException() { + super(message); + this.status = StatusEnum.NO_CONTENT; + } + +} From 1c321a07699ccaae55e0b253060aa846d7454218 Mon Sep 17 00:00:00 2001 From: minyeob Date: Wed, 9 Aug 2023 23:48:41 +0900 Subject: [PATCH 21/76] =?UTF-8?q?feat=20:=20=ED=82=A4=EC=9B=8C=EB=93=9C=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EA=B2=80=EC=83=89=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C(=EC=9D=8C=EC=8B=9D=EC=A0=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiClient.java | 13 ++++ .../client/tourApi/TourApiController.java | 6 ++ .../client/tourApi/TourApiService.java | 35 +++++++++++ .../tourApi/TourSearchKeyWordResponse.java | 61 +++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java index dbc9196a..426c4c5b 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java @@ -45,4 +45,17 @@ TourAreaBasedListResponse getRestaurantList(@RequestParam("ServiceKey") String s @RequestParam("_type") String responseType); + + @GetMapping(value = "searchKeyword1?") + TourSearchKeyWordResponse getRestaurantList(@RequestParam("ServiceKey") String serviceKey, + @RequestParam("contentTypeId") int contentTypeId, + @RequestParam("areaCode") int areaCode, + @RequestParam("MobileOS") String mobileOS, + @RequestParam("MobileApp") String mobileApp, + @RequestParam("listYN") String listYN, + @RequestParam("numOfRows") int numOfRows, + @RequestParam("pageNo") int pageNo, + @RequestParam("keyword") String keyWord, + @RequestParam("_type") String responseType); + } diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java index 974d8f36..14609422 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java @@ -33,4 +33,10 @@ public List getRestaurantInfo(@RequestParam int areaCode, @Re return tourApiService.getRestaurantInfo(areaCode, pageNo); } + @GetMapping("/restaurantInfoByKeyWord") + public List getRestaurantInfoByKeyWord(@RequestParam String keyWord, @RequestParam int areaCode, @RequestParam int pageNo){ + + return tourApiService.getRestaurantInfoByKeyWord(keyWord,areaCode, pageNo); + } + } diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index b0ef3b1d..706ecdd3 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -4,6 +4,8 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; @@ -116,6 +118,39 @@ public List getRestaurantInfo(int areaCode, int pageNo) { } + public List getRestaurantInfoByKeyWord(String keyWord, int pageNo, int areaCode) { + String decodedServiceKey = decodeServiceKey(serviceKey); + + TourSearchKeyWordResponse restaurantList = tourApiClient.getRestaurantList( + decodedServiceKey, + contentTypeId, + areaCode, + mobileOS, + mobileApp, + listYN, + numOfRows, + pageNo, + keyWord, + responseType); + + List contentIds = restaurantList.getContentIds(); + List firstImages = restaurantList.getFirstImages(); + List titles = restaurantList.getTitles(); + + List restaurantInfoList = new ArrayList<>(); + for (int i = 0; i < contentIds.size(); i++) { + String contentId = contentIds.get(i); + String firstImage = firstImages.get(i); + String title = titles.get(i); + restaurantInfoList.add(new RestaurantInfoDto(contentId, firstImage, title)); + } + + System.out.println("API response: " + restaurantInfoList); + + return restaurantInfoList; + } + + private String decodeServiceKey(String encodedServiceKey) { String decodedServiceKey = null; try { diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java new file mode 100644 index 00000000..ecb7729d --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java @@ -0,0 +1,61 @@ +package co.kr.jurumarble.client.tourApi; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; +import java.util.stream.Collectors; + +public class TourSearchKeyWordResponse { + @JsonProperty("response") + private TourSearchKeyWordResponse.Response response; + + public List getContentIds() { + return response.getBody().getItems().getItem().stream() + .map(TourSearchKeyWordResponse.Item::getContentid) + .collect(Collectors.toList()); + } + + public List getFirstImages() { + return response.getBody().getItems().getItem().stream() + .map(TourSearchKeyWordResponse.Item::getFirstimage) + .collect(Collectors.toList()); + } + + public List getTitles() { + return response.getBody().getItems().getItem().stream() + .map(TourSearchKeyWordResponse.Item::getTitle) + .collect(Collectors.toList()); + } + + @Data + static class Response { + @JsonProperty("body") + private TourSearchKeyWordResponse.Body body; + } + + @Data + static class Body { + @JsonProperty("items") + private TourSearchKeyWordResponse.Items items; + } + + @Data + static class Items { + @JsonProperty("item") + private List item; + } + + @Data + static class Item { + @JsonProperty("contentid") + private String contentid; + + @JsonProperty("firstimage") + private String firstimage; + + @JsonProperty("title") + private String title; + } + +} From 05d00737a28e86c499ccd527d0a7d5bec22fbb2b Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 11 Aug 2023 03:40:50 +0900 Subject: [PATCH 22/76] =?UTF-8?q?fix=20:=20=ED=82=A4=EC=9B=8C=EB=93=9C=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EA=B2=80=EC=83=89=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=8B=A4=ED=96=89=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiClient.java | 23 +++++++++---------- .../client/tourApi/TourApiService.java | 5 +--- .../tourApi/TourSearchKeyWordResponse.java | 1 + 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java index 426c4c5b..914407cb 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java @@ -45,17 +45,16 @@ TourAreaBasedListResponse getRestaurantList(@RequestParam("ServiceKey") String s @RequestParam("_type") String responseType); - - @GetMapping(value = "searchKeyword1?") - TourSearchKeyWordResponse getRestaurantList(@RequestParam("ServiceKey") String serviceKey, - @RequestParam("contentTypeId") int contentTypeId, - @RequestParam("areaCode") int areaCode, - @RequestParam("MobileOS") String mobileOS, - @RequestParam("MobileApp") String mobileApp, - @RequestParam("listYN") String listYN, - @RequestParam("numOfRows") int numOfRows, - @RequestParam("pageNo") int pageNo, - @RequestParam("keyword") String keyWord, - @RequestParam("_type") String responseType); + @GetMapping(value = "/searchKeyword1") + TourSearchKeyWordResponse getRestaurantListByKeyWord(@RequestParam("ServiceKey") String serviceKey, + @RequestParam("contentTypeId") int contentTypeId, + @RequestParam("areaCode") int areaCode, + @RequestParam("MobileOS") String mobileOS, + @RequestParam("MobileApp") String mobileApp, + @RequestParam("listYN") String listYN, + @RequestParam("numOfRows") int numOfRows, + @RequestParam("pageNo") int pageNo, + @RequestParam("keyword") String keyWord, + @RequestParam("_type") String responseType); } diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index 706ecdd3..13b11277 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -1,11 +1,8 @@ package co.kr.jurumarble.client.tourApi; -import co.kr.jurumarble.exception.comment.NoDataFoundException; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; @@ -121,7 +118,7 @@ public List getRestaurantInfo(int areaCode, int pageNo) { public List getRestaurantInfoByKeyWord(String keyWord, int pageNo, int areaCode) { String decodedServiceKey = decodeServiceKey(serviceKey); - TourSearchKeyWordResponse restaurantList = tourApiClient.getRestaurantList( + TourSearchKeyWordResponse restaurantList = tourApiClient.getRestaurantListByKeyWord( decodedServiceKey, contentTypeId, areaCode, diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java index ecb7729d..ae8c7891 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.stream.Collectors; +@Data public class TourSearchKeyWordResponse { @JsonProperty("response") private TourSearchKeyWordResponse.Response response; From 995f9689b95cf1cf94254c07823a70d9b9275012 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 12 Aug 2023 02:32:35 +0900 Subject: [PATCH 23/76] =?UTF-8?q?feat=20:=20=EC=95=88=EC=A3=BC=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiService.java | 8 ----- .../comment/controller/CommentController.java | 8 +++-- .../comment/dto/SearchSnackResponse.java | 23 +++++++++++++++ .../comment/service/CommentService.java | 29 ++++++++++++++++++- .../co/kr/jurumarble/config/WebConfig.java | 3 +- 5 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/comment/dto/SearchSnackResponse.java diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index 13b11277..d6d9cc97 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -56,8 +56,6 @@ public String getTreatMenu(String contentId) { mobileApp, responseType); - System.out.println("API response: " + introResponse); - return introResponse.getTreatMenu(); } @@ -74,8 +72,6 @@ public List getDetailImages(String contentId) { responseType); - System.out.println("API response: " + imageResponse); - return imageResponse.getDetailImages(); } @@ -109,8 +105,6 @@ public List getRestaurantInfo(int areaCode, int pageNo) { restaurantInfoList.add(new RestaurantInfoDto(contentId, firstImage, title)); } - System.out.println("API response: " + restaurantInfoList); - return restaurantInfoList; } @@ -142,8 +136,6 @@ public List getRestaurantInfoByKeyWord(String keyWord, int pa restaurantInfoList.add(new RestaurantInfoDto(contentId, firstImage, title)); } - System.out.println("API response: " + restaurantInfoList); - return restaurantInfoList; } diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index d48b625b..dc03442e 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -1,5 +1,6 @@ package co.kr.jurumarble.comment.controller; +import co.kr.jurumarble.comment.dto.SearchSnackResponse; import co.kr.jurumarble.comment.dto.request.GetCommentRequest; import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; @@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; @RequestMapping("/api") @RestController @@ -96,11 +98,11 @@ public ResponseEntity addSnackToComment(@PathVariable Long voteId, @PathVariable @Operation(summary = "안주 검색", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") @GetMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity searchSnack(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword) { + public ResponseEntity> searchSnack(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { - commentService.searchSnack(voteId, commentId, userId, keyword); + List searchSnackResponses = commentService.searchSnack(voteId, commentId, userId, keyword, page); - return new ResponseEntity(HttpStatus.OK); + return new ResponseEntity(searchSnackResponses, HttpStatus.OK); } diff --git a/src/main/java/co/kr/jurumarble/comment/dto/SearchSnackResponse.java b/src/main/java/co/kr/jurumarble/comment/dto/SearchSnackResponse.java new file mode 100644 index 00000000..10ebd832 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/dto/SearchSnackResponse.java @@ -0,0 +1,23 @@ +package co.kr.jurumarble.comment.dto; + +import lombok.*; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class SearchSnackResponse { + + private String contentId; + + private String restaurantName; + + private String restaurantImage; + + private String treatMenu; + + public SearchSnackResponse(String contentId, String restaurantName, String restaurantImage, String treatMenu) { + this.contentId = contentId; + this.restaurantName = restaurantName; + this.restaurantImage = restaurantImage; + this.treatMenu = treatMenu; + } +} diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index bca287a2..907d8590 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -1,7 +1,10 @@ package co.kr.jurumarble.comment.service; +import co.kr.jurumarble.client.tourApi.RestaurantInfoDto; +import co.kr.jurumarble.client.tourApi.TourApiService; import co.kr.jurumarble.comment.domain.Comment; import co.kr.jurumarble.comment.domain.CommentEmotion; +import co.kr.jurumarble.comment.dto.SearchSnackResponse; import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; import co.kr.jurumarble.comment.dto.request.GetCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; @@ -28,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -38,6 +42,8 @@ public class CommentService { private final CommentRepository commentRepository; private final CommentEmotionRepository commentEmotionRepository; + private final TourApiService tourApiService; + public void createComment(Long voteId, Long userId, CreateCommentRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -100,12 +106,16 @@ public void addSnackToComment(Long voteId, Long commentId, Long userId, UpdateSn } - public void searchSnack(Long voteId, Long commentId, Long userId, String keyword) { + public List searchSnack(Long voteId, Long commentId, Long userId, String keyword, int page) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + //vote의 지역이 있으면 받아오고 없으면 선택받은 지역 + + List restaurantInfo = getRestaurantInfoList(keyword, page); + return mapToSearchSnackResponses(restaurantInfo); } @@ -215,5 +225,22 @@ private void addEmotion(Emotion emotion, User user, Comment comment) { commentEmotionRepository.save(newEmotion); } + private List getRestaurantInfoList(String keyword, int page) { + return (keyword != null) + ? tourApiService.getRestaurantInfoByKeyWord(keyword, page, 1) + : tourApiService.getRestaurantInfo(1, page); + } + + private List mapToSearchSnackResponses(List restaurantInfo) { + return restaurantInfo.stream() + .map(restaurant -> new SearchSnackResponse( + restaurant.getContentId(), + restaurant.getTitle(), + restaurant.getFirstImage(), + tourApiService.getTreatMenu(restaurant.getContentId()) + )) + .collect(Collectors.toList()); + } + } diff --git a/src/main/java/co/kr/jurumarble/config/WebConfig.java b/src/main/java/co/kr/jurumarble/config/WebConfig.java index 512f148f..fedd0970 100644 --- a/src/main/java/co/kr/jurumarble/config/WebConfig.java +++ b/src/main/java/co/kr/jurumarble/config/WebConfig.java @@ -25,7 +25,8 @@ public void addInterceptors(InterceptorRegistry registry) { .addPathPatterns("/api/votes/{voteId}/comments") .addPathPatterns("/api/votes/{voteId}/comments/{commentId}") .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/likers") - .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/haters"); + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/haters") + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/snack"); } From aa3646b681c2e60982186e85efa93e69db8ab4df Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 12 Aug 2023 02:41:07 +0900 Subject: [PATCH 24/76] =?UTF-8?q?style=20:=20mapToSearchSnackResponses=20-?= =?UTF-8?q?>=20convertToSearchSnackResponseList=20=EB=A9=94=EC=86=8C?= =?UTF-8?q?=EB=93=9C=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/co/kr/jurumarble/comment/service/CommentService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 907d8590..eb00c1df 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -115,7 +115,7 @@ public List searchSnack(Long voteId, Long commentId, Long u List restaurantInfo = getRestaurantInfoList(keyword, page); - return mapToSearchSnackResponses(restaurantInfo); + return convertToSearchSnackResponseList(restaurantInfo); } @@ -231,7 +231,7 @@ private List getRestaurantInfoList(String keyword, int page) : tourApiService.getRestaurantInfo(1, page); } - private List mapToSearchSnackResponses(List restaurantInfo) { + private List convertToSearchSnackResponseList(List restaurantInfo) { return restaurantInfo.stream() .map(restaurant -> new SearchSnackResponse( restaurant.getContentId(), From 23798fba439f21acb0176c29ce3d6ecbeebb02df Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 13 Aug 2023 02:00:51 +0900 Subject: [PATCH 25/76] =?UTF-8?q?fix=20:=20tourApi=EC=9D=98=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=EA=B0=80=20=EC=97=86=EB=8A=94=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/JacksonConfiguration.java | 17 +++++++++++ .../tourApi/TourAreaBasedListResponse.java | 30 +++++++++++++------ .../tourApi/TourSearchKeyWordResponse.java | 28 +++++++++++------ 3 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java b/src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java new file mode 100644 index 00000000..8e0afa81 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java @@ -0,0 +1,17 @@ +package co.kr.jurumarble.client.tourApi; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class JacksonConfiguration { + + @Bean + public ObjectMapper objectMapper() { + return new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) // Deserialization 과정 중에 알 수 없는 속성이 포함된 경우 에러를 발생시키지 않도록 설정 + .enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); //JSON 문자열이 빈 문자열("")일 경우 해당 객체를 null 값으로 처리하도록 설정 + } +} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java index a540f50c..33f7cc9d 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java @@ -1,10 +1,12 @@ package co.kr.jurumarble.client.tourApi; +import co.kr.jurumarble.exception.comment.NoDataFoundException; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; @Data @@ -13,21 +15,30 @@ public class TourAreaBasedListResponse { private TourAreaBasedListResponse.Response response; public List getContentIds() { - return response.getBody().getItems().getItem().stream() - .map(TourAreaBasedListResponse.Item::getContentid) - .collect(Collectors.toList()); + if (response != null && response.getBody() != null && response.getBody().getItems() != null) { + return response.getBody().getItems().getItem().stream() + .map(TourAreaBasedListResponse.Item::getContentid) + .collect(Collectors.toList()); + } + throw new NoDataFoundException(); } public List getFirstImages() { - return response.getBody().getItems().getItem().stream() - .map(TourAreaBasedListResponse.Item::getFirstimage) - .collect(Collectors.toList()); + if (response != null && response.getBody() != null && response.getBody().getItems() != null) { + return response.getBody().getItems().getItem().stream() + .map(TourAreaBasedListResponse.Item::getFirstimage) + .collect(Collectors.toList()); + } + throw new NoDataFoundException(); } public List getTitles() { - return response.getBody().getItems().getItem().stream() - .map(TourAreaBasedListResponse.Item::getTitle) - .collect(Collectors.toList()); + if (response != null && response.getBody() != null && response.getBody().getItems() != null) { + return response.getBody().getItems().getItem().stream() + .map(TourAreaBasedListResponse.Item::getTitle) + .collect(Collectors.toList()); + } + throw new NoDataFoundException(); } @Data @@ -46,6 +57,7 @@ static class Body { static class Items { @JsonProperty("item") private List item; + } @Data diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java index ae8c7891..25c93b4f 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourSearchKeyWordResponse.java @@ -1,5 +1,6 @@ package co.kr.jurumarble.client.tourApi; +import co.kr.jurumarble.exception.comment.NoDataFoundException; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @@ -12,21 +13,30 @@ public class TourSearchKeyWordResponse { private TourSearchKeyWordResponse.Response response; public List getContentIds() { - return response.getBody().getItems().getItem().stream() - .map(TourSearchKeyWordResponse.Item::getContentid) - .collect(Collectors.toList()); + if (response != null && response.getBody() != null && response.getBody().getItems() != null) { + return response.getBody().getItems().getItem().stream() + .map(TourSearchKeyWordResponse.Item::getContentid) + .collect(Collectors.toList()); + } + throw new NoDataFoundException(); } public List getFirstImages() { - return response.getBody().getItems().getItem().stream() - .map(TourSearchKeyWordResponse.Item::getFirstimage) - .collect(Collectors.toList()); + if (response != null && response.getBody() != null && response.getBody().getItems() != null) { + return response.getBody().getItems().getItem().stream() + .map(TourSearchKeyWordResponse.Item::getFirstimage) + .collect(Collectors.toList()); + } + throw new NoDataFoundException(); } public List getTitles() { - return response.getBody().getItems().getItem().stream() - .map(TourSearchKeyWordResponse.Item::getTitle) - .collect(Collectors.toList()); + if (response != null && response.getBody() != null && response.getBody().getItems() != null) { + return response.getBody().getItems().getItem().stream() + .map(TourSearchKeyWordResponse.Item::getTitle) + .collect(Collectors.toList()); + } + throw new NoDataFoundException(); } @Data From 9de41f38705b31a68a6fbf47f2c1a28b0854459b Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 13 Aug 2023 02:01:23 +0900 Subject: [PATCH 26/76] =?UTF-8?q?feat=20:=20=EC=95=88=EC=A3=BC=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 9 +++++++++ .../comment/dto/request/UpdateSnackRequest.java | 7 +++---- .../jurumarble/comment/service/CommentService.java | 13 ++++++++++++- .../java/co/kr/jurumarble/config/WebConfig.java | 3 ++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index dc03442e..da8fff22 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -105,5 +105,14 @@ public ResponseEntity> searchSnack(@PathVariable Long return new ResponseEntity(searchSnackResponses, HttpStatus.OK); } + @Operation(summary = "안주 이미지", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @GetMapping("/votes/{voteId}/comments/{commentId}/snack/{contentId}") + public ResponseEntity> getSnackImage(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @PathVariable String contentId) { + + List snackImage = commentService.getSnackImage(voteId, commentId, userId, contentId); + + return new ResponseEntity(snackImage, HttpStatus.OK); + } + } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java index 2531ac4b..18fbd721 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java @@ -1,11 +1,10 @@ package co.kr.jurumarble.comment.dto.request; -import co.kr.jurumarble.comment.domain.Snack; -import lombok.Getter; -import lombok.NoArgsConstructor; +import lombok.*; @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor public class UpdateSnackRequest { private String snackImage; diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index eb00c1df..fa9c58f0 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -41,7 +41,6 @@ public class CommentService { private final VoteRepository voteRepository; private final CommentRepository commentRepository; private final CommentEmotionRepository commentEmotionRepository; - private final TourApiService tourApiService; public void createComment(Long voteId, Long userId, CreateCommentRequest request) { @@ -119,6 +118,17 @@ public List searchSnack(Long voteId, Long commentId, Long u } + public List getSnackImage(Long voteId, Long commentId, Long userId, String contentId) { + User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); + Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); + Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + + List detailImages = tourApiService.getDetailImages(contentId); + + return detailImages; + + } + private Comment checkParentComment(CreateCommentRequest request) { if (request.getParentId() == null) { @@ -242,5 +252,6 @@ private List convertToSearchSnackResponseList(List Date: Sun, 13 Aug 2023 02:02:32 +0900 Subject: [PATCH 27/76] =?UTF-8?q?refactor=20:=20=EC=A7=80=EC=97=AD=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=20=EC=A1=B0=ED=9A=8C,=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EC=A1=B0=ED=9A=8C=20tourApiService=20for=EB=AC=B8?= =?UTF-8?q?=20->=20stream=20=EC=9C=BC=EB=A1=9C=20=EB=A6=AC=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiService.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index d6d9cc97..dc3203b2 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -8,6 +8,8 @@ import java.net.URLDecoder; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; @Component @RequiredArgsConstructor @@ -97,13 +99,10 @@ public List getRestaurantInfo(int areaCode, int pageNo) { List firstImages = restaurantList.getFirstImages(); List titles = restaurantList.getTitles(); - List restaurantInfoList = new ArrayList<>(); - for (int i = 0; i < contentIds.size(); i++) { - String contentId = contentIds.get(i); - String firstImage = firstImages.get(i); - String title = titles.get(i); - restaurantInfoList.add(new RestaurantInfoDto(contentId, firstImage, title)); - } + List restaurantInfoList = + IntStream.range(0, contentIds.size()) + .mapToObj(i -> new RestaurantInfoDto(contentIds.get(i), firstImages.get(i), titles.get(i))) + .collect(Collectors.toList()); return restaurantInfoList; } @@ -128,13 +127,10 @@ public List getRestaurantInfoByKeyWord(String keyWord, int pa List firstImages = restaurantList.getFirstImages(); List titles = restaurantList.getTitles(); - List restaurantInfoList = new ArrayList<>(); - for (int i = 0; i < contentIds.size(); i++) { - String contentId = contentIds.get(i); - String firstImage = firstImages.get(i); - String title = titles.get(i); - restaurantInfoList.add(new RestaurantInfoDto(contentId, firstImage, title)); - } + List restaurantInfoList = + IntStream.range(0, contentIds.size()) + .mapToObj(i -> new RestaurantInfoDto(contentIds.get(i), firstImages.get(i), titles.get(i))) + .collect(Collectors.toList()); return restaurantInfoList; } From ffeedf2012e3ce5dc73a0b96821a3965857edec5 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 13 Aug 2023 04:29:57 +0900 Subject: [PATCH 28/76] =?UTF-8?q?style=20:=20snack(=EC=95=88=EC=A3=BC)=20-?= =?UTF-8?q?>=20restaurant(=EC=9D=8C=EC=8B=9D=EC=A0=90)=20=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiController.java | 10 ++++---- .../client/tourApi/TourApiService.java | 3 +-- .../kr/jurumarble/comment/domain/Comment.java | 20 ++++++++-------- .../domain/{Snack.java => Restaurant.java} | 23 +++++++++---------- .../dto/request/UpdateSnackRequest.java | 6 ++--- 5 files changed, 30 insertions(+), 32 deletions(-) rename src/main/java/co/kr/jurumarble/comment/domain/{Snack.java => Restaurant.java} (50%) diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java index 14609422..67a8a3b1 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java @@ -17,26 +17,26 @@ public class TourApiController { @GetMapping("/treatMenu") public String getTreatMenu(@RequestParam String contentId) { - return tourApiService.getTreatMenu( contentId); + return tourApiService.getTreatMenu(contentId); } @GetMapping("/imgUrl") - public List getDetailImgUrl(@RequestParam String contentId){ + public List getDetailImgUrl(@RequestParam String contentId) { return tourApiService.getDetailImages(contentId); } @GetMapping("/restaurantInfo") - public List getRestaurantInfo(@RequestParam int areaCode, @RequestParam int pageNo){ + public List getRestaurantInfo(@RequestParam int areaCode, @RequestParam int pageNo) { return tourApiService.getRestaurantInfo(areaCode, pageNo); } @GetMapping("/restaurantInfoByKeyWord") - public List getRestaurantInfoByKeyWord(@RequestParam String keyWord, @RequestParam int areaCode, @RequestParam int pageNo){ + public List getRestaurantInfoByKeyWord(@RequestParam String keyWord, @RequestParam int areaCode, @RequestParam int pageNo) { - return tourApiService.getRestaurantInfoByKeyWord(keyWord,areaCode, pageNo); + return tourApiService.getRestaurantInfoByKeyWord(keyWord, areaCode, pageNo); } } diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index dc3203b2..09468dbe 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -6,7 +6,6 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; -import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -108,7 +107,7 @@ public List getRestaurantInfo(int areaCode, int pageNo) { } - public List getRestaurantInfoByKeyWord(String keyWord, int pageNo, int areaCode) { + public List getRestaurantInfoByKeyWord(String keyWord,int areaCode, int pageNo) { String decodedServiceKey = decodeServiceKey(serviceKey); TourSearchKeyWordResponse restaurantList = tourApiClient.getRestaurantListByKeyWord( diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index 4ba50f7b..d93f5da8 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -66,11 +66,11 @@ public class Comment extends BaseTimeEntity { @Embedded @AttributeOverrides({ - @AttributeOverride(name = "snackImage", column = @Column(name = "snack_image")), - @AttributeOverride(name = "snackName", column = @Column(name = "snack_name")), - @AttributeOverride(name = "restaurantName", column = @Column(name = "restaurant_name")) + @AttributeOverride(name = "restaurantName", column = @Column(name = "restaurant_image")), + @AttributeOverride(name = "restaurantImage", column = @Column(name = "restaurant_name")), + @AttributeOverride(name = "treatMenu", column = @Column(name = "treat_menu")) }) - private Snack snack; + private Restaurant restaurant; public Comment(CreateCommentRequest request, Comment parent, User user, Long voteId) { @@ -113,16 +113,16 @@ public void removeEmotion(CommentEmotion commentEmotion) { public void updateSnack(UpdateSnackRequest request) { - if (request.getSnackImage() != null && !request.getSnackImage().isEmpty()) { - this.snack.updateSnackImage(request.getSnackImage()); + if (request.getRestaurantName() != null && !request.getRestaurantName().isEmpty()) { + this.restaurant.updateRestaurantName(request.getRestaurantName()); } - if (request.getSnackName() != null && !request.getSnackName().isEmpty()) { - this.snack.updateSnackName(request.getSnackName()); + if (request.getRestaurantImage() != null && !request.getRestaurantImage().isEmpty()) { + this.restaurant.updateRestaurantImage(request.getRestaurantImage()); } - if (request.getRestaurantName() != null && !request.getRestaurantName().isEmpty()) { - this.snack.updateRestaurantName(request.getRestaurantName()); + if (request.getTreatMenu() != null && !request.getTreatMenu().isEmpty()) { + this.restaurant.updateTreatMenu(request.getTreatMenu()); } } } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Snack.java b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java similarity index 50% rename from src/main/java/co/kr/jurumarble/comment/domain/Snack.java rename to src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java index 5593c7bf..67c0159d 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Snack.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java @@ -9,20 +9,19 @@ @Getter @AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PROTECTED) -public class Snack { - - private String snackImage; +public class Restaurant { + private String restaurantName; - private String snackName; + private String restaurantImage; - private String restaurantName; + private String treatMenu; - public void updateSnackImage(String snackImage) { - this.snackImage = snackImage; + public void updateRestaurantImage(String restaurantImage) { + this.restaurantImage = restaurantImage; } - public void updateSnackName(String snackName) { - this.snackName = snackName; + public void updateTreatMenu(String treatMenu) { + this.treatMenu = treatMenu; } public void updateRestaurantName(String restaurantName) { @@ -30,10 +29,10 @@ public void updateRestaurantName(String restaurantName) { } - public Snack(UpdateSnackRequest updateSnackRequest){ - this.snackImage = updateSnackRequest.getSnackImage(); - this.snackName = updateSnackRequest.getSnackName(); + public Restaurant(UpdateSnackRequest updateSnackRequest) { this.restaurantName = updateSnackRequest.getRestaurantName(); + this.restaurantImage = updateSnackRequest.getRestaurantImage(); + this.treatMenu = updateSnackRequest.getTreatMenu(); } } diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java index 18fbd721..acdf8b0a 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java @@ -7,11 +7,11 @@ @AllArgsConstructor public class UpdateSnackRequest { - private String snackImage; + private String restaurantName; - private String snackName; + private String restaurantImage; - private String restaurantName; + private String treatMenu; } From 26716123cdd4e70901697e9c6f6239eadb682336 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 14 Aug 2023 23:18:41 +0900 Subject: [PATCH 29/76] =?UTF-8?q?style=20:=20snack(=EC=95=88=EC=A3=BC)=20-?= =?UTF-8?q?>=20restaurant(=EC=9D=8C=EC=8B=9D=EC=A0=90)=20=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 16 ++++++++-------- .../co/kr/jurumarble/comment/domain/Comment.java | 3 ++- .../kr/jurumarble/comment/domain/Restaurant.java | 8 -------- .../comment/service/CommentService.java | 6 +++--- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index da8fff22..170b703e 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -89,29 +89,29 @@ public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long @Operation(summary = "안주 추가", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") @PatchMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity addSnackToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateSnackRequest updateSnackRequest) { + public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateSnackRequest updateSnackRequest) { - commentService.addSnackToComment(voteId, commentId, userId, updateSnackRequest); + commentService.addRestaurantToComment(voteId, commentId, userId, updateSnackRequest); return new ResponseEntity(HttpStatus.OK); } @Operation(summary = "안주 검색", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") @GetMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity> searchSnack(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { + public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { - List searchSnackResponses = commentService.searchSnack(voteId, commentId, userId, keyword, page); + List searchRestaurantResponses = commentService.searchSnack(voteId, commentId, userId, keyword, page); - return new ResponseEntity(searchSnackResponses, HttpStatus.OK); + return new ResponseEntity(searchRestaurantResponses, HttpStatus.OK); } @Operation(summary = "안주 이미지", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") @GetMapping("/votes/{voteId}/comments/{commentId}/snack/{contentId}") - public ResponseEntity> getSnackImage(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @PathVariable String contentId) { + public ResponseEntity> getRestaurantImage(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @PathVariable String contentId) { - List snackImage = commentService.getSnackImage(voteId, commentId, userId, contentId); + List restaurantImage = commentService.getRestaurantImage(voteId, commentId, userId, contentId); - return new ResponseEntity(snackImage, HttpStatus.OK); + return new ResponseEntity(restaurantImage, HttpStatus.OK); } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index d93f5da8..54bb3951 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -83,6 +83,7 @@ public Comment(CreateCommentRequest request, Comment parent, User user, Long vot this.parent = parent; this.likeCount = 0; this.hateCount = 0; + this.restaurant = new Restaurant(); } public void updateParent(Comment parent) { @@ -112,7 +113,7 @@ public void removeEmotion(CommentEmotion commentEmotion) { } - public void updateSnack(UpdateSnackRequest request) { + public void updateRestaurant(UpdateSnackRequest request) { if (request.getRestaurantName() != null && !request.getRestaurantName().isEmpty()) { this.restaurant.updateRestaurantName(request.getRestaurantName()); } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java index 67c0159d..60a61f44 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java @@ -27,13 +27,5 @@ public void updateTreatMenu(String treatMenu) { public void updateRestaurantName(String restaurantName) { this.restaurantName = restaurantName; } - - - public Restaurant(UpdateSnackRequest updateSnackRequest) { - this.restaurantName = updateSnackRequest.getRestaurantName(); - this.restaurantImage = updateSnackRequest.getRestaurantImage(); - this.treatMenu = updateSnackRequest.getTreatMenu(); - } - } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index fa9c58f0..f9dc9958 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -96,12 +96,12 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti doEmote(emotion, user, comment); } - public void addSnackToComment(Long voteId, Long commentId, Long userId, UpdateSnackRequest request) { + public void addRestaurantToComment(Long voteId, Long commentId, Long userId, UpdateSnackRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - comment.updateSnack(request); + comment.updateRestaurant(request); } @@ -118,7 +118,7 @@ public List searchSnack(Long voteId, Long commentId, Long u } - public List getSnackImage(Long voteId, Long commentId, Long userId, String contentId) { + public List getRestaurantImage(Long voteId, Long commentId, Long userId, String contentId) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); From 93343f17265302fc29932dd476288bd4d04154cd Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 18 Aug 2023 19:51:08 +0900 Subject: [PATCH 30/76] =?UTF-8?q?style=20:=20swagger=20=EC=84=A4=EB=AA=85?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EC=95=88=EC=A3=BC(Snack)?= =?UTF-8?q?=20->=20=EC=9D=8C=EC=8B=9D=EC=A0=90(Restaurant)=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourApiController.java | 42 ------------------- .../comment/controller/CommentController.java | 24 +++++------ ...nse.java => SearchRestaurantResponse.java} | 4 +- .../dto/request/CreateCommentRequest.java | 3 ++ .../comment/service/CommentService.java | 18 ++------ 5 files changed, 21 insertions(+), 70 deletions(-) delete mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java rename src/main/java/co/kr/jurumarble/comment/dto/{SearchSnackResponse.java => SearchRestaurantResponse.java} (72%) diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java deleted file mode 100644 index 67a8a3b1..00000000 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiController.java +++ /dev/null @@ -1,42 +0,0 @@ -package co.kr.jurumarble.client.tourApi; - -import lombok.RequiredArgsConstructor; -import org.bouncycastle.cert.ocsp.Req; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@RestController -@RequiredArgsConstructor -public class TourApiController { - - private final TourApiService tourApiService; - - @GetMapping("/treatMenu") - public String getTreatMenu(@RequestParam String contentId) { - - return tourApiService.getTreatMenu(contentId); - } - - - @GetMapping("/imgUrl") - public List getDetailImgUrl(@RequestParam String contentId) { - - return tourApiService.getDetailImages(contentId); - } - - @GetMapping("/restaurantInfo") - public List getRestaurantInfo(@RequestParam int areaCode, @RequestParam int pageNo) { - - return tourApiService.getRestaurantInfo(areaCode, pageNo); - } - - @GetMapping("/restaurantInfoByKeyWord") - public List getRestaurantInfoByKeyWord(@RequestParam String keyWord, @RequestParam int areaCode, @RequestParam int pageNo) { - - return tourApiService.getRestaurantInfoByKeyWord(keyWord, areaCode, pageNo); - } - -} diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index 170b703e..3ed1cef8 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -1,6 +1,6 @@ package co.kr.jurumarble.comment.controller; -import co.kr.jurumarble.comment.dto.SearchSnackResponse; +import co.kr.jurumarble.comment.dto.SearchRestaurantResponse; import co.kr.jurumarble.comment.dto.request.GetCommentRequest; import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; @@ -29,7 +29,7 @@ public class CommentController { private final CommentService commentService; - @Operation(summary = "댓글 생성", description = "헤더에 토큰, 파라미터에 voteId, 바디에 {parentId, content} json 형식으로 보내주시면 됩니다.") + @Operation(summary = "댓글 생성", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'를, 요청 바디에 'parentId'(댓글의 부모 아이디. 대댓글일 경우 부모 댓글 아이디, 없으면 빈 문자열)와 'content'(댓글 내용)을 JSON 형식으로 보내주세요.") @PostMapping("/votes/{voteId}/comments") public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute Long userId, @RequestBody @Valid CreateCommentRequest createCommentRequest) { @@ -39,7 +39,7 @@ public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute } - @Operation(summary = "댓글 조회", description = "파라미터에 voteId, {age, mbti, gender, sortBy, page, size} json 형식으로 보내주시면 됩니다.") + @Operation(summary = "댓글 조회", description = "헤더에 토큰(`Authorization`)을 포함하고, URL 파라미터에 'voteId'를, 요청 쿼리에 'age'(연령 필터 - 선택), 'mbti'(MBTI 필터 - 선택), 'gender'(성별 필터 - 선택), 'sortBy'(정렬 기준 - ByTime, ByPopularity), 'page'(페이지 번호)와 'size'(페이지 내의 데이터 수)를 JSON 형식으로 보내 주십시오.") @GetMapping("/votes/{voteId}/comments") public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute GetCommentRequest getCommentRequest) { @@ -49,7 +49,7 @@ public ResponseEntity> getComment(@PathVariable Long v } - @Operation(summary = "댓글 수정", description = "파라미터에 voteId, commentId {content} json 형식으로 보내주시면 됩니다.") + @Operation(summary = "댓글 수정", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를, 요청 바디에 'content'(수정할 댓글 내용)을 JSON 형식으로 보내주세요.") @PatchMapping("/votes/{voteId}/comments/{commentId}") public ResponseEntity updateComment(@PathVariable Long voteId, @PathVariable Long commentId, @Valid @RequestBody UpdateCommentRequest updateCommentRequest, @RequestAttribute Long userId) { @@ -59,7 +59,7 @@ public ResponseEntity updateComment(@PathVariable Long voteId, @PathVariable Lon } - @Operation(summary = "댓글 삭제", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다.") + @Operation(summary = "댓글 삭제", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하여 댓글을 삭제하는 기능.") @DeleteMapping("/votes/{voteId}/comments/{commentId}") public ResponseEntity deleteComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId) { @@ -68,7 +68,7 @@ public ResponseEntity deleteComment(@PathVariable Long voteId, @PathVariable Lon return new ResponseEntity(HttpStatus.NO_CONTENT); } - @Operation(summary = "댓글 좋아요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다.") + @Operation(summary = "댓글 좋아요", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하여 댓글을 좋아요하는 기능입니다.") @PostMapping("/votes/{voteId}/comments/{commentId}/likers") public ResponseEntity likeComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId) { @@ -77,7 +77,7 @@ public ResponseEntity likeComment(@PathVariable Long voteId, @PathVariable Long return new ResponseEntity(HttpStatus.OK); } - @Operation(summary = "댓글 싫어요", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @Operation(summary = "댓글 싫어요", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하여 댓글을 싫어요하는 기능입니다.") @PostMapping("/votes/{voteId}/comments/{commentId}/haters") public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId) { @@ -87,7 +87,7 @@ public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long return new ResponseEntity(HttpStatus.OK); } - @Operation(summary = "안주 추가", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @Operation(summary = "음식점 추가", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 바디에 업데이트할 음식점 정보를 JSON 형식으로 전달하여 댓글에 추가하는 기능입니다.") @PatchMapping("/votes/{voteId}/comments/{commentId}/snack") public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateSnackRequest updateSnackRequest) { @@ -96,16 +96,16 @@ public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVar return new ResponseEntity(HttpStatus.OK); } - @Operation(summary = "안주 검색", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @Operation(summary = "음식점 검색", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 쿼리에 'keyword'(검색 키워드 - 선택)과 'page'(요청 페이지 인덱스)를 전달하여 음식점을 검색하는 기능입니다.") @GetMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { + public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { - List searchRestaurantResponses = commentService.searchSnack(voteId, commentId, userId, keyword, page); + List searchRestaurantResponses = commentService.searchRestaurant(voteId, commentId, userId, keyword, page); return new ResponseEntity(searchRestaurantResponses, HttpStatus.OK); } - @Operation(summary = "안주 이미지", description = "헤더에 토큰 담고, 파라미터에 voteId, commentId 보내주시면 됩니다") + @Operation(summary = "음식점 이미지 조회", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId', 'commentId'와 'contentId'를 전달하여 특정 음식점의 이미지를 가져오는 기능입니다.") @GetMapping("/votes/{voteId}/comments/{commentId}/snack/{contentId}") public ResponseEntity> getRestaurantImage(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @PathVariable String contentId) { diff --git a/src/main/java/co/kr/jurumarble/comment/dto/SearchSnackResponse.java b/src/main/java/co/kr/jurumarble/comment/dto/SearchRestaurantResponse.java similarity index 72% rename from src/main/java/co/kr/jurumarble/comment/dto/SearchSnackResponse.java rename to src/main/java/co/kr/jurumarble/comment/dto/SearchRestaurantResponse.java index 10ebd832..16595de6 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/SearchSnackResponse.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/SearchRestaurantResponse.java @@ -4,7 +4,7 @@ @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) -public class SearchSnackResponse { +public class SearchRestaurantResponse { private String contentId; @@ -14,7 +14,7 @@ public class SearchSnackResponse { private String treatMenu; - public SearchSnackResponse(String contentId, String restaurantName, String restaurantImage, String treatMenu) { + public SearchRestaurantResponse(String contentId, String restaurantName, String restaurantImage, String treatMenu) { this.contentId = contentId; this.restaurantName = restaurantName; this.restaurantImage = restaurantImage; diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java index 07b5a1f7..ddd75706 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java @@ -1,5 +1,6 @@ package co.kr.jurumarble.comment.dto.request; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.NoArgsConstructor; @@ -9,8 +10,10 @@ @NoArgsConstructor public class CreateCommentRequest { + @Schema(description = "부모 댓글 ID", example = "") private Long parentId; + @Schema(description = "댓글 내용", example = "좋습니다!", maxLength = 500) @NotBlank private String content; } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index f9dc9958..acf2c341 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -4,7 +4,7 @@ import co.kr.jurumarble.client.tourApi.TourApiService; import co.kr.jurumarble.comment.domain.Comment; import co.kr.jurumarble.comment.domain.CommentEmotion; -import co.kr.jurumarble.comment.dto.SearchSnackResponse; +import co.kr.jurumarble.comment.dto.SearchRestaurantResponse; import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; import co.kr.jurumarble.comment.dto.request.GetCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; @@ -47,9 +47,7 @@ public void createComment(Long voteId, Long userId, CreateCommentRequest request User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = checkParentComment(request); // 부모댓글이 있는지 없는지 확인 - checkNestedCommentAllowed(parentComment); - Comment comment = new Comment(request, parentComment, user, voteId); commentRepository.save(comment); @@ -58,13 +56,9 @@ public void createComment(Long voteId, Long userId, CreateCommentRequest request public Slice getComments(Long voteId, GetCommentRequest request) { Pageable pageable = PageRequest.of(request.getPage(), request.getSize()); - List comments = findCommentsBySortType(voteId, request, pageable); //정렬방식에 따라 Pageable 적용하여 부모댓글 가져오기 - getChildCommentByParentComment(comments); //부모댓글에 속한 대댓글들 다가져오기 - List getCommentResponse = convertToGetCommentResponseList(comments); // 댓글 목록을 매개 변수로 받아, GetCommentResponse 목록을 반환 - Slice slice = convertToSlice(voteId, request, pageable, getCommentResponse); // Response 리스트를 Slice 객체로 만들어주기 return slice; @@ -76,7 +70,6 @@ public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommen User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - comment.updateContent(request); } @@ -84,7 +77,6 @@ public void deleteComment(Long voteId, Long commentId, Long userId) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - commentRepository.delete(comment); } @@ -92,7 +84,6 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - doEmote(emotion, user, comment); } @@ -100,12 +91,11 @@ public void addRestaurantToComment(Long voteId, Long commentId, Long userId, Upd User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - comment.updateRestaurant(request); } - public List searchSnack(Long voteId, Long commentId, Long userId, String keyword, int page) { + public List searchRestaurant(Long voteId, Long commentId, Long userId, String keyword, int page) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); @@ -241,9 +231,9 @@ private List getRestaurantInfoList(String keyword, int page) : tourApiService.getRestaurantInfo(1, page); } - private List convertToSearchSnackResponseList(List restaurantInfo) { + private List convertToSearchSnackResponseList(List restaurantInfo) { return restaurantInfo.stream() - .map(restaurant -> new SearchSnackResponse( + .map(restaurant -> new SearchRestaurantResponse( restaurant.getContentId(), restaurant.getTitle(), restaurant.getFirstImage(), From 9f8be11cb5c1f293262235c224cb4f125b665a2a Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 18 Aug 2023 23:05:51 +0900 Subject: [PATCH 31/76] =?UTF-8?q?feat=20:=20Comment,=20CommentEmotion=20?= =?UTF-8?q?=EA=B3=BC=20User=20=EC=97=B0=EA=B4=80=EA=B4=80=EA=B3=84=20?= =?UTF-8?q?=EB=81=8A=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../co/kr/jurumarble/comment/domain/CommentEmotion.java | 1 - .../jurumarble/comment/repository/CommentRepository.java | 5 +++++ .../co/kr/jurumarble/comment/service/CommentService.java | 4 ++++ src/main/java/co/kr/jurumarble/user/domain/User.java | 8 -------- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java b/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java index 83ab5464..6daf2fed 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java @@ -43,7 +43,6 @@ public void mappingComment(Comment comment) { public void mappingUser(User user) { this.user = user; - user.mappingCommentLike(this); } public void setEmote(Emotion emotion) { diff --git a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java index b66f4ca9..a05c099b 100644 --- a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java +++ b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java @@ -1,6 +1,7 @@ package co.kr.jurumarble.comment.repository; import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.user.domain.User; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; @@ -8,6 +9,7 @@ import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Optional; @Repository public interface CommentRepository extends JpaRepository { @@ -22,4 +24,7 @@ public interface CommentRepository extends JpaRepository { int countByVoteIdAndParentIsNull(Long voteId); List findByParent(Comment parent); + + @Query("SELECT COUNT(c) > 0 FROM Comment c WHERE c.id = :commentId AND c.user = :user") + boolean existsByCommentAndUser(Comment comment, User user); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index acf2c341..04eca82a 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -70,6 +70,8 @@ public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommen User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); +// boolean b = commentRepository.existsByCommentAndUser(comment, user); +// System.out.println("b = " + b); comment.updateContent(request); } @@ -77,6 +79,8 @@ public void deleteComment(Long voteId, Long commentId, Long userId) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); +// boolean b = commentRepository.existsByCommentAndUser(comment, user); +// System.out.println("b = " + b); commentRepository.delete(comment); } diff --git a/src/main/java/co/kr/jurumarble/user/domain/User.java b/src/main/java/co/kr/jurumarble/user/domain/User.java index 19281d57..08460410 100644 --- a/src/main/java/co/kr/jurumarble/user/domain/User.java +++ b/src/main/java/co/kr/jurumarble/user/domain/User.java @@ -52,9 +52,6 @@ public class User extends BaseTimeEntity { @Column private LocalDateTime modifiedMbtiDate; - @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = CascadeType.REMOVE) - private List commentEmotionList = new ArrayList<>(); - public AgeType classifyAge(Integer age) { AgeType ageGroup; @@ -116,9 +113,4 @@ public int hashCode() { } - public void mappingCommentLike(CommentEmotion commentEmotion) { - this.commentEmotionList.add(commentEmotion); - } - - } \ No newline at end of file From f76baac01313efa97828b8ee92333affcd21a4b4 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 18 Aug 2023 23:06:21 +0900 Subject: [PATCH 32/76] =?UTF-8?q?stlye=20:=20request=20=EC=97=90=EB=9F=AC?= =?UTF-8?q?=EB=A9=94=EC=8B=9C=EC=A7=80,=20=EC=84=A4=EB=AA=85=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/dto/request/CreateCommentRequest.java | 4 +++- .../comment/dto/request/GetCommentRequest.java | 10 +++++++--- .../comment/dto/request/UpdateCommentRequest.java | 6 +++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java index ddd75706..5a0ee8b9 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java @@ -3,14 +3,16 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; import javax.validation.constraints.NotBlank; @Getter +@Setter @NoArgsConstructor public class CreateCommentRequest { - @Schema(description = "부모 댓글 ID", example = "") + @Schema(description = "부모 댓글 ID") private Long parentId; @Schema(description = "댓글 내용", example = "좋습니다!", maxLength = 500) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java index 501a5bb9..1578e10b 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java @@ -1,6 +1,7 @@ package co.kr.jurumarble.comment.dto.request; import co.kr.jurumarble.comment.enums.SortType; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @@ -12,12 +13,15 @@ @NoArgsConstructor public class GetCommentRequest { - @NotNull + @Schema(description = "정렬 방식", defaultValue = "ByTime") + @NotNull(message = "정렬 방식은 필수입니다.") private SortType sortBy; - @NotNull + @Schema(description = "페이지 번호", defaultValue = "0") + @NotNull(message = "페이지 번호는 필수입니다.") private int page; - @NotNull + @Schema(description = "페이지 크기", defaultValue = "5") + @NotNull(message = "페이지 크기는 필수입니다.") private int size; } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java index 188e89a3..1ede5616 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java @@ -1,5 +1,6 @@ package co.kr.jurumarble.comment.dto.request; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Getter; import lombok.NoArgsConstructor; @@ -8,6 +9,9 @@ @Getter @NoArgsConstructor public class UpdateCommentRequest { - @NotBlank + + @Schema(description = "수정할 댓글 내용", example = "수정된 내용입니다.") + @NotBlank(message = "댓글 내용은 비어 있을 수 없습니다.") private String content; + } From e697c8d3060768a2f6708619a6d7906ff6cd2162 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 19 Aug 2023 03:30:29 +0900 Subject: [PATCH 33/76] =?UTF-8?q?fix=20:=20object=20mapper=EC=9D=98=20conf?= =?UTF-8?q?ig=EB=A5=BC=20tourApi=20=ED=8C=A8=ED=82=A4=EC=A7=80=EC=97=90?= =?UTF-8?q?=EB=A7=8C=20=EC=A0=81=EC=9A=A9=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 + .../client/tourApi/JacksonConfiguration.java | 17 ----------- .../client/tourApi/TourApiClient.java | 2 +- .../client/tourApi/TourApiClientConfig.java | 29 +++++++++++++++++++ .../client/tourApi/TourApiService.java | 7 +---- 5 files changed, 32 insertions(+), 24 deletions(-) delete mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java create mode 100644 src/main/java/co/kr/jurumarble/client/tourApi/TourApiClientConfig.java diff --git a/build.gradle b/build.gradle index d35b7bfc..1247ccbd 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,7 @@ dependencies { implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:3.1.3' runtimeOnly 'io.github.openfeign:feign-httpclient:12.1' + implementation 'com.netflix.feign:feign-jackson:8.18.0' } tasks.named('test') { diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java b/src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java deleted file mode 100644 index 8e0afa81..00000000 --- a/src/main/java/co/kr/jurumarble/client/tourApi/JacksonConfiguration.java +++ /dev/null @@ -1,17 +0,0 @@ -package co.kr.jurumarble.client.tourApi; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class JacksonConfiguration { - - @Bean - public ObjectMapper objectMapper() { - return new ObjectMapper() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) // Deserialization 과정 중에 알 수 없는 속성이 포함된 경우 에러를 발생시키지 않도록 설정 - .enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); //JSON 문자열이 빈 문자열("")일 경우 해당 객체를 null 값으로 처리하도록 설정 - } -} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java index 914407cb..1936a81e 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClient.java @@ -4,7 +4,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; -@FeignClient(value = "tour-service", url = "${tour.api.url}") +@FeignClient(value = "tour-service", url = "${tour.api.url}", configuration = TourApiClientConfig.class) public interface TourApiClient { //소개 정보 조회 diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClientConfig.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClientConfig.java new file mode 100644 index 00000000..91ad5ba9 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiClientConfig.java @@ -0,0 +1,29 @@ +package co.kr.jurumarble.client.tourApi; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import feign.codec.Decoder; +import feign.codec.Encoder; +import feign.jackson.JacksonDecoder; +import feign.jackson.JacksonEncoder; +import org.springframework.cloud.openfeign.support.ResponseEntityDecoder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class TourApiClientConfig { + + private ObjectMapper customObjectMapper = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); + + @Bean + public Decoder feignDecoder() { + return new ResponseEntityDecoder(new JacksonDecoder(customObjectMapper)); // 디코딩 과정에서 사용할 수 있는 Decoder Bean을 생성 + } + + @Bean + public Encoder feignEncoder() { + return new JacksonEncoder(customObjectMapper); //인코딩 과정에서 사용할 수 있는 Encoder Bean을 생성 + } +} diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java index 09468dbe..0fb2ed2d 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourApiService.java @@ -18,19 +18,14 @@ public class TourApiService { @Value("${tour.api.servicekey}") private String serviceKey; - @Value("${tour.api.mobile.os}") private String mobileOS; - @Value("${tour.api.mobile.app}") private String mobileApp; - @Value("${tour.api.response.type}") private String responseType; - @Value("${tour.api.content-type-id}") private int contentTypeId; - @Value("${tour.api.image-yn}") private String imageYN; @Value("${tour.api.subimage-yn}") @@ -107,7 +102,7 @@ public List getRestaurantInfo(int areaCode, int pageNo) { } - public List getRestaurantInfoByKeyWord(String keyWord,int areaCode, int pageNo) { + public List getRestaurantInfoByKeyWord(String keyWord, int areaCode, int pageNo) { String decodedServiceKey = decodeServiceKey(serviceKey); TourSearchKeyWordResponse restaurantList = tourApiClient.getRestaurantListByKeyWord( From e7d920a1572d7f2892646b0ca8740cf41969a5fe Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 19 Aug 2023 04:18:02 +0900 Subject: [PATCH 34/76] =?UTF-8?q?style=20:=20comment=20request,response=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/controller/CommentController.java | 24 ++++----- .../kr/jurumarble/comment/domain/Comment.java | 12 ++--- .../jurumarble/comment/domain/Restaurant.java | 1 - .../dto/request/CreateCommentRequest.java | 21 ++++++-- .../dto/request/GetCommentRequest.java | 17 ++++++ .../dto/request/UpdateCommentRequest.java | 12 +++++ .../dto/request/UpdateRestaurantRequest.java | 28 ++++++++++ .../dto/request/UpdateSnackRequest.java | 17 ------ .../comment/service/CommentService.java | 52 ++++++++----------- .../GetCommentData.java} | 41 ++------------- .../SearchRestaurantData.java} | 7 ++- .../request/CreateCommentServiceRequest.java | 21 ++++++++ .../request/GetCommentServiceRequest.java | 24 +++++++++ .../request/UpdateCommentServiceRequest.java | 18 +++++++ .../UpdateRestaurantServiceRequest.java | 17 ++++++ 15 files changed, 201 insertions(+), 111 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java delete mode 100644 src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java rename src/main/java/co/kr/jurumarble/comment/{dto/response/GetCommentResponse.java => service/GetCommentData.java} (60%) rename src/main/java/co/kr/jurumarble/comment/{dto/SearchRestaurantResponse.java => service/SearchRestaurantData.java} (57%) create mode 100644 src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java create mode 100644 src/main/java/co/kr/jurumarble/comment/service/request/GetCommentServiceRequest.java create mode 100644 src/main/java/co/kr/jurumarble/comment/service/request/UpdateCommentServiceRequest.java create mode 100644 src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index 3ed1cef8..3dcb2f49 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -1,11 +1,11 @@ package co.kr.jurumarble.comment.controller; -import co.kr.jurumarble.comment.dto.SearchRestaurantResponse; +import co.kr.jurumarble.comment.service.GetCommentData; +import co.kr.jurumarble.comment.service.SearchRestaurantData; import co.kr.jurumarble.comment.dto.request.GetCommentRequest; import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; -import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; -import co.kr.jurumarble.comment.dto.response.GetCommentResponse; +import co.kr.jurumarble.comment.dto.request.UpdateRestaurantRequest; import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.comment.service.CommentService; import io.swagger.v3.oas.annotations.Operation; @@ -33,7 +33,7 @@ public class CommentController { @PostMapping("/votes/{voteId}/comments") public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute Long userId, @RequestBody @Valid CreateCommentRequest createCommentRequest) { - commentService.createComment(voteId, userId, createCommentRequest); + commentService.createComment(voteId, userId, createCommentRequest.toServiceRequest()); return new ResponseEntity(HttpStatus.CREATED); } @@ -41,9 +41,9 @@ public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute @Operation(summary = "댓글 조회", description = "헤더에 토큰(`Authorization`)을 포함하고, URL 파라미터에 'voteId'를, 요청 쿼리에 'age'(연령 필터 - 선택), 'mbti'(MBTI 필터 - 선택), 'gender'(성별 필터 - 선택), 'sortBy'(정렬 기준 - ByTime, ByPopularity), 'page'(페이지 번호)와 'size'(페이지 내의 데이터 수)를 JSON 형식으로 보내 주십시오.") @GetMapping("/votes/{voteId}/comments") - public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute GetCommentRequest getCommentRequest) { + public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute GetCommentRequest getCommentRequest) { - Slice getCommentResponses = commentService.getComments(voteId, getCommentRequest); + Slice getCommentResponses = commentService.getComments(voteId, getCommentRequest.toServiceRequest()); return new ResponseEntity(getCommentResponses, HttpStatus.OK); } @@ -53,7 +53,7 @@ public ResponseEntity> getComment(@PathVariable Long v @PatchMapping("/votes/{voteId}/comments/{commentId}") public ResponseEntity updateComment(@PathVariable Long voteId, @PathVariable Long commentId, @Valid @RequestBody UpdateCommentRequest updateCommentRequest, @RequestAttribute Long userId) { - commentService.updateComment(voteId, commentId, userId, updateCommentRequest); + commentService.updateComment(voteId, commentId, userId, updateCommentRequest.toServiceRequest()); return new ResponseEntity(HttpStatus.OK); } @@ -89,20 +89,20 @@ public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long @Operation(summary = "음식점 추가", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 바디에 업데이트할 음식점 정보를 JSON 형식으로 전달하여 댓글에 추가하는 기능입니다.") @PatchMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateSnackRequest updateSnackRequest) { + public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateRestaurantRequest updateRestaurantRequest) { - commentService.addRestaurantToComment(voteId, commentId, userId, updateSnackRequest); + commentService.addRestaurantToComment(voteId, commentId, userId, updateRestaurantRequest.toServiceRequest()); return new ResponseEntity(HttpStatus.OK); } @Operation(summary = "음식점 검색", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 쿼리에 'keyword'(검색 키워드 - 선택)과 'page'(요청 페이지 인덱스)를 전달하여 음식점을 검색하는 기능입니다.") @GetMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { + public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { - List searchRestaurantResponses = commentService.searchRestaurant(voteId, commentId, userId, keyword, page); + List searchRestaurantRespons = commentService.searchRestaurant(voteId, commentId, userId, keyword, page); - return new ResponseEntity(searchRestaurantResponses, HttpStatus.OK); + return new ResponseEntity(searchRestaurantRespons, HttpStatus.OK); } @Operation(summary = "음식점 이미지 조회", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId', 'commentId'와 'contentId'를 전달하여 특정 음식점의 이미지를 가져오는 기능입니다.") diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index 54bb3951..d7da5daa 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -1,9 +1,9 @@ package co.kr.jurumarble.comment.domain; -import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; -import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; -import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; import co.kr.jurumarble.comment.enums.Emotion; +import co.kr.jurumarble.comment.service.request.CreateCommentServiceRequest; +import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; +import co.kr.jurumarble.comment.service.request.UpdateRestaurantServiceRequest; import co.kr.jurumarble.common.domain.BaseTimeEntity; import co.kr.jurumarble.user.domain.User; import co.kr.jurumarble.user.enums.AgeType; @@ -73,7 +73,7 @@ public class Comment extends BaseTimeEntity { private Restaurant restaurant; - public Comment(CreateCommentRequest request, Comment parent, User user, Long voteId) { + public Comment(CreateCommentServiceRequest request, Comment parent, User user, Long voteId) { this.user = user; this.voteId = voteId; this.content = request.getContent(); @@ -104,7 +104,7 @@ public void updateLikeHateCount() { .count(); } - public void updateContent(UpdateCommentRequest updateCommentRequest) { + public void updateContent(UpdateCommentServiceRequest updateCommentRequest) { this.content = updateCommentRequest.getContent(); } @@ -113,7 +113,7 @@ public void removeEmotion(CommentEmotion commentEmotion) { } - public void updateRestaurant(UpdateSnackRequest request) { + public void updateRestaurant(UpdateRestaurantServiceRequest request) { if (request.getRestaurantName() != null && !request.getRestaurantName().isEmpty()) { this.restaurant.updateRestaurantName(request.getRestaurantName()); } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java index 60a61f44..ed75a33a 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java @@ -1,6 +1,5 @@ package co.kr.jurumarble.comment.domain; -import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; import lombok.*; import javax.persistence.Embeddable; diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java index 5a0ee8b9..a5d336f9 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java @@ -1,15 +1,13 @@ package co.kr.jurumarble.comment.dto.request; +import co.kr.jurumarble.comment.service.request.CreateCommentServiceRequest; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; import javax.validation.constraints.NotBlank; @Getter -@Setter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) public class CreateCommentRequest { @Schema(description = "부모 댓글 ID") @@ -18,4 +16,17 @@ public class CreateCommentRequest { @Schema(description = "댓글 내용", example = "좋습니다!", maxLength = 500) @NotBlank private String content; + + @Builder + public CreateCommentRequest(Long parentId, String content) { + this.parentId = parentId; + this.content = content; + } + + public CreateCommentServiceRequest toServiceRequest(){ + return CreateCommentServiceRequest.builder() + .parentId(parentId) + .content(content) + .build(); + } } diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java index 1578e10b..b2bd2554 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java @@ -1,7 +1,9 @@ package co.kr.jurumarble.comment.dto.request; import co.kr.jurumarble.comment.enums.SortType; +import co.kr.jurumarble.comment.service.request.GetCommentServiceRequest; import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @@ -24,4 +26,19 @@ public class GetCommentRequest { @Schema(description = "페이지 크기", defaultValue = "5") @NotNull(message = "페이지 크기는 필수입니다.") private int size; + + @Builder + public GetCommentRequest(SortType sortBy, int page, int size) { + this.sortBy = sortBy; + this.page = page; + this.size = size; + } + + public GetCommentServiceRequest toServiceRequest(){ + return GetCommentServiceRequest.builder() + .sortBy(sortBy) + .page(page) + .size(size) + .build(); + } } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java index 1ede5616..f09b446d 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java @@ -1,6 +1,8 @@ package co.kr.jurumarble.comment.dto.request; +import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @@ -14,4 +16,14 @@ public class UpdateCommentRequest { @NotBlank(message = "댓글 내용은 비어 있을 수 없습니다.") private String content; + @Builder + public UpdateCommentRequest(String content) { + this.content = content; + } + + public UpdateCommentServiceRequest toServiceRequest(){ + return UpdateCommentServiceRequest.builder() + .content(content) + .build(); + } } diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java new file mode 100644 index 00000000..43ef2d47 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java @@ -0,0 +1,28 @@ +package co.kr.jurumarble.comment.dto.request; + +import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; +import co.kr.jurumarble.comment.service.request.UpdateRestaurantServiceRequest; +import lombok.*; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class UpdateRestaurantRequest { + private String restaurantName; + private String restaurantImage; + private String treatMenu; + + @Builder + public UpdateRestaurantRequest(String restaurantName, String restaurantImage, String treatMenu) { + this.restaurantName = restaurantName; + this.restaurantImage = restaurantImage; + this.treatMenu = treatMenu; + } + + public UpdateRestaurantServiceRequest toServiceRequest(){ + return UpdateRestaurantServiceRequest.builder() + .restaurantName(restaurantName) + .restaurantImage(restaurantImage) + .treatMenu(treatMenu) + .build(); + } +} diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java deleted file mode 100644 index acdf8b0a..00000000 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateSnackRequest.java +++ /dev/null @@ -1,17 +0,0 @@ -package co.kr.jurumarble.comment.dto.request; - -import lombok.*; - -@Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor -public class UpdateSnackRequest { - - private String restaurantName; - - private String restaurantImage; - - private String treatMenu; - - -} diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 04eca82a..f1fa4058 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -4,15 +4,13 @@ import co.kr.jurumarble.client.tourApi.TourApiService; import co.kr.jurumarble.comment.domain.Comment; import co.kr.jurumarble.comment.domain.CommentEmotion; -import co.kr.jurumarble.comment.dto.SearchRestaurantResponse; -import co.kr.jurumarble.comment.dto.request.CreateCommentRequest; -import co.kr.jurumarble.comment.dto.request.GetCommentRequest; -import co.kr.jurumarble.comment.dto.request.UpdateCommentRequest; -import co.kr.jurumarble.comment.dto.request.UpdateSnackRequest; -import co.kr.jurumarble.comment.dto.response.GetCommentResponse; import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.comment.repository.CommentEmotionRepository; import co.kr.jurumarble.comment.repository.CommentRepository; +import co.kr.jurumarble.comment.service.request.CreateCommentServiceRequest; +import co.kr.jurumarble.comment.service.request.GetCommentServiceRequest; +import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; +import co.kr.jurumarble.comment.service.request.UpdateRestaurantServiceRequest; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.comment.InvalidSortingMethodException; import co.kr.jurumarble.exception.comment.NestedCommentNotAllowedException; @@ -43,7 +41,7 @@ public class CommentService { private final CommentEmotionRepository commentEmotionRepository; private final TourApiService tourApiService; - public void createComment(Long voteId, Long userId, CreateCommentRequest request) { + public void createComment(Long voteId, Long userId, CreateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = checkParentComment(request); // 부모댓글이 있는지 없는지 확인 @@ -54,24 +52,22 @@ public void createComment(Long voteId, Long userId, CreateCommentRequest request } - public Slice getComments(Long voteId, GetCommentRequest request) { + public Slice getComments(Long voteId, GetCommentServiceRequest request) { Pageable pageable = PageRequest.of(request.getPage(), request.getSize()); List comments = findCommentsBySortType(voteId, request, pageable); //정렬방식에 따라 Pageable 적용하여 부모댓글 가져오기 getChildCommentByParentComment(comments); //부모댓글에 속한 대댓글들 다가져오기 - List getCommentResponse = convertToGetCommentResponseList(comments); // 댓글 목록을 매개 변수로 받아, GetCommentResponse 목록을 반환 - Slice slice = convertToSlice(voteId, request, pageable, getCommentResponse); // Response 리스트를 Slice 객체로 만들어주기 + List getCommentData = convertToCommentDataList(comments); // 댓글 목록을 매개 변수로 받아, GetCommentData 목록을 반환 + Slice slice = convertToSlice(voteId, request, pageable, getCommentData); // Response 리스트를 Slice 객체로 만들어주기 return slice; } - public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommentRequest request) { + public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); -// boolean b = commentRepository.existsByCommentAndUser(comment, user); -// System.out.println("b = " + b); comment.updateContent(request); } @@ -79,8 +75,6 @@ public void deleteComment(Long voteId, Long commentId, Long userId) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); -// boolean b = commentRepository.existsByCommentAndUser(comment, user); -// System.out.println("b = " + b); commentRepository.delete(comment); } @@ -91,7 +85,7 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti doEmote(emotion, user, comment); } - public void addRestaurantToComment(Long voteId, Long commentId, Long userId, UpdateSnackRequest request) { + public void addRestaurantToComment(Long voteId, Long commentId, Long userId, UpdateRestaurantServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); @@ -99,7 +93,7 @@ public void addRestaurantToComment(Long voteId, Long commentId, Long userId, Upd } - public List searchRestaurant(Long voteId, Long commentId, Long userId, String keyword, int page) { + public List searchRestaurant(Long voteId, Long commentId, Long userId, String keyword, int page) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); @@ -124,7 +118,7 @@ public List getRestaurantImage(Long voteId, Long commentId, Long userId, } - private Comment checkParentComment(CreateCommentRequest request) { + private Comment checkParentComment(CreateCommentServiceRequest request) { if (request.getParentId() == null) { return null; } @@ -138,7 +132,7 @@ private void checkNestedCommentAllowed(Comment parentComment) { } } - private List findCommentsBySortType(Long voteId, GetCommentRequest request, Pageable pageable) { + private List findCommentsBySortType(Long voteId, GetCommentServiceRequest request, Pageable pageable) { List comments; switch (request.getSortBy()) { case ByTime: @@ -163,29 +157,29 @@ private void getChildCommentByParentComment(List comments) { } - private List convertToGetCommentResponseList(List parentComments) { - List getCommentResponse = new ArrayList<>(); - Map map = new HashMap<>(); + private List convertToCommentDataList(List parentComments) { + List getCommentData = new ArrayList<>(); + Map map = new HashMap<>(); for (Comment comment : parentComments) { - GetCommentResponse response = new GetCommentResponse(comment); + GetCommentData response = new GetCommentData(comment); map.put(response.getId(), response); if (response.getParentId() != null) { map.get(response.getParentId()).getChildren().add(response); } else { - getCommentResponse.add(response); + getCommentData.add(response); } } - return getCommentResponse; + return getCommentData; } - private Slice convertToSlice(Long voteId, GetCommentRequest request, Pageable pageable, List getCommentResponse) { + private Slice convertToSlice(Long voteId, GetCommentServiceRequest request, Pageable pageable, List getCommentData) { int countComments = commentRepository.countByVoteIdAndParentIsNull(voteId); //투표에 속한 부모 댓글수 전부 가져오기 int lastPageNumber = (int) Math.ceil((double) countComments / request.getSize()); boolean hasNext = request.getPage() < lastPageNumber - 1; - Slice slice = new SliceImpl<>(getCommentResponse, pageable, hasNext); + Slice slice = new SliceImpl<>(getCommentData, pageable, hasNext); return slice; } @@ -235,9 +229,9 @@ private List getRestaurantInfoList(String keyword, int page) : tourApiService.getRestaurantInfo(1, page); } - private List convertToSearchSnackResponseList(List restaurantInfo) { + private List convertToSearchSnackResponseList(List restaurantInfo) { return restaurantInfo.stream() - .map(restaurant -> new SearchRestaurantResponse( + .map(restaurant -> new SearchRestaurantData( restaurant.getContentId(), restaurant.getTitle(), restaurant.getFirstImage(), diff --git a/src/main/java/co/kr/jurumarble/comment/dto/response/GetCommentResponse.java b/src/main/java/co/kr/jurumarble/comment/service/GetCommentData.java similarity index 60% rename from src/main/java/co/kr/jurumarble/comment/dto/response/GetCommentResponse.java rename to src/main/java/co/kr/jurumarble/comment/service/GetCommentData.java index 7203391d..908f12f1 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/response/GetCommentResponse.java +++ b/src/main/java/co/kr/jurumarble/comment/service/GetCommentData.java @@ -1,4 +1,4 @@ -package co.kr.jurumarble.comment.dto.response; +package co.kr.jurumarble.comment.service; import co.kr.jurumarble.comment.domain.Comment; @@ -7,63 +7,30 @@ import co.kr.jurumarble.user.enums.MbtiType; import lombok.Builder; import lombok.Getter; -import lombok.Setter; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Getter -@Setter -public class GetCommentResponse { - +public class GetCommentData { private Long id; - private Long userId; - private String nickName; - private Long parentId; - private String content; - private String imageUrl; - private GenderType gender; - private AgeType age; - private MbtiType mbti; - private LocalDateTime createdDate; - - private List children; - + private List children; private Integer likeCount; - private Integer hateCount; - - @Builder - public GetCommentResponse(Long id, Long userId, String nickName, Long parentId, String content, String imageUrl, GenderType gender, AgeType age, MbtiType mbti, LocalDateTime createdDate, List children, Integer likeCount, Integer hateCount) { - this.id = id; - this.userId = userId; - this.nickName = nickName; - this.parentId = parentId; - this.content = content; - this.imageUrl = imageUrl; - this.gender = gender; - this.age = age; - this.mbti = mbti; - this.createdDate = createdDate; - this.children = children; - this.likeCount = likeCount; - this.hateCount = hateCount; - } - @Builder - public GetCommentResponse(Comment comment) { + public GetCommentData(Comment comment) { this.id = comment.getId(); this.userId = comment.getUser().getId(); this.content = comment.getContent(); diff --git a/src/main/java/co/kr/jurumarble/comment/dto/SearchRestaurantResponse.java b/src/main/java/co/kr/jurumarble/comment/service/SearchRestaurantData.java similarity index 57% rename from src/main/java/co/kr/jurumarble/comment/dto/SearchRestaurantResponse.java rename to src/main/java/co/kr/jurumarble/comment/service/SearchRestaurantData.java index 16595de6..f4eabd40 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/SearchRestaurantResponse.java +++ b/src/main/java/co/kr/jurumarble/comment/service/SearchRestaurantData.java @@ -1,10 +1,9 @@ -package co.kr.jurumarble.comment.dto; +package co.kr.jurumarble.comment.service; import lombok.*; @Getter -@NoArgsConstructor(access = AccessLevel.PROTECTED) -public class SearchRestaurantResponse { +public class SearchRestaurantData { private String contentId; @@ -14,7 +13,7 @@ public class SearchRestaurantResponse { private String treatMenu; - public SearchRestaurantResponse(String contentId, String restaurantName, String restaurantImage, String treatMenu) { + public SearchRestaurantData(String contentId, String restaurantName, String restaurantImage, String treatMenu) { this.contentId = contentId; this.restaurantName = restaurantName; this.restaurantImage = restaurantImage; diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java new file mode 100644 index 00000000..b6d84209 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java @@ -0,0 +1,21 @@ +package co.kr.jurumarble.comment.service.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.validation.constraints.NotBlank; + +@Getter +public class CreateCommentServiceRequest { + private Long parentId; + private String content; + + @Builder + public CreateCommentServiceRequest(Long parentId, String content) { + this.parentId = parentId; + this.content = content; + } +} diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/GetCommentServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/GetCommentServiceRequest.java new file mode 100644 index 00000000..9b0466d5 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/request/GetCommentServiceRequest.java @@ -0,0 +1,24 @@ +package co.kr.jurumarble.comment.service.request; + +import co.kr.jurumarble.comment.enums.SortType; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.validation.constraints.NotNull; + +@Getter +public class GetCommentServiceRequest { + private SortType sortBy; + private int page; + private int size; + + @Builder + public GetCommentServiceRequest(SortType sortBy, int page, int size) { + this.sortBy = sortBy; + this.page = page; + this.size = size; + } +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/UpdateCommentServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateCommentServiceRequest.java new file mode 100644 index 00000000..aaecbc9b --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateCommentServiceRequest.java @@ -0,0 +1,18 @@ +package co.kr.jurumarble.comment.service.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Getter +public class UpdateCommentServiceRequest { + private String content; + + @Builder + public UpdateCommentServiceRequest(String content) { + this.content = content; + } +} diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java new file mode 100644 index 00000000..f7c49b22 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java @@ -0,0 +1,17 @@ +package co.kr.jurumarble.comment.service.request; + +import lombok.*; + +@Getter +public class UpdateRestaurantServiceRequest { + private String restaurantName; + private String restaurantImage; + private String treatMenu; + + @Builder + public UpdateRestaurantServiceRequest(String restaurantName, String restaurantImage, String treatMenu) { + this.restaurantName = restaurantName; + this.restaurantImage = restaurantImage; + this.treatMenu = treatMenu; + } +} From 02b84776bc4c326450ff818accf658a0c740b630 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sun, 20 Aug 2023 23:47:46 +0900 Subject: [PATCH 35/76] =?UTF-8?q?refactor=20:=20CQRS=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../co/kr/jurumarble/comment/service/CommentService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index f1fa4058..ec566c65 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -33,7 +33,7 @@ @Service @RequiredArgsConstructor -@Transactional +@Transactional(readOnly = true) public class CommentService { private final UserRepository userRepository; private final VoteRepository voteRepository; @@ -41,6 +41,7 @@ public class CommentService { private final CommentEmotionRepository commentEmotionRepository; private final TourApiService tourApiService; + @Transactional(readOnly = false) public void createComment(Long voteId, Long userId, CreateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -63,7 +64,7 @@ public Slice getComments(Long voteId, GetCommentServiceRequest r } - + @Transactional(readOnly = false) public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -71,6 +72,7 @@ public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommen comment.updateContent(request); } + @Transactional(readOnly = false) public void deleteComment(Long voteId, Long commentId, Long userId) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -78,6 +80,7 @@ public void deleteComment(Long voteId, Long commentId, Long userId) { commentRepository.delete(comment); } + @Transactional(readOnly = false) public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emotion) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -85,6 +88,7 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti doEmote(emotion, user, comment); } + @Transactional(readOnly = false) public void addRestaurantToComment(Long voteId, Long commentId, Long userId, UpdateRestaurantServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); From 621aa016b788c8a695b87bd3c22bff64b64f47ab Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 21 Aug 2023 15:58:44 +0900 Subject: [PATCH 36/76] =?UTF-8?q?chore=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=97=86=EC=9D=B4=20=EB=B9=8C=EB=93=9C=20=ED=95=A0=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20workflow=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5ae88321..375c361b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,7 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x ./gradlew # gradlew 실행권한 부여 - name: Build with Gradle - run: ./gradlew clean build # build 하기 + run: ./gradlew clean build -x test # build 하기 # UTC가 기준이기 때문에 한국시간으로 맞추려면 +9시간 해야 한다. - name: Get current time From 4851d1feb71f3498b224e55e4b07a1d83912a220 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Mon, 21 Aug 2023 23:48:19 +0900 Subject: [PATCH 37/76] =?UTF-8?q?style=20:=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/dto/request/CreateCommentRequest.java | 2 +- .../co/kr/jurumarble/comment/dto/request/GetCommentRequest.java | 2 +- .../kr/jurumarble/comment/dto/request/UpdateCommentRequest.java | 2 +- .../jurumarble/comment/dto/request/UpdateRestaurantRequest.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java index a5d336f9..8b71f175 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/CreateCommentRequest.java @@ -23,7 +23,7 @@ public CreateCommentRequest(Long parentId, String content) { this.content = content; } - public CreateCommentServiceRequest toServiceRequest(){ + public CreateCommentServiceRequest toServiceRequest() { return CreateCommentServiceRequest.builder() .parentId(parentId) .content(content) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java index b2bd2554..b2794d06 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/GetCommentRequest.java @@ -34,7 +34,7 @@ public GetCommentRequest(SortType sortBy, int page, int size) { this.size = size; } - public GetCommentServiceRequest toServiceRequest(){ + public GetCommentServiceRequest toServiceRequest() { return GetCommentServiceRequest.builder() .sortBy(sortBy) .page(page) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java index f09b446d..9e697bda 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateCommentRequest.java @@ -21,7 +21,7 @@ public UpdateCommentRequest(String content) { this.content = content; } - public UpdateCommentServiceRequest toServiceRequest(){ + public UpdateCommentServiceRequest toServiceRequest() { return UpdateCommentServiceRequest.builder() .content(content) .build(); diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java index 43ef2d47..7ae3660a 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java @@ -18,7 +18,7 @@ public UpdateRestaurantRequest(String restaurantName, String restaurantImage, St this.treatMenu = treatMenu; } - public UpdateRestaurantServiceRequest toServiceRequest(){ + public UpdateRestaurantServiceRequest toServiceRequest() { return UpdateRestaurantServiceRequest.builder() .restaurantName(restaurantName) .restaurantImage(restaurantImage) From bedc29af9dd73c4214467f807c05b868692b64a4 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Tue, 22 Aug 2023 02:57:47 +0900 Subject: [PATCH 38/76] =?UTF-8?q?feat=20:=20=EB=8C=93=EA=B8=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95,=EC=82=AD=EC=A0=9C=EC=97=90=EC=84=9C=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=EA=B0=80=20=EC=9E=91=EC=84=B1=ED=95=9C=20=EB=8C=93?= =?UTF-8?q?=EA=B8=80=EC=9D=B8=EC=A7=80=20=EA=B2=80=EC=A6=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/CommentService.java | 19 ++++++++++++++----- .../kr/jurumarble/exception/StatusEnum.java | 3 ++- .../comment/CommentExceptionHandler.java | 6 ++++++ .../CommentNotBelongToUserException.java | 17 +++++++++++++++++ 4 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/exception/comment/CommentNotBelongToUserException.java diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index ec566c65..24288793 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -11,6 +11,7 @@ import co.kr.jurumarble.comment.service.request.GetCommentServiceRequest; import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; import co.kr.jurumarble.comment.service.request.UpdateRestaurantServiceRequest; +import co.kr.jurumarble.exception.comment.CommentNotBelongToUserException; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.comment.InvalidSortingMethodException; import co.kr.jurumarble.exception.comment.NestedCommentNotAllowedException; @@ -41,7 +42,7 @@ public class CommentService { private final CommentEmotionRepository commentEmotionRepository; private final TourApiService tourApiService; - @Transactional(readOnly = false) + @Transactional public void createComment(Long voteId, Long userId, CreateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -64,23 +65,26 @@ public Slice getComments(Long voteId, GetCommentServiceRequest r } - @Transactional(readOnly = false) + @Transactional public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + validateCommentBelongsToUser(comment, user); comment.updateContent(request); } - @Transactional(readOnly = false) + + @Transactional public void deleteComment(Long voteId, Long commentId, Long userId) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + validateCommentBelongsToUser(comment, user); commentRepository.delete(comment); } - @Transactional(readOnly = false) + @Transactional public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emotion) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -88,7 +92,7 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti doEmote(emotion, user, comment); } - @Transactional(readOnly = false) + @Transactional public void addRestaurantToComment(Long voteId, Long commentId, Long userId, UpdateRestaurantServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); @@ -121,6 +125,11 @@ public List getRestaurantImage(Long voteId, Long commentId, Long userId, } + private void validateCommentBelongsToUser(Comment comment, User user) { + if (!commentRepository.existsByCommentAndUser(comment, user)) { + throw new CommentNotBelongToUserException(); + } + } private Comment checkParentComment(CreateCommentServiceRequest request) { if (request.getParentId() == null) { diff --git a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java index 248a324d..8f1173e3 100644 --- a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java +++ b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java @@ -8,7 +8,8 @@ public enum StatusEnum { USER_NOT_FOUND(404, "USER_NOT_FOUND"), VOTE_NOT_FOUND(404, "VOTE_NOT_FOUND"), COMMENT_NOT_FOUND(404, "COMMENT_NOT_FOUND"), - NO_CONTENT(204,"NO_CONTENT"), + COMMENT_NOT_BELONG_TO_USER(400, "COMMENT_NOT_BELONG_TO_USER"), + NO_CONTENT(204, "NO_CONTENT"), COMMENT_EMOTION_NOT_FOUND(404, "COMMENT_EMOTION_NOT_FOUND"), ALREADY_VOTE_RESULT_EXIST(403, "ALREADY_VOTE_RESULT_EXIST"), TOKEN_NOT_EXIST(404, "TOKEN_NOT_EXIST"), diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java index c3c83b62..48e0b0c5 100644 --- a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java @@ -42,4 +42,10 @@ public ResponseEntity handle(NoDataFoundException e) { return ResponseEntity.status(e.getStatus().getStatusCode()) .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); } + + @ExceptionHandler(CommentNotBelongToUserException.class) + public ResponseEntity handle(CommentNotBelongToUserException e) { + return ResponseEntity.status(e.getStatus().getStatusCode()) + .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); + } } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentNotBelongToUserException.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentNotBelongToUserException.java new file mode 100644 index 00000000..6c947ceb --- /dev/null +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentNotBelongToUserException.java @@ -0,0 +1,17 @@ +package co.kr.jurumarble.exception.comment; + +import co.kr.jurumarble.exception.StatusEnum; +import lombok.Getter; + +@Getter +public class CommentNotBelongToUserException extends RuntimeException { + + private final StatusEnum status; + private static final String message = "본인이 작성한 댓글이 아닙니다."; + + public CommentNotBelongToUserException() { + super(message); + this.status = StatusEnum.COMMENT_NOT_BELONG_TO_USER; + } + +} From 2dc4ba06d0678881e883c697f4e38f84df58fdaf Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Tue, 22 Aug 2023 03:52:48 +0900 Subject: [PATCH 39/76] =?UTF-8?q?refactor=20:=20=EC=8B=9D=EB=8B=B9=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=EC=97=90=EC=84=9C=20=EC=A7=80=EC=97=AD=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EB=A5=BC=20=EB=B0=9B=EC=9D=84=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/tourApi/TourAreaBasedListResponse.java | 2 -- .../comment/controller/CommentController.java | 4 ++-- .../jurumarble/comment/service/CommentService.java | 14 ++++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java b/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java index 33f7cc9d..34889d7d 100644 --- a/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java +++ b/src/main/java/co/kr/jurumarble/client/tourApi/TourAreaBasedListResponse.java @@ -4,9 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; -import java.util.ArrayList; import java.util.List; -import java.util.Optional; import java.util.stream.Collectors; @Data diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index 3dcb2f49..88e4c75b 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -98,9 +98,9 @@ public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVar @Operation(summary = "음식점 검색", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 쿼리에 'keyword'(검색 키워드 - 선택)과 'page'(요청 페이지 인덱스)를 전달하여 음식점을 검색하는 기능입니다.") @GetMapping("/votes/{voteId}/comments/{commentId}/snack") - public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam int page) { + public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "areaCode", required = false) int areaCode, @RequestParam int page) { - List searchRestaurantRespons = commentService.searchRestaurant(voteId, commentId, userId, keyword, page); + List searchRestaurantRespons = commentService.searchRestaurant(voteId, commentId, userId, keyword, areaCode, page); return new ResponseEntity(searchRestaurantRespons, HttpStatus.OK); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 24288793..b85dc176 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -46,7 +46,7 @@ public class CommentService { public void createComment(Long voteId, Long userId, CreateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); - Comment parentComment = checkParentComment(request); // 부모댓글이 있는지 없는지 확인 + Comment parentComment = checkParentComment(request); checkNestedCommentAllowed(parentComment); Comment comment = new Comment(request, parentComment, user, voteId); @@ -101,14 +101,13 @@ public void addRestaurantToComment(Long voteId, Long commentId, Long userId, Upd } - public List searchRestaurant(Long voteId, Long commentId, Long userId, String keyword, int page) { + public List searchRestaurant(Long voteId, Long commentId, Long userId, String keyword, int areaCode, int page) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); //vote의 지역이 있으면 받아오고 없으면 선택받은 지역 - - List restaurantInfo = getRestaurantInfoList(keyword, page); + List restaurantInfo = getRestaurantInfoList(keyword, areaCode, page); return convertToSearchSnackResponseList(restaurantInfo); @@ -118,7 +117,6 @@ public List getRestaurantImage(Long voteId, Long commentId, Long userId, User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - List detailImages = tourApiService.getDetailImages(contentId); return detailImages; @@ -236,10 +234,10 @@ private void addEmotion(Emotion emotion, User user, Comment comment) { commentEmotionRepository.save(newEmotion); } - private List getRestaurantInfoList(String keyword, int page) { + private List getRestaurantInfoList(String keyword, int areaCode, int page) { return (keyword != null) - ? tourApiService.getRestaurantInfoByKeyWord(keyword, page, 1) - : tourApiService.getRestaurantInfo(1, page); + ? tourApiService.getRestaurantInfoByKeyWord(keyword, areaCode, page) + : tourApiService.getRestaurantInfo(areaCode, page); } private List convertToSearchSnackResponseList(List restaurantInfo) { From 10c8f3a08b9867c80740170448c82a85c6ef3419 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Tue, 22 Aug 2023 03:53:43 +0900 Subject: [PATCH 40/76] =?UTF-8?q?style=20:=20=EC=9D=8C=EC=8B=9D=EC=A0=90?= =?UTF-8?q?=20->=20=EC=8B=9D=EB=8B=B9=20api=20=EC=9A=94=EC=95=BD=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/controller/CommentController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index 88e4c75b..d139968d 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -87,7 +87,7 @@ public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long return new ResponseEntity(HttpStatus.OK); } - @Operation(summary = "음식점 추가", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 바디에 업데이트할 음식점 정보를 JSON 형식으로 전달하여 댓글에 추가하는 기능입니다.") + @Operation(summary = "식당 추가", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 바디에 업데이트할 음식점 정보를 JSON 형식으로 전달하여 댓글에 추가하는 기능입니다.") @PatchMapping("/votes/{voteId}/comments/{commentId}/snack") public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateRestaurantRequest updateRestaurantRequest) { @@ -96,7 +96,7 @@ public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVar return new ResponseEntity(HttpStatus.OK); } - @Operation(summary = "음식점 검색", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 쿼리에 'keyword'(검색 키워드 - 선택)과 'page'(요청 페이지 인덱스)를 전달하여 음식점을 검색하는 기능입니다.") + @Operation(summary = "식당 검색", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 쿼리에 'keyword'(검색 키워드 - 선택)과 'page'(요청 페이지 인덱스)를 전달하여 음식점을 검색하는 기능입니다.") @GetMapping("/votes/{voteId}/comments/{commentId}/snack") public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "areaCode", required = false) int areaCode, @RequestParam int page) { @@ -105,7 +105,7 @@ public ResponseEntity> searchRestaurant(@PathVariable return new ResponseEntity(searchRestaurantRespons, HttpStatus.OK); } - @Operation(summary = "음식점 이미지 조회", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId', 'commentId'와 'contentId'를 전달하여 특정 음식점의 이미지를 가져오는 기능입니다.") + @Operation(summary = "식당 이미지 조회", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId', 'commentId'와 'contentId'를 전달하여 특정 음식점의 이미지를 가져오는 기능입니다.") @GetMapping("/votes/{voteId}/comments/{commentId}/snack/{contentId}") public ResponseEntity> getRestaurantImage(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @PathVariable String contentId) { From 0ace2bdf11ca7c1e6ff4b0f854f70f63af04eb3d Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Tue, 22 Aug 2023 04:32:42 +0900 Subject: [PATCH 41/76] =?UTF-8?q?fix=20:=20=EA=B0=92=ED=83=80=EC=9E=85?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=8B=9D=EB=8B=B9=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=EA=B0=80=20=EC=95=88=EB=90=98=EB=8A=94=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/domain/Comment.java | 14 +++----------- .../jurumarble/comment/domain/Restaurant.java | 17 +++++++---------- .../comment/repository/CommentRepository.java | 5 +---- .../comment/service/CommentService.java | 3 ++- .../request/UpdateRestaurantServiceRequest.java | 2 -- 5 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index d7da5daa..3758c614 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -68,7 +68,6 @@ public class Comment extends BaseTimeEntity { @AttributeOverrides({ @AttributeOverride(name = "restaurantName", column = @Column(name = "restaurant_image")), @AttributeOverride(name = "restaurantImage", column = @Column(name = "restaurant_name")), - @AttributeOverride(name = "treatMenu", column = @Column(name = "treat_menu")) }) private Restaurant restaurant; @@ -114,16 +113,9 @@ public void removeEmotion(CommentEmotion commentEmotion) { public void updateRestaurant(UpdateRestaurantServiceRequest request) { - if (request.getRestaurantName() != null && !request.getRestaurantName().isEmpty()) { - this.restaurant.updateRestaurantName(request.getRestaurantName()); - } - - if (request.getRestaurantImage() != null && !request.getRestaurantImage().isEmpty()) { - this.restaurant.updateRestaurantImage(request.getRestaurantImage()); - } - - if (request.getTreatMenu() != null && !request.getTreatMenu().isEmpty()) { - this.restaurant.updateTreatMenu(request.getTreatMenu()); + if (restaurant == null) { + restaurant = new Restaurant(); } + restaurant.updateRestaurant(request.getRestaurantName(), request.getRestaurantImage()); } } diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java index ed75a33a..72bea553 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Restaurant.java @@ -13,18 +13,15 @@ public class Restaurant { private String restaurantImage; - private String treatMenu; - public void updateRestaurantImage(String restaurantImage) { - this.restaurantImage = restaurantImage; + public void updateRestaurant(String restaurantName, String restaurantImage) { + if (restaurantName != null) { + this.restaurantName = restaurantName; + } + if (restaurantImage != null) { + this.restaurantImage = restaurantImage; + } } - public void updateTreatMenu(String treatMenu) { - this.treatMenu = treatMenu; - } - - public void updateRestaurantName(String restaurantName) { - this.restaurantName = restaurantName; - } } diff --git a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java index a05c099b..b3292b2a 100644 --- a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java +++ b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java @@ -9,7 +9,6 @@ import org.springframework.stereotype.Repository; import java.util.List; -import java.util.Optional; @Repository public interface CommentRepository extends JpaRepository { @@ -24,7 +23,5 @@ public interface CommentRepository extends JpaRepository { int countByVoteIdAndParentIsNull(Long voteId); List findByParent(Comment parent); - - @Query("SELECT COUNT(c) > 0 FROM Comment c WHERE c.id = :commentId AND c.user = :user") - boolean existsByCommentAndUser(Comment comment, User user); + boolean existsByIdAndUser(Long commentId, User user); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index b85dc176..926d688b 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -97,6 +97,7 @@ public void addRestaurantToComment(Long voteId, Long commentId, Long userId, Upd User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); + validateCommentBelongsToUser(comment, user); comment.updateRestaurant(request); } @@ -124,7 +125,7 @@ public List getRestaurantImage(Long voteId, Long commentId, Long userId, } private void validateCommentBelongsToUser(Comment comment, User user) { - if (!commentRepository.existsByCommentAndUser(comment, user)) { + if (!commentRepository.existsByIdAndUser(comment.getId(), user)) { throw new CommentNotBelongToUserException(); } } diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java index f7c49b22..1cd5b137 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java @@ -6,12 +6,10 @@ public class UpdateRestaurantServiceRequest { private String restaurantName; private String restaurantImage; - private String treatMenu; @Builder public UpdateRestaurantServiceRequest(String restaurantName, String restaurantImage, String treatMenu) { this.restaurantName = restaurantName; this.restaurantImage = restaurantImage; - this.treatMenu = treatMenu; } } From 61bdb7df1c11559b62a960ba2bae2af799065b88 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 24 Aug 2023 21:43:56 +0900 Subject: [PATCH 42/76] =?UTF-8?q?refactor:=20CommentEmoteManager=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=B1=85=EC=9E=84=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/CommentEmoteManager.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/comment/service/CommentEmoteManager.java diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentEmoteManager.java b/src/main/java/co/kr/jurumarble/comment/service/CommentEmoteManager.java new file mode 100644 index 00000000..534c9ae4 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentEmoteManager.java @@ -0,0 +1,56 @@ +package co.kr.jurumarble.comment.service; + +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.domain.CommentEmotion; +import co.kr.jurumarble.comment.enums.Emotion; +import co.kr.jurumarble.comment.repository.CommentEmotionRepository; +import co.kr.jurumarble.user.domain.User; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.util.Optional; + +@Component +@RequiredArgsConstructor +public class CommentEmoteManager { + private final CommentEmotionRepository commentEmotionRepository; + + public void doEmote(Emotion emotion, User user, Comment comment) { + Optional byCommentAndUser = commentEmotionRepository.findByCommentAndUser(comment, user); + + byCommentAndUser.ifPresentOrElse( + commentEmotion -> { + if (emotion == commentEmotion.getEmotion()) { + //좋아요(싫어요)를 기존에 눌렀는데 또 눌렀을 경우 좋아요(싫어요) 취소 + cancelEmotion(commentEmotion, comment); + } else { + //싫어요(좋아요)를 기존에 누른 상태로 좋아요(싫어요)를 누른 경우 싫어요(좋아요) 취소 후 좋아요(싫어요)로 등록 + changeEmotion(commentEmotion, emotion, user, comment); + } + }, + // 좋아요(싫어요)가 없을 경우 좋아요(싫어요) 추가 + () -> addEmotion(emotion, user, comment)); + } + + + private void cancelEmotion(CommentEmotion commentEmotion, Comment comment) { + commentEmotionRepository.delete(commentEmotion); + comment.removeEmotion(commentEmotion); + comment.updateLikeHateCount(); + } + + private void changeEmotion(CommentEmotion existingEmotion, Emotion newEmotion, User user, Comment comment) { + commentEmotionRepository.delete(existingEmotion); + comment.removeEmotion(existingEmotion); + addEmotion(newEmotion, user, comment); + } + + private void addEmotion(Emotion emotion, User user, Comment comment) { + CommentEmotion newEmotion = new CommentEmotion(); + newEmotion.setEmote(emotion); + newEmotion.mappingComment(comment); + newEmotion.mappingUser(user); + comment.updateLikeHateCount(); + commentEmotionRepository.save(newEmotion); + } +} From 956d7719d0bd5c450679378847a36cec55b50a1e Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 24 Aug 2023 21:44:13 +0900 Subject: [PATCH 43/76] =?UTF-8?q?refactor:=20CommentValidator=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=20=EC=B1=85=EC=9E=84=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/CommentValidator.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java b/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java new file mode 100644 index 00000000..ef029b38 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java @@ -0,0 +1,41 @@ +package co.kr.jurumarble.comment.service; + +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.repository.CommentRepository; +import co.kr.jurumarble.comment.service.request.CreateCommentServiceRequest; +import co.kr.jurumarble.exception.comment.CommentNotBelongToUserException; +import co.kr.jurumarble.exception.comment.CommentNotFoundException; +import co.kr.jurumarble.exception.comment.NestedCommentNotAllowedException; +import co.kr.jurumarble.user.domain.User; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class CommentValidator { + + private final CommentRepository commentRepository; + + public void validateCommentBelongsToUser(Comment comment, User user) { + if (!commentRepository.existsByIdAndUser(comment.getId(), user)) { + throw new CommentNotBelongToUserException(); + } + } + + public Comment checkParentComment(CreateCommentServiceRequest request) { + if (request.getParentId() == null) { + return null; + } + return commentRepository.findById(request.getParentId()) + .orElseThrow(() -> new CommentNotFoundException()); + } + + public void checkNestedCommentAllowed(Comment parentComment) { + if (parentComment != null && parentComment.getParent() != null) { + throw new NestedCommentNotAllowedException(); + } + } + + + +} From 5b7e95e93cd27fb65bac8ab046b432b62b865f14 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 24 Aug 2023 21:44:24 +0900 Subject: [PATCH 44/76] =?UTF-8?q?refactor:=20TourApiDataManager=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=B1=85=EC=9E=84=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/TourApiDataManager.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/comment/service/TourApiDataManager.java diff --git a/src/main/java/co/kr/jurumarble/comment/service/TourApiDataManager.java b/src/main/java/co/kr/jurumarble/comment/service/TourApiDataManager.java new file mode 100644 index 00000000..02bda924 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/comment/service/TourApiDataManager.java @@ -0,0 +1,40 @@ +package co.kr.jurumarble.comment.service; + +import co.kr.jurumarble.client.tourApi.RestaurantInfoDto; +import co.kr.jurumarble.client.tourApi.TourApiService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.stream.Collectors; + +@Component +@RequiredArgsConstructor +public class TourApiDataManager { + + private final TourApiService tourApiService; + + + public List getRestaurantInfoList(String keyword, int areaCode, int page) { + return (keyword != null) + ? tourApiService.getRestaurantInfoByKeyWord(keyword, areaCode, page) + : tourApiService.getRestaurantInfo(areaCode, page); + } + + public List convertToSearchRestaurantDataList(List restaurantInfo) { + return restaurantInfo.stream() + .map(restaurant -> new SearchRestaurantData( + restaurant.getContentId(), + restaurant.getTitle(), + restaurant.getFirstImage(), + tourApiService.getTreatMenu(restaurant.getContentId()) + )) + .collect(Collectors.toList()); + } + + public List fetchDetailImages(String contentId) { + List detailImages = tourApiService.getDetailImages(contentId); + return detailImages; + } + +} From 70e878647244ca8f39d5bb2afa451bd13cd50c18 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 24 Aug 2023 21:44:51 +0900 Subject: [PATCH 45/76] =?UTF-8?q?refactor:=20=EC=99=B8=EB=B6=80=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B1=85=EC=9E=84=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/CommentService.java | 113 +++--------------- 1 file changed, 16 insertions(+), 97 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 926d688b..811046ca 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -1,20 +1,15 @@ package co.kr.jurumarble.comment.service; import co.kr.jurumarble.client.tourApi.RestaurantInfoDto; -import co.kr.jurumarble.client.tourApi.TourApiService; import co.kr.jurumarble.comment.domain.Comment; -import co.kr.jurumarble.comment.domain.CommentEmotion; import co.kr.jurumarble.comment.enums.Emotion; -import co.kr.jurumarble.comment.repository.CommentEmotionRepository; import co.kr.jurumarble.comment.repository.CommentRepository; import co.kr.jurumarble.comment.service.request.CreateCommentServiceRequest; import co.kr.jurumarble.comment.service.request.GetCommentServiceRequest; import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; import co.kr.jurumarble.comment.service.request.UpdateRestaurantServiceRequest; -import co.kr.jurumarble.exception.comment.CommentNotBelongToUserException; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.comment.InvalidSortingMethodException; -import co.kr.jurumarble.exception.comment.NestedCommentNotAllowedException; import co.kr.jurumarble.exception.user.UserNotFoundException; import co.kr.jurumarble.exception.vote.VoteNotFoundException; import co.kr.jurumarble.user.domain.User; @@ -29,8 +24,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.*; -import java.util.stream.Collectors; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @Service @RequiredArgsConstructor @@ -39,15 +36,16 @@ public class CommentService { private final UserRepository userRepository; private final VoteRepository voteRepository; private final CommentRepository commentRepository; - private final CommentEmotionRepository commentEmotionRepository; - private final TourApiService tourApiService; + private final CommentEmoteManager commentEmoteManager; + private final TourApiDataManager tourApiDataManager; + private final CommentValidator commentValidator; @Transactional public void createComment(Long voteId, Long userId, CreateCommentServiceRequest request) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); - Comment parentComment = checkParentComment(request); - checkNestedCommentAllowed(parentComment); + Comment parentComment = commentValidator.checkParentComment(request); + commentValidator.checkNestedCommentAllowed(parentComment); Comment comment = new Comment(request, parentComment, user, voteId); commentRepository.save(comment); @@ -70,7 +68,7 @@ public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommen User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - validateCommentBelongsToUser(comment, user); + commentValidator.validateCommentBelongsToUser(comment, user); comment.updateContent(request); } @@ -80,7 +78,7 @@ public void deleteComment(Long voteId, Long commentId, Long userId) { User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - validateCommentBelongsToUser(comment, user); + commentValidator.validateCommentBelongsToUser(comment, user); commentRepository.delete(comment); } @@ -89,7 +87,7 @@ public void emoteComment(Long voteId, Long commentId, Long userId, Emotion emoti User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - doEmote(emotion, user, comment); + commentEmoteManager.doEmote(emotion, user, comment); } @Transactional @@ -97,7 +95,7 @@ public void addRestaurantToComment(Long voteId, Long commentId, Long userId, Upd User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - validateCommentBelongsToUser(comment, user); + commentValidator.validateCommentBelongsToUser(comment, user); comment.updateRestaurant(request); } @@ -106,11 +104,10 @@ public List searchRestaurant(Long voteId, Long commentId, User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - //vote의 지역이 있으면 받아오고 없으면 선택받은 지역 - List restaurantInfo = getRestaurantInfoList(keyword, areaCode, page); + List restaurantInfo = tourApiDataManager.getRestaurantInfoList(keyword, areaCode, page); - return convertToSearchSnackResponseList(restaurantInfo); + return tourApiDataManager.convertToSearchRestaurantDataList(restaurantInfo); } @@ -118,32 +115,12 @@ public List getRestaurantImage(Long voteId, Long commentId, Long userId, User user = userRepository.findById(userId).orElseThrow(UserNotFoundException::new); Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); - List detailImages = tourApiService.getDetailImages(contentId); + List detailImages = tourApiDataManager.fetchDetailImages(contentId); return detailImages; } - private void validateCommentBelongsToUser(Comment comment, User user) { - if (!commentRepository.existsByIdAndUser(comment.getId(), user)) { - throw new CommentNotBelongToUserException(); - } - } - - private Comment checkParentComment(CreateCommentServiceRequest request) { - if (request.getParentId() == null) { - return null; - } - return commentRepository.findById(request.getParentId()) - .orElseThrow(() -> new CommentNotFoundException()); - } - - private void checkNestedCommentAllowed(Comment parentComment) { - if (parentComment != null && parentComment.getParent() != null) { - throw new NestedCommentNotAllowedException(); - } - } - private List findCommentsBySortType(Long voteId, GetCommentServiceRequest request, Pageable pageable) { List comments; switch (request.getSortBy()) { @@ -195,63 +172,5 @@ private Slice convertToSlice(Long voteId, GetCommentServiceReque return slice; } - - private void doEmote(Emotion emotion, User user, Comment comment) { - Optional byCommentAndUser = commentEmotionRepository.findByCommentAndUser(comment, user); - - byCommentAndUser.ifPresentOrElse( - commentEmotion -> { - if (emotion == commentEmotion.getEmotion()) { - //좋아요(싫어요)를 기존에 눌렀는데 또 눌렀을 경우 좋아요(싫어요) 취소 - cancelEmotion(commentEmotion, comment); - } else { - //싫어요(좋아요)를 기존에 누른 상태로 좋아요(싫어요)를 누른 경우 싫어요(좋아요) 취소 후 좋아요(싫어요)로 등록 - changeEmotion(commentEmotion, emotion, user, comment); - } - }, - // 좋아요(싫어요)가 없을 경우 좋아요(싫어요) 추가 - () -> addEmotion(emotion, user, comment)); - } - - - private void cancelEmotion(CommentEmotion commentEmotion, Comment comment) { - commentEmotionRepository.delete(commentEmotion); - comment.removeEmotion(commentEmotion); - comment.updateLikeHateCount(); - } - - private void changeEmotion(CommentEmotion existingEmotion, Emotion newEmotion, User user, Comment comment) { - commentEmotionRepository.delete(existingEmotion); - comment.removeEmotion(existingEmotion); - addEmotion(newEmotion, user, comment); - } - - private void addEmotion(Emotion emotion, User user, Comment comment) { - CommentEmotion newEmotion = new CommentEmotion(); - newEmotion.setEmote(emotion); - newEmotion.mappingComment(comment); - newEmotion.mappingUser(user); - comment.updateLikeHateCount(); - commentEmotionRepository.save(newEmotion); - } - - private List getRestaurantInfoList(String keyword, int areaCode, int page) { - return (keyword != null) - ? tourApiService.getRestaurantInfoByKeyWord(keyword, areaCode, page) - : tourApiService.getRestaurantInfo(areaCode, page); - } - - private List convertToSearchSnackResponseList(List restaurantInfo) { - return restaurantInfo.stream() - .map(restaurant -> new SearchRestaurantData( - restaurant.getContentId(), - restaurant.getTitle(), - restaurant.getFirstImage(), - tourApiService.getTreatMenu(restaurant.getContentId()) - )) - .collect(Collectors.toList()); - } - - } From ddca3f332eb38f82890cd2edc3f8a05d80374546 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 24 Aug 2023 21:45:16 +0900 Subject: [PATCH 46/76] =?UTF-8?q?style=20:=20Swagger=20description=20=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../co/kr/jurumarble/comment/controller/CommentController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index d139968d..2370185d 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -39,7 +39,7 @@ public ResponseEntity createComment(@PathVariable Long voteId, @RequestAttribute } - @Operation(summary = "댓글 조회", description = "헤더에 토큰(`Authorization`)을 포함하고, URL 파라미터에 'voteId'를, 요청 쿼리에 'age'(연령 필터 - 선택), 'mbti'(MBTI 필터 - 선택), 'gender'(성별 필터 - 선택), 'sortBy'(정렬 기준 - ByTime, ByPopularity), 'page'(페이지 번호)와 'size'(페이지 내의 데이터 수)를 JSON 형식으로 보내 주십시오.") + @Operation(summary = "댓글 조회", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'를, 요청 쿼리에 'age'(연령 필터 - 선택), 'mbti'(MBTI 필터 - 선택), 'gender'(성별 필터 - 선택), 'sortBy'(정렬 기준 - ByTime, ByPopularity), 'page'(페이지 번호)와 'size'(페이지 내의 데이터 수)를 JSON 형식으로 보내 주십시오.") @GetMapping("/votes/{voteId}/comments") public ResponseEntity> getComment(@PathVariable Long voteId, @ModelAttribute GetCommentRequest getCommentRequest) { From 8d1b7febec6b1cce2bda75545d71cc134c74d2da Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 24 Aug 2023 23:13:45 +0900 Subject: [PATCH 47/76] =?UTF-8?q?fix=20:=20=EB=8C=93=EA=B8=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=97=90=20treatMenu=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/dto/request/UpdateRestaurantRequest.java | 5 +---- .../service/request/UpdateRestaurantServiceRequest.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java index 7ae3660a..b6b6904f 100644 --- a/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/dto/request/UpdateRestaurantRequest.java @@ -9,20 +9,17 @@ public class UpdateRestaurantRequest { private String restaurantName; private String restaurantImage; - private String treatMenu; @Builder - public UpdateRestaurantRequest(String restaurantName, String restaurantImage, String treatMenu) { + public UpdateRestaurantRequest(String restaurantName, String restaurantImage) { this.restaurantName = restaurantName; this.restaurantImage = restaurantImage; - this.treatMenu = treatMenu; } public UpdateRestaurantServiceRequest toServiceRequest() { return UpdateRestaurantServiceRequest.builder() .restaurantName(restaurantName) .restaurantImage(restaurantImage) - .treatMenu(treatMenu) .build(); } } diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java index 1cd5b137..aaee01db 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/service/request/UpdateRestaurantServiceRequest.java @@ -8,7 +8,7 @@ public class UpdateRestaurantServiceRequest { private String restaurantImage; @Builder - public UpdateRestaurantServiceRequest(String restaurantName, String restaurantImage, String treatMenu) { + public UpdateRestaurantServiceRequest(String restaurantName, String restaurantImage) { this.restaurantName = restaurantName; this.restaurantImage = restaurantImage; } From ec528f2f149d3a89f983335d37712248f68cb618 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 03:21:10 +0900 Subject: [PATCH 48/76] =?UTF-8?q?refactor=20:=20Comment=20=EB=B9=8C?= =?UTF-8?q?=EB=8D=94=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20Comment=20?= =?UTF-8?q?=EB=8F=84=EB=A9=94=EC=9D=B8=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/domain/Comment.java | 30 +++++++++---------- .../comment/service/CommentService.java | 4 +-- .../request/CreateCommentServiceRequest.java | 15 ++++++++++ 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index 3758c614..b556d548 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -1,8 +1,6 @@ package co.kr.jurumarble.comment.domain; import co.kr.jurumarble.comment.enums.Emotion; -import co.kr.jurumarble.comment.service.request.CreateCommentServiceRequest; -import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; import co.kr.jurumarble.comment.service.request.UpdateRestaurantServiceRequest; import co.kr.jurumarble.common.domain.BaseTimeEntity; import co.kr.jurumarble.user.domain.User; @@ -10,6 +8,7 @@ import co.kr.jurumarble.user.enums.GenderType; import co.kr.jurumarble.user.enums.MbtiType; import lombok.AccessLevel; +import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @@ -22,6 +21,8 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) public class Comment extends BaseTimeEntity { + private static final int INITIAL_COUNT = 0; + @Id @GeneratedValue @Column @@ -49,10 +50,10 @@ public class Comment extends BaseTimeEntity { private GenderType gender; @Column - private Integer likeCount; + private Integer likeCount = INITIAL_COUNT; @Column - private Integer hateCount; + private Integer hateCount = INITIAL_COUNT; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "PARENT_ID") @@ -69,20 +70,17 @@ public class Comment extends BaseTimeEntity { @AttributeOverride(name = "restaurantName", column = @Column(name = "restaurant_image")), @AttributeOverride(name = "restaurantImage", column = @Column(name = "restaurant_name")), }) - private Restaurant restaurant; - + private Restaurant restaurant = new Restaurant(); - public Comment(CreateCommentServiceRequest request, Comment parent, User user, Long voteId) { + @Builder + public Comment(User user, Long voteId, String content, AgeType age, MbtiType mbti, GenderType gender,Comment parent) { this.user = user; this.voteId = voteId; - this.content = request.getContent(); - this.age = user.classifyAge(user.getAge()); - this.mbti = user.getMbti(); - this.gender = user.getGender(); + this.content = content; + this.age = age; + this.mbti = mbti; + this.gender = gender; this.parent = parent; - this.likeCount = 0; - this.hateCount = 0; - this.restaurant = new Restaurant(); } public void updateParent(Comment parent) { @@ -103,8 +101,8 @@ public void updateLikeHateCount() { .count(); } - public void updateContent(UpdateCommentServiceRequest updateCommentRequest) { - this.content = updateCommentRequest.getContent(); + public void updateContent(String content) { + this.content = content; } public void removeEmotion(CommentEmotion commentEmotion) { diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 811046ca..8a404c5d 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -46,7 +46,7 @@ public void createComment(Long voteId, Long userId, CreateCommentServiceRequest Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = commentValidator.checkParentComment(request); commentValidator.checkNestedCommentAllowed(parentComment); - Comment comment = new Comment(request, parentComment, user, voteId); + Comment comment = request.toComment(parentComment, user, voteId); commentRepository.save(comment); @@ -69,7 +69,7 @@ public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommen Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); commentValidator.validateCommentBelongsToUser(comment, user); - comment.updateContent(request); + comment.updateContent(request.getContent()); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java index b6d84209..18092469 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java @@ -1,5 +1,7 @@ package co.kr.jurumarble.comment.service.request; +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.user.domain.User; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Getter; @@ -18,4 +20,17 @@ public CreateCommentServiceRequest(Long parentId, String content) { this.parentId = parentId; this.content = content; } + + + public Comment toComment(Comment parentComment, User user, Long voteId) { + return Comment.builder() + .user(user) + .voteId(voteId) + .content(content) + .age(user.classifyAge(user.getAge())) + .mbti(user.getMbti()) + .gender(user.getGender()) + .parent(parentComment) + .build(); + } } From ffdc7d8278af97733b82de8c4eeb974028eaf42a Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 03:21:49 +0900 Subject: [PATCH 49/76] =?UTF-8?q?test=20:=20CreateComment,=20UpdateComment?= =?UTF-8?q?=20test=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/CommentServiceTest.java | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java diff --git a/src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java b/src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java new file mode 100644 index 00000000..4dbb1fb3 --- /dev/null +++ b/src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java @@ -0,0 +1,110 @@ +package co.kr.jurumarble.comment.service; + +import co.kr.jurumarble.comment.domain.Comment; +import co.kr.jurumarble.comment.repository.CommentRepository; +import co.kr.jurumarble.comment.service.request.CreateCommentServiceRequest; +import co.kr.jurumarble.comment.service.request.UpdateCommentServiceRequest; +import co.kr.jurumarble.user.domain.User; +import co.kr.jurumarble.user.repository.UserRepository; +import co.kr.jurumarble.vote.domain.Vote; +import co.kr.jurumarble.vote.repository.VoteRepository; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +class CommentServiceTest { + + @InjectMocks + private CommentService commentService; + + @Mock + private UserRepository userRepository; + @Mock + private VoteRepository voteRepository; + @Mock + private CommentRepository commentRepository; + @Mock + private CommentValidator commentValidator; + + @DisplayName("댓글을 생성한다.") + @Test + void createComment() { + // given + Long userId = 1L; + Long voteId = 1L; + + User user = User.builder() + .age(30) + .build(); + + Vote vote = new Vote(); + + CreateCommentServiceRequest request = CreateCommentServiceRequest.builder() + .content("댓글 내용") + .parentId(null) + .build(); + + Comment parentComment = null; + Comment comment = new Comment(request, parentComment, user, voteId); + + when(userRepository.findById(userId)).thenReturn(Optional.of(user)); + when(voteRepository.findById(voteId)).thenReturn(Optional.of(vote)); + when(commentValidator.checkParentComment(request)).thenReturn(parentComment); + doNothing().when(commentValidator).checkNestedCommentAllowed(parentComment); + + // when + commentService.createComment(voteId, userId, request); + + // then + verify(userRepository, times(1)).findById(userId); + verify(voteRepository, times(1)).findById(voteId); + verify(commentValidator, times(1)).checkParentComment(request); + verify(commentValidator, times(1)).checkNestedCommentAllowed(parentComment); + verify(commentRepository, times(1)).save(any(Comment.class)); + } + + + @DisplayName("댓글을 업데이트한다.") + @Test + void updateComment() { + // given + Long userId = 1L; + Long voteId = 1L; + Long commentId = 1L; + + User user = User.builder() + .build(); + + Vote vote = new Vote(); + + Comment comment = new Comment(); + + UpdateCommentServiceRequest request = UpdateCommentServiceRequest.builder() + .content("변경된 댓글 내용") + .build(); + + when(userRepository.findById(userId)).thenReturn(Optional.of(user)); + when(voteRepository.findById(voteId)).thenReturn(Optional.of(vote)); + when(commentRepository.findById(commentId)).thenReturn(Optional.of(comment)); + doNothing().when(commentValidator).validateCommentBelongsToUser(comment, user); + + // when + commentService.updateComment(voteId, commentId, userId, request); + + // then + verify(userRepository, times(1)).findById(userId); + verify(voteRepository, times(1)).findById(voteId); + verify(commentRepository, times(1)).findById(commentId); + verify(commentValidator, times(1)).validateCommentBelongsToUser(comment, user); + assertEquals(comment.getContent(), request.getContent()); + } +} \ No newline at end of file From 51597282c48cb300a10d77adad1bb67bd9de4169 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 03:23:38 +0900 Subject: [PATCH 50/76] =?UTF-8?q?test=20:=20CreateComment,=20UpdateComment?= =?UTF-8?q?=20test=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/CommentServiceTest.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java b/src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java index 4dbb1fb3..444fe2f8 100644 --- a/src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java +++ b/src/test/java/co/kr/jurumarble/comment/service/CommentServiceTest.java @@ -42,19 +42,14 @@ void createComment() { Long userId = 1L; Long voteId = 1L; - User user = User.builder() - .age(30) - .build(); + User user = User.builder().age(30).build(); Vote vote = new Vote(); - CreateCommentServiceRequest request = CreateCommentServiceRequest.builder() - .content("댓글 내용") - .parentId(null) - .build(); + CreateCommentServiceRequest request = CreateCommentServiceRequest.builder().content("댓글 내용").parentId(null).build(); Comment parentComment = null; - Comment comment = new Comment(request, parentComment, user, voteId); + Comment comment = request.toComment(parentComment,user,voteId); when(userRepository.findById(userId)).thenReturn(Optional.of(user)); when(voteRepository.findById(voteId)).thenReturn(Optional.of(vote)); @@ -81,16 +76,13 @@ void updateComment() { Long voteId = 1L; Long commentId = 1L; - User user = User.builder() - .build(); + User user = User.builder().build(); Vote vote = new Vote(); - Comment comment = new Comment(); + Comment comment = Comment.builder().build(); - UpdateCommentServiceRequest request = UpdateCommentServiceRequest.builder() - .content("변경된 댓글 내용") - .build(); + UpdateCommentServiceRequest request = UpdateCommentServiceRequest.builder().content("변경된 댓글 내용").build(); when(userRepository.findById(userId)).thenReturn(Optional.of(user)); when(voteRepository.findById(voteId)).thenReturn(Optional.of(vote)); From 236c8dcb57b809f80dc2d6774fd38cddad2277b0 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 03:44:51 +0900 Subject: [PATCH 51/76] =?UTF-8?q?style=20:=20=EC=8B=9D=EB=8B=B9=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EC=97=94=EB=93=9C=ED=8F=AC=EC=9D=B8?= =?UTF-8?q?=ED=8A=B8=20snack=20->=20restaurant=20=EB=A1=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/controller/CommentController.java | 6 +++--- src/main/java/co/kr/jurumarble/config/WebConfig.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java index 2370185d..9a006dc0 100644 --- a/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java +++ b/src/main/java/co/kr/jurumarble/comment/controller/CommentController.java @@ -88,7 +88,7 @@ public ResponseEntity hateComment(@PathVariable Long voteId, @PathVariable Long } @Operation(summary = "식당 추가", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 바디에 업데이트할 음식점 정보를 JSON 형식으로 전달하여 댓글에 추가하는 기능입니다.") - @PatchMapping("/votes/{voteId}/comments/{commentId}/snack") + @PatchMapping("/votes/{voteId}/comments/{commentId}/restaurant") public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestBody UpdateRestaurantRequest updateRestaurantRequest) { commentService.addRestaurantToComment(voteId, commentId, userId, updateRestaurantRequest.toServiceRequest()); @@ -97,7 +97,7 @@ public ResponseEntity addRestaurantToComment(@PathVariable Long voteId, @PathVar } @Operation(summary = "식당 검색", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId'와 'commentId'를 전달하며, 요청 쿼리에 'keyword'(검색 키워드 - 선택)과 'page'(요청 페이지 인덱스)를 전달하여 음식점을 검색하는 기능입니다.") - @GetMapping("/votes/{voteId}/comments/{commentId}/snack") + @GetMapping("/votes/{voteId}/comments/{commentId}/restaurant") public ResponseEntity> searchRestaurant(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "areaCode", required = false) int areaCode, @RequestParam int page) { List searchRestaurantRespons = commentService.searchRestaurant(voteId, commentId, userId, keyword, areaCode, page); @@ -106,7 +106,7 @@ public ResponseEntity> searchRestaurant(@PathVariable } @Operation(summary = "식당 이미지 조회", description = "헤더에 토큰을 포함하고, URL 파라미터에 'voteId', 'commentId'와 'contentId'를 전달하여 특정 음식점의 이미지를 가져오는 기능입니다.") - @GetMapping("/votes/{voteId}/comments/{commentId}/snack/{contentId}") + @GetMapping("/votes/{voteId}/comments/{commentId}/restaurant/{contentId}") public ResponseEntity> getRestaurantImage(@PathVariable Long voteId, @PathVariable Long commentId, @RequestAttribute Long userId, @PathVariable String contentId) { List restaurantImage = commentService.getRestaurantImage(voteId, commentId, userId, contentId); diff --git a/src/main/java/co/kr/jurumarble/config/WebConfig.java b/src/main/java/co/kr/jurumarble/config/WebConfig.java index b30ed061..6e9d8170 100644 --- a/src/main/java/co/kr/jurumarble/config/WebConfig.java +++ b/src/main/java/co/kr/jurumarble/config/WebConfig.java @@ -31,8 +31,8 @@ public void addInterceptors(InterceptorRegistry registry) { .addPathPatterns("/api/votes/{voteId}/comments/{commentId}") .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/likers") .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/haters") - .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/snack") - .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/snack/{contentId}"); + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/restaurant") + .addPathPatterns("/api/votes/{voteId}/comments/{commentId}/restaurant/{contentId}"); } @Override From f3b411baa9be52127c3518ec3de12219c0fd533c Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 04:34:40 +0900 Subject: [PATCH 52/76] =?UTF-8?q?fix=20:=20=EB=8B=A4=EB=A5=B8=20Vote?= =?UTF-8?q?=EC=97=90=20=EC=86=8D=ED=95=9C=20=EB=B6=80=EB=AA=A8=20=EB=8C=93?= =?UTF-8?q?=EA=B8=80=EC=9D=98=20=EB=8C=80=EB=8C=93=EA=B8=80=EC=9D=84=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8A=94=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/domain/Comment.java | 2 +- .../comment/repository/CommentRepository.java | 1 + .../comment/service/CommentService.java | 1 + .../comment/service/CommentValidator.java | 9 +++++++++ .../co/kr/jurumarble/exception/StatusEnum.java | 1 + .../comment/CommentExceptionHandler.java | 6 ++++++ .../ParentCommentNotBelongToVoteException.java | 17 +++++++++++++++++ 7 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/main/java/co/kr/jurumarble/exception/comment/ParentCommentNotBelongToVoteException.java diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index b556d548..f92c6f5c 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -62,7 +62,7 @@ public class Comment extends BaseTimeEntity { @OneToMany(mappedBy = "parent", orphanRemoval = true) private List children = new ArrayList<>(); - @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment") + @OneToMany(fetch = FetchType.LAZY, mappedBy = "comment", cascade = CascadeType.REMOVE) private List commentEmotionList = new ArrayList<>(); @Embedded diff --git a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java index b3292b2a..533a5609 100644 --- a/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java +++ b/src/main/java/co/kr/jurumarble/comment/repository/CommentRepository.java @@ -24,4 +24,5 @@ public interface CommentRepository extends JpaRepository { List findByParent(Comment parent); boolean existsByIdAndUser(Long commentId, User user); + boolean existsByIdAndVoteId(Long id, Long voteId); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index 8a404c5d..a998382c 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -46,6 +46,7 @@ public void createComment(Long voteId, Long userId, CreateCommentServiceRequest Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = commentValidator.checkParentComment(request); commentValidator.checkNestedCommentAllowed(parentComment); + commentValidator.validateParentCommentBelongsToVote(parentComment, vote); Comment comment = request.toComment(parentComment, user, voteId); commentRepository.save(comment); diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java b/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java index ef029b38..5e68c2d9 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java @@ -6,7 +6,9 @@ import co.kr.jurumarble.exception.comment.CommentNotBelongToUserException; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.comment.NestedCommentNotAllowedException; +import co.kr.jurumarble.exception.comment.ParentCommentNotBelongToVoteException; import co.kr.jurumarble.user.domain.User; +import co.kr.jurumarble.vote.domain.Vote; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -22,6 +24,13 @@ public void validateCommentBelongsToUser(Comment comment, User user) { } } + public void validateParentCommentBelongsToVote(Comment parent, Vote vote) { + if (parent != null && !commentRepository.existsByIdAndVoteId(parent.getId(), vote.getId())) { + throw new ParentCommentNotBelongToVoteException(); + } + } + + public Comment checkParentComment(CreateCommentServiceRequest request) { if (request.getParentId() == null) { return null; diff --git a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java index d7065126..80d3f169 100644 --- a/src/main/java/co/kr/jurumarble/exception/StatusEnum.java +++ b/src/main/java/co/kr/jurumarble/exception/StatusEnum.java @@ -18,6 +18,7 @@ public enum StatusEnum { ALREADY_VOTE_RESULT_EXIST(403, "ALREADY_VOTE_RESULT_EXIST"), TOKEN_NOT_EXIST(404, "TOKEN_NOT_EXIST"), COMMENT_NOT_BELONG_TO_USER(400, "COMMENT_NOT_BELONG_TO_USER"), + COMMENT_NOT_BELONG_TO_VOTE(400, "COMMENT_NOT_BELONG_TO_USER"), NO_CONTENT(204, "NO_CONTENT"), COMMENT_EMOTION_NOT_FOUND(404, "COMMENT_EMOTION_NOT_FOUND"), ACCESS_RIGHT_FAILED(412, "ACCESS_RIGHT_FAILED"); diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java index 48e0b0c5..d9e8ba48 100644 --- a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java @@ -48,4 +48,10 @@ public ResponseEntity handle(CommentNotBelongToUserException e return ResponseEntity.status(e.getStatus().getStatusCode()) .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); } + + @ExceptionHandler(ParentCommentNotBelongToVoteException.class) + public ResponseEntity handle(ParentCommentNotBelongToVoteException e) { + return ResponseEntity.status(e.getStatus().getStatusCode()) + .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); + } } \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/exception/comment/ParentCommentNotBelongToVoteException.java b/src/main/java/co/kr/jurumarble/exception/comment/ParentCommentNotBelongToVoteException.java new file mode 100644 index 00000000..0c7478a4 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/exception/comment/ParentCommentNotBelongToVoteException.java @@ -0,0 +1,17 @@ +package co.kr.jurumarble.exception.comment; + +import co.kr.jurumarble.exception.StatusEnum; +import lombok.Getter; + +@Getter +public class ParentCommentNotBelongToVoteException extends RuntimeException{ + + private final StatusEnum status; + private static final String message = "부모댓글이 해당 투표에 있는 댓글이 아닙니다."; + public ParentCommentNotBelongToVoteException() { + super(message); + this.status = StatusEnum.COMMENT_NOT_BELONG_TO_VOTE; + } + + +} \ No newline at end of file From 5369fc4687769912513a6fbaa925895578716027 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 04:35:08 +0900 Subject: [PATCH 53/76] =?UTF-8?q?refactor=20:=20classifyAge=20=EC=9D=98=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EC=82=AC=ED=95=AD=EC=97=90=20=EB=A7=9E?= =?UTF-8?q?=EA=B2=8C=20toComment=20=EB=A9=94=EC=86=8C=EB=93=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/service/request/CreateCommentServiceRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java b/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java index 18092469..b0f27649 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java +++ b/src/main/java/co/kr/jurumarble/comment/service/request/CreateCommentServiceRequest.java @@ -27,7 +27,7 @@ public Comment toComment(Comment parentComment, User user, Long voteId) { .user(user) .voteId(voteId) .content(content) - .age(user.classifyAge(user.getAge())) + .age(user.classifyAge()) .mbti(user.getMbti()) .gender(user.getGender()) .parent(parentComment) From 0b0ec29c4817eb8acc74af8b67c8623dd74d92b1 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 04:35:27 +0900 Subject: [PATCH 54/76] =?UTF-8?q?fix=20:=20JpaAuditing=20=EC=9D=B4=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=EB=90=98=EC=96=B4=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=EB=90=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/co/kr/jurumarble/JurumarbleApplication.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/JurumarbleApplication.java b/src/main/java/co/kr/jurumarble/JurumarbleApplication.java index 24aa0fcd..1ac3667c 100644 --- a/src/main/java/co/kr/jurumarble/JurumarbleApplication.java +++ b/src/main/java/co/kr/jurumarble/JurumarbleApplication.java @@ -2,9 +2,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -@EnableJpaAuditing @SpringBootApplication public class JurumarbleApplication { From c8f3e550a2d9ca70d6a59a5cfba42faf15a8810a Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 05:21:57 +0900 Subject: [PATCH 55/76] =?UTF-8?q?docs=20:=20comment,=20comment=5Femotion?= =?UTF-8?q?=20table=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/schema.sql | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index fcfd95f7..36432d43 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -5,6 +5,8 @@ DROP TABLE if EXISTS vote_result; DROP TABLE if EXISTS drink; DROP TABLE if EXISTS vote_drink_content; DROP TABLE if EXISTS enjoy_drink; +DROP TABLE if EXISTS comment_emotion; +DROP TABLE if EXISTS comment; CREATE TABLE vote ( @@ -101,3 +103,35 @@ CREATE TABLE enjoy_drink PRIMARY KEY (id) ); +CREATE TABLE comment +( + id BIGINT NOT NULL AUTO_INCREMENT, + user_id BIGINT NOT NULL, + vote_id BIGINT NOT NULL, + content VARCHAR(255) NOT NULL, + age VARCHAR(255) DEFAULT NULL, + mbti VARCHAR(4) DEFAULT NULL, + gender VARCHAR(6) DEFAULT NULL, + like_count INTEGER DEFAULT NULL, + hate_count INTEGER DEFAULT NULL, + parent_id BIGINT DEFAULT NULL, + restaurant_image VARCHAR(255) DEFAULT NULL, + restaurant_name VARCHAR(255) DEFAULT NULL, + created_date TIMESTAMP, + modified_date TIMESTAMP, + PRIMARY KEY (id), + FOREIGN KEY (user_id) REFERENCES users (id), + FOREIGN KEY (parent_id) REFERENCES comment (id) +); + +CREATE TABLE comment_emotion +( + id BIGINT NOT NULL AUTO_INCREMENT, + user_id BIGINT NOT NULL, + comment_id BIGINT NOT NULL, + emotion VARCHAR(20) NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (user_id) REFERENCES users (id), + FOREIGN KEY (comment_id) REFERENCES comment (id) +); + From 4e1149cfe78f174a54adf3b0a2b35a57b0f32d65 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 05:23:32 +0900 Subject: [PATCH 56/76] =?UTF-8?q?feat=20:=20Vote=20=EC=97=90=20=ED=95=B4?= =?UTF-8?q?=EB=8B=B9=20=EB=8C=93=EA=B8=80=EC=9D=B4=20=EC=9E=88=EB=8A=94?= =?UTF-8?q?=EC=A7=80=20=EA=B2=80=EC=A6=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../co/kr/jurumarble/comment/service/CommentService.java | 4 +++- .../co/kr/jurumarble/comment/service/CommentValidator.java | 6 +++--- .../exception/comment/CommentExceptionHandler.java | 4 ++-- ...eException.java => CommentNotBelongToVoteException.java} | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) rename src/main/java/co/kr/jurumarble/exception/comment/{ParentCommentNotBelongToVoteException.java => CommentNotBelongToVoteException.java} (51%) diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java index a998382c..76f5c27b 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentService.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentService.java @@ -46,7 +46,7 @@ public void createComment(Long voteId, Long userId, CreateCommentServiceRequest Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment parentComment = commentValidator.checkParentComment(request); commentValidator.checkNestedCommentAllowed(parentComment); - commentValidator.validateParentCommentBelongsToVote(parentComment, vote); + commentValidator.validateCommentBelongsToVote(parentComment, vote); Comment comment = request.toComment(parentComment, user, voteId); commentRepository.save(comment); @@ -70,6 +70,7 @@ public void updateComment(Long voteId, Long commentId, Long userId, UpdateCommen Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); commentValidator.validateCommentBelongsToUser(comment, user); + commentValidator.validateCommentBelongsToVote(comment,vote); comment.updateContent(request.getContent()); } @@ -80,6 +81,7 @@ public void deleteComment(Long voteId, Long commentId, Long userId) { Vote vote = voteRepository.findById(voteId).orElseThrow(VoteNotFoundException::new); Comment comment = commentRepository.findById(commentId).orElseThrow(CommentNotFoundException::new); commentValidator.validateCommentBelongsToUser(comment, user); + commentValidator.validateCommentBelongsToVote(comment,vote); commentRepository.delete(comment); } diff --git a/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java b/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java index 5e68c2d9..2c1807dc 100644 --- a/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java +++ b/src/main/java/co/kr/jurumarble/comment/service/CommentValidator.java @@ -6,7 +6,7 @@ import co.kr.jurumarble.exception.comment.CommentNotBelongToUserException; import co.kr.jurumarble.exception.comment.CommentNotFoundException; import co.kr.jurumarble.exception.comment.NestedCommentNotAllowedException; -import co.kr.jurumarble.exception.comment.ParentCommentNotBelongToVoteException; +import co.kr.jurumarble.exception.comment.CommentNotBelongToVoteException; import co.kr.jurumarble.user.domain.User; import co.kr.jurumarble.vote.domain.Vote; import lombok.RequiredArgsConstructor; @@ -24,9 +24,9 @@ public void validateCommentBelongsToUser(Comment comment, User user) { } } - public void validateParentCommentBelongsToVote(Comment parent, Vote vote) { + public void validateCommentBelongsToVote(Comment parent, Vote vote) { if (parent != null && !commentRepository.existsByIdAndVoteId(parent.getId(), vote.getId())) { - throw new ParentCommentNotBelongToVoteException(); + throw new CommentNotBelongToVoteException(); } } diff --git a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java index d9e8ba48..a81c75d4 100644 --- a/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentExceptionHandler.java @@ -49,8 +49,8 @@ public ResponseEntity handle(CommentNotBelongToUserException e .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); } - @ExceptionHandler(ParentCommentNotBelongToVoteException.class) - public ResponseEntity handle(ParentCommentNotBelongToVoteException e) { + @ExceptionHandler(CommentNotBelongToVoteException.class) + public ResponseEntity handle(CommentNotBelongToVoteException e) { return ResponseEntity.status(e.getStatus().getStatusCode()) .body(ExceptionMessage.of(e.getStatus(), e.getMessage())); } diff --git a/src/main/java/co/kr/jurumarble/exception/comment/ParentCommentNotBelongToVoteException.java b/src/main/java/co/kr/jurumarble/exception/comment/CommentNotBelongToVoteException.java similarity index 51% rename from src/main/java/co/kr/jurumarble/exception/comment/ParentCommentNotBelongToVoteException.java rename to src/main/java/co/kr/jurumarble/exception/comment/CommentNotBelongToVoteException.java index 0c7478a4..0030961c 100644 --- a/src/main/java/co/kr/jurumarble/exception/comment/ParentCommentNotBelongToVoteException.java +++ b/src/main/java/co/kr/jurumarble/exception/comment/CommentNotBelongToVoteException.java @@ -4,11 +4,11 @@ import lombok.Getter; @Getter -public class ParentCommentNotBelongToVoteException extends RuntimeException{ +public class CommentNotBelongToVoteException extends RuntimeException{ private final StatusEnum status; - private static final String message = "부모댓글이 해당 투표에 있는 댓글이 아닙니다."; - public ParentCommentNotBelongToVoteException() { + private static final String message = "댓글이 해당 투표에 있는 댓글이 아닙니다."; + public CommentNotBelongToVoteException() { super(message); this.status = StatusEnum.COMMENT_NOT_BELONG_TO_VOTE; } From 37b44902257551e07ba3ca0c32b0a9c82278648f Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 05:24:16 +0900 Subject: [PATCH 57/76] =?UTF-8?q?refactor=20:=20Comment=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=85=8C=EC=9D=B4=EB=B8=94=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EA=B2=8C=20Column=20=EB=B0=8F=20=EC=9D=BC=EB=B6=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/jurumarble/comment/domain/Comment.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java index f92c6f5c..7fac61a1 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/Comment.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/Comment.java @@ -24,39 +24,34 @@ public class Comment extends BaseTimeEntity { private static final int INITIAL_COUNT = 0; @Id - @GeneratedValue - @Column + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "USER_ID") + @JoinColumn(name = "user_id") private User user; - @Column + @Column(name = "vote_id") private Long voteId; - @Column + private String content; @Enumerated(EnumType.STRING) - @Column private AgeType age; @Enumerated(EnumType.STRING) - @Column private MbtiType mbti; @Enumerated(EnumType.STRING) - @Column private GenderType gender; - @Column + @Column(name = "like_count") private Integer likeCount = INITIAL_COUNT; - - @Column + @Column(name = "hate_count") private Integer hateCount = INITIAL_COUNT; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "PARENT_ID") + @JoinColumn(name = "parent_id") private Comment parent; @OneToMany(mappedBy = "parent", orphanRemoval = true) @@ -73,7 +68,7 @@ public class Comment extends BaseTimeEntity { private Restaurant restaurant = new Restaurant(); @Builder - public Comment(User user, Long voteId, String content, AgeType age, MbtiType mbti, GenderType gender,Comment parent) { + public Comment(User user, Long voteId, String content, AgeType age, MbtiType mbti, GenderType gender, Comment parent) { this.user = user; this.voteId = voteId; this.content = content; From ebe2de729caf0145af555d8c3da541ab3a428498 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 05:24:25 +0900 Subject: [PATCH 58/76] =?UTF-8?q?refactor=20:=20CommentEmotion=20=EB=8F=84?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=85=8C=EC=9D=B4=EB=B8=94=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EA=B2=8C=20Column=20=EB=B0=8F=20=EC=9D=BC=EB=B6=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../co/kr/jurumarble/comment/domain/CommentEmotion.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java b/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java index 6daf2fed..54d9ad50 100644 --- a/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java +++ b/src/main/java/co/kr/jurumarble/comment/domain/CommentEmotion.java @@ -2,6 +2,7 @@ import co.kr.jurumarble.comment.enums.Emotion; import co.kr.jurumarble.user.domain.User; +import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @@ -10,11 +11,12 @@ @Entity @Getter -@NoArgsConstructor +@NoArgsConstructor(access = AccessLevel.PUBLIC) +@Table(name = "comment_emotion") public class CommentEmotion { + @Id - @GeneratedValue - @Column + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ManyToOne(fetch = FetchType.LAZY) From 547687d98d9cdf73bcb211ab8b420c1f847b9c2b Mon Sep 17 00:00:00 2001 From: wellbeing-dough Date: Fri, 25 Aug 2023 14:49:21 +0900 Subject: [PATCH 59/76] =?UTF-8?q?feat=20:=20=EC=88=A0=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=EC=97=90=20=EC=A2=8C=ED=91=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/schema.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index 36d47174..cbbf89d9 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -90,6 +90,8 @@ CREATE TABLE drink region VARCHAR(10) DEFAULT NULL, price VARCHAR(50) DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, + latitude DECIMAL(9, 6) DEFAULT NULL, + longitude DECIMAL(9, 6) DEFAULT, PRIMARY KEY (id) ); From b78f62bb8137fb87d0a7243cb675a8747c45fa03 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 19:03:19 +0900 Subject: [PATCH 60/76] =?UTF-8?q?chore=20:=20tourApi=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20CI/CD=20=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index e8f25d61..18e2e6d8 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -90,4 +90,23 @@ springdoc: show-actuator: true default-produces-media-type: application/json -swagger.url: ${swagger.url} \ No newline at end of file +swagger.url: ${swagger.url} + +## tourApi 환경변수 설정 +tour: + api: + url: http://apis.data.go.kr/B551011/KorService1/ + servicekey: ${tour.api.servicekey} + mobile: + os: ETC + app: jurumarble + response: + type: json + image-yn: Y + content-type-id: 39 + subimage-yn: Y + num-of-rows: 10 + list-yn: Y + arrange: O + cat1: A05 + cat2: A0502 \ No newline at end of file From 03770d09c376846e46ea377e03b9e8d5e66ac0da Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Fri, 25 Aug 2023 19:10:32 +0900 Subject: [PATCH 61/76] =?UTF-8?q?chore=20:=20tourApi=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20CI/CD=20=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 37 ++++++++++++------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 18e2e6d8..6e33307b 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -69,6 +69,24 @@ feign: max-connections: 2000 max-connections-per-route: 500 +## tourApi 환경변수 설정 +tour: + api: + url: http://apis.data.go.kr/B551011/KorService1/ + servicekey: ${tour.api.servicekey} + mobile: + os: ETC + app: jurumarble + response: + type: json + image-yn: Y + content-type-id: 39 + subimage-yn: Y + num-of-rows: 10 + list-yn: Y + arrange: O + cat1: A05 + cat2: A0502 logging: @@ -91,22 +109,3 @@ springdoc: default-produces-media-type: application/json swagger.url: ${swagger.url} - -## tourApi 환경변수 설정 -tour: - api: - url: http://apis.data.go.kr/B551011/KorService1/ - servicekey: ${tour.api.servicekey} - mobile: - os: ETC - app: jurumarble - response: - type: json - image-yn: Y - content-type-id: 39 - subimage-yn: Y - num-of-rows: 10 - list-yn: Y - arrange: O - cat1: A05 - cat2: A0502 \ No newline at end of file From 4afd4581565a94b339ab7e0ff1e7c8364f66507b Mon Sep 17 00:00:00 2001 From: wellbeing-dough Date: Sat, 26 Aug 2023 01:33:31 +0900 Subject: [PATCH 62/76] =?UTF-8?q?feat=20:=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/data.sql | 2218 +++++++++++++++++------------------ 1 file changed, 1094 insertions(+), 1124 deletions(-) diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index b6c19616..02a633ea 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -1,1781 +1,1751 @@ INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이강주', '리큐르', '전주 이강주', '19%', '쌀, 소맥분, 정맥, 배, 생강, 계피, 울금, 꿀', '375ml', '전주시 덕진구 매암길 28', '전주', '5,800', - 'https://shopping-phinf.pstatic.net/main_8204301/82043013300.5.jpg'); + 'https://shopping-phinf.pstatic.net/main_8204301/82043013300.5.jpg', '35.8734330016797', '127.027053333515'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('송명섭 막걸리', '탁주', '태인합동주조', '6%', '국내산쌀, 곡자, 정제수', '900ml', '전북 정읍시 태인면 태흥리 392-1', '전북', '3,000', - 'https://shopping-phinf.pstatic.net/main_8475981/84759812651.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8475981/84759812651.1.jpg', '35.651422285045598', '126.944889290351'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('제주 고소리술', '증류식소주', '제주술익는집', '40%', '잡곡, 누룩, 정제수', '400ml', '제주특별자치도 서귀포시 표선면 중산간동로 4726', '제주', '45,000', - 'https://shopping-phinf.pstatic.net/main_1316520/13165203536.5.jpg'); + 'https://shopping-phinf.pstatic.net/main_1316520/13165203536.5.jpg', '33.384960297872098', '126.793773142145'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('서울의 밤', '리큐르', '더한주류', '25%', '매실증류주원액, 벌꿀, 포도당, 노간주나무열매, 정제수', '375ml', '서울시 은평구 증산로7길 28-13', '서울', '7,500', - 'https://shopping-phinf.pstatic.net/main_2403950/24039509524.20200904124411.jpg'); + 'https://shopping-phinf.pstatic.net/main_2403950/24039509524.20200904124411.jpg', '37.585459697923397', '126.90696666699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('티나', '리큐르', '추성고을', '16%', '딸기추출물, 죽력, 정제수, 주정, 액상과당(포도당), 구연산, 딸기향, 망고향', '750ml', '전남 담양군 용면 추령로 29', '전남', - '54,000', 'https://shopping-phinf.pstatic.net/main_8314543/83145431204.jpg'); + price, image, latitude, longitude) +VALUES ('티나', '리큐르', '추성고을', '16%', '딸기추출물, 죽력, 정제수, 주정, 액상과당(포도당), 구연산, 딸기향, 망고향', '750ml', '전남 담양군 용면 추령로 29', '전남', '54,000', + 'https://shopping-phinf.pstatic.net/main_8314543/83145431204.jpg', '35.366386575009301', '126.985286653335'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('죽력고', '일반증류주', '태인합동주조', '32%', '국내산쌀, 죽력, 누룩, 정제수', '700ml', '전북 정읍시 태인면 태흥리 392-1', '전북', '60,000', - 'https://shopping-phinf.pstatic.net/main_8541313/85413135876.jpg'); + 'https://shopping-phinf.pstatic.net/main_8541313/85413135876.jpg', '35.651422285045598', '126.944889290351'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('고소리 술', '소주', '제주샘영농조합법인', '40%', '쌀, 차조, 입국, 누룩, 효모, 효소, 정제수, 스테비올 배당체', '700ml', '제주특별자치도 제주시 애월읍 애원로 283', - '제주', '45,000', 'https://shopping-phinf.pstatic.net/main_1316520/13165203536.5.jpg'); + price, image, latitude, longitude) +VALUES ('고소리 술', '소주', '제주샘영농조합법인', '40%', '쌀, 차조, 입국, 누룩, 효모, 효소, 정제수, 스테비올 배당체', '700ml', '제주특별자치도 제주시 애월읍 애원로 283', '제주', '45,000', + 'https://shopping-phinf.pstatic.net/main_1316520/13165203536.5.jpg', '33.444787575044799', '126.337530129204'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('김포예주 프리미엄', '살균약주', '김포양조', '13%', '국내산 쌀, 국, 효모, 젖산, 정제수', '750ml', '경기도 김포시 월곶면 김포대로 2763', '경기', '18,000', - 'https://shopping-phinf.pstatic.net/main_3679339/36793394883.20221227102449.jpg'); + 'https://shopping-phinf.pstatic.net/main_3679339/36793394883.20221227102449.jpg', '37.711509317937598', '126.546803490044'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('월매 쌀막걸리', '살균탁주', '서울장수주식회사', '6%', '백미, 말토올리고당, 정제수', '350ml', '충청북도 진천군 광혜원면 죽현길141', '충북', '1,200', - 'https://shopping-phinf.pstatic.net/main_8259853/82598534476.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8259853/82598534476.2.jpg', '36.952797098173001', '127.418969511433'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('느린마을 막걸리', '탁주', '배상면주가 포천LB', '6%', '쌀, 국, 효모, 정제수', '750ml', '경기도 포천시 화현면 화동로 432번길 25', '경기', '3,600', - 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg'); + 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg', '37.905995687213199', '127.30990487507501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('문경바람 오크 40도', '일반증류주', '농업회사법인(주)제이엘', '40%', '사과(문경산)', '750ml / 375ml', '경북 문경시 문경읍 새재로 609', '경북', - '44,000(750ml), ₩30,000(375ml)', 'https://shopping-phinf.pstatic.net/main_1338155/13381557946.2.jpg'); + price, image, latitude, longitude) +VALUES ('문경바람 오크 40도', '일반증류주', '농업회사법인(주)제이엘', '40%', '사과(문경산)', '750ml / 375ml', '경북 문경시 문경읍 새재로 609', '경북', '44,000(750ml), ₩30,000(375ml)', + 'https://shopping-phinf.pstatic.net/main_1338155/13381557946.2.jpg', '36.736133308451798', '128.09134747187099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('화주', '일반증류주', '내국양조', '25%', '국내산 쌀, 홍삼농축액, 정제수', '375ml', '충남 논산시 연무읍 마종로 361', '충남', '13,000', - 'https://shopping-phinf.pstatic.net/main_1219775/12197756639.20171009175619.jpg'); + 'https://shopping-phinf.pstatic.net/main_1219775/12197756639.20171009175619.jpg', '36.111715028494103', '127.06884996469'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('이강주 특7호', '리큐르', '전주 이강주', '25%', '쌀, 소맥분, 정맥, 배, 생강, 계피, 울금, 꿀', '400ml X 2', '전주시 덕진구 매암길 28', '전주', - '50,000', 'https://shopping-phinf.pstatic.net/main_1196701/11967014716.20190328100452.jpg'); + price, image, latitude, longitude) +VALUES ('이강주 특7호', '리큐르', '전주 이강주', '25%', '쌀, 소맥분, 정맥, 배, 생강, 계피, 울금, 꿀', '400ml X 2', '전주시 덕진구 매암길 28', '전주', '50,000', + 'https://shopping-phinf.pstatic.net/main_1196701/11967014716.20190328100452.jpg', '35.8734330016797', '127.027053333515'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('니모메', '약주', '제주샘영농조합법인', '11%', '백미, 누룩, 감귤 진피, 효모', '375ml', '제주특별자치도 제주시 애월읍 애원로 283', '제주', - '33,000(375ml*3병)', 'https://shopping-phinf.pstatic.net/main_1212921/12129212147.20230323151407.jpg'); + price, image, latitude, longitude) +VALUES ('니모메', '약주', '제주샘영농조합법인', '11%', '백미, 누룩, 감귤 진피, 효모', '375ml', '제주특별자치도 제주시 애월읍 애원로 283', '제주', '33,000(375ml*3병)', + 'https://shopping-phinf.pstatic.net/main_1212921/12129212147.20230323151407.jpg', '33.444787575044799', '126.337530129204'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('나루 생막걸리 6%', '탁주', '한강주조', '6%', '쌀(국내산), 국, 효모, 정제수', '935ml', '서울특별시 성동구 둘레15길 12, 2층', '서울', '7,000', - 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg'); + 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg', '37.535786298933999', '127.055724371916'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('고소리술', '소주', '제주샘영농조합법인', '40%', '쌀, 차조, 입국, 누룩, 효모, 효소, 정제수, 스테비올 배당체', '375ml', '제주특별자치도 제주시 애월읍 애원로 283', - '제주', '32,000', 'https://shopping-phinf.pstatic.net/main_1316520/13165203536.5.jpg'); + price, image, latitude, longitude) +VALUES ('고소리술', '소주', '제주샘영농조합법인', '40%', '쌀, 차조, 입국, 누룩, 효모, 효소, 정제수, 스테비올 배당체', '375ml', '제주특별자치도 제주시 애월읍 애원로 283', '제주', '32,000', + 'https://shopping-phinf.pstatic.net/main_1316520/13165203536.5.jpg', '33.444787575044799', '126.337530129204'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('장수 생 막걸리_750ml', '탁주', '서울장수주식회사', '6%', '백미(국내산), 말토올리고당', '750ml', '충청북도 진천군 광혜원면 죽현길141', '충북', '1,200', - 'https://shopping-phinf.pstatic.net/main_8231137/82311379192.jpg'); + 'https://shopping-phinf.pstatic.net/main_8231137/82311379192.jpg', '36.952797098173001', '127.418969511433'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('매실원주 15도_300ml', '리큐르', '더한주류', '15%', '매실주원액, 발효주정, 정제수, 꿀', '300ml', '서울시 은평구 증산로7길 28-13', '서울', '6,000', - 'https://shopping-phinf.pstatic.net/main_3923321/39233219862.jpg'); + 'https://shopping-phinf.pstatic.net/main_3923321/39233219862.jpg', '37.585459697923397', '126.90696666699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이상헌 탁주', '탁주', '이가수불', '19%', '아산쌀, 국(국내산 밀누룩), 정제수', '500ml', '충남 아산시 도고면 기곡로 77번길 30-7', '충남', '25,000', - 'https://shopping-phinf.pstatic.net/main_8099908/80999083791.jpg'); + 'https://shopping-phinf.pstatic.net/main_8099908/80999083791.jpg', '36.760031579643702', '126.88363347823601'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('은자골 생 탁배기', '탁주', '은척양조장', '5%', '백미, 소맥분, 정제수, 전분당, 국, 누룩, 효소, 아스파탐 등', '750ml', '경상북도 상주시 은척면 봉중2길 16-9', - '경북', '1,500', 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg'); + price, image, latitude, longitude) +VALUES ('은자골 생 탁배기', '탁주', '은척양조장', '5%', '백미, 소맥분, 정제수, 전분당, 국, 누룩, 효소, 아스파탐 등', '750ml', '경상북도 상주시 은척면 봉중2길 16-9', '경북', '1,500', + 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg', '36.531378468577302', '128.06976159011899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('강쇠_370ml', '살균약주', '농업회사법인(유)술소리', '13%', '쌀, 누룩, 오가피', '370ml', '전라북도 남원시 시묘길 130(오암동)', '전북', '2,500', - 'https://shopping-phinf.pstatic.net/main_8140545/81405453146.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8140545/81405453146.1.jpg', '35.384001729462199', '127.380353410198'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('추사40', '일반증류주', '예산사과와인(주)', '40%', '사과(국내산)', '500ml', '충남 예산군 고덕면 대몽로 107-25', '충남', '60,000', - 'https://shopping-phinf.pstatic.net/main_3496226/34962263619.20220929170618.jpg'); + 'https://shopping-phinf.pstatic.net/main_3496226/34962263619.20220929170618.jpg', '36.761850437703899', '126.698077768781'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('오메기 맑은술', '약주', '제주술익는집', '16%', '좁쌀, 햅쌀, 정제수, 누룩', '500ml', '제주특별자치도 서귀포시 표선면 중산간동로 4726', '제주', '30,000', - 'https://shopping-phinf.pstatic.net/main_2885829/28858293590.20210915155516.jpg'); + 'https://shopping-phinf.pstatic.net/main_2885829/28858293590.20210915155516.jpg', '33.384960297872098', '126.793773142145'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('선호 생막걸리', '탁주', '김포금쌀탁주영농조합법인', '6%', '국내산 쌀, 누룩, 효모, 정제효소, 천연감미료, 정제수', '750ml', '경기도 김포시 하성면 하성로 622', '경기', - '1,700', 'https://shopping-phinf.pstatic.net/main_2941334/29413342619.20211026152529.jpg'); + price, image, latitude, longitude) +VALUES ('선호 생막걸리', '탁주', '김포금쌀탁주영농조합법인', '6%', '국내산 쌀, 누룩, 효모, 정제효소, 천연감미료, 정제수', '750ml', '경기도 김포시 하성면 하성로 622', '경기', '1,700', + 'https://shopping-phinf.pstatic.net/main_2941334/29413342619.20211026152529.jpg', '37.728587106278198', '126.629076579878'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('호랑이 생 막걸리', '탁주', '배혜정 도가', '6%', '쌀, 정제수, 국, 효모, 젖산 등', '750ml', '경기도 화성시 정남면 문학리 674-23', '경기', '2,200', - 'https://shopping-phinf.pstatic.net/main_2403967/24039675522.20210625143352.jpg'); + 'https://shopping-phinf.pstatic.net/main_2403967/24039675522.20210625143352.jpg', '37.149336281531802', '126.960871275363'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('대통대잎술 십오야', '약주', '추성고을', '15%', '쌀, 누룩, 갈근, 구기자, 솔잎, 진피 등', '700ml', '전남 담양군 용명 추령로 29', '전남', '16,000', - 'https://shopping-phinf.pstatic.net/main_8241163/82411637121.jpg'); + 'https://shopping-phinf.pstatic.net/main_8241163/82411637121.jpg', '35.366295554039603', '126.98539549528'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('담솔 40%', '리큐르', '명가원영농조합법인', '40%', '정제수, 국내산 쌀, 국내산 송순농축액(송순 33%, 정제수 67%)5.24%, 누룩, 조제종국, 효모', '500ml', - '경남 함양군 지곡면 지곡창촌길3', '경남', '22,000', - 'https://shopping-phinf.pstatic.net/main_1214020/12140203164.20170828154448.jpg'); + price, image, latitude, longitude) +VALUES ('담솔 40%', '리큐르', '명가원영농조합법인', '40%', '정제수, 국내산 쌀, 국내산 송순농축액(송순 33%, 정제수 67%)5.24%, 누룩, 조제종국, 효모', '500ml', '경남 함양군 지곡면 지곡창촌길3', '경남', '22,000', + 'https://shopping-phinf.pstatic.net/main_1214020/12140203164.20170828154448.jpg', '35.566395785851398', '127.775478094034'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('려(驪)고구마증류소주 40도', '증류식소주', '(농)국순당 여주명주(주)', '40%', '고구마(여주산 100%)', '500ml', '경기도 여주시 강천면 부평로 330', '경기', - '35000', 'https://shopping-phinf.pstatic.net/main_2234930/22349302208.2.jpg'); + price, image, latitude, longitude) +VALUES ('려(驪)고구마증류소주 40도', '증류식소주', '(농)국순당 여주명주(주)', '40%', '고구마(여주산 100%)', '500ml', '경기도 여주시 강천면 부평로 330', '경기', '35000', + 'https://shopping-phinf.pstatic.net/main_2234930/22349302208.2.jpg', '37.281144440518297', '127.74262548642'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('붉은 원숭이', '살균탁주', '술샘', '10.8%', '쌀(국내산 경기미 100%), 누룩, 홍국, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', - '7,000', 'https://shopping-phinf.pstatic.net/main_1219695/12196950265.20220816155846.jpg'); + price, image, latitude, longitude) +VALUES ('52C', '일반증류주', '농업회사법인(주)청산녹수', '17.50%', '정제수, 주정, 쌀증류식소주원액, 오이', '500ml', '전라남도 장성군 장성읍 남양촌길 (백계리) 19', '전남', '10,000', + 'https://shopping-phinf.pstatic.net/main_3636470/36364704660.1.jpg', '35.345218252623603', '126.812850520064'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('조선주조사', '청주', '농업회사법인 우포의아침(주)', '14%', '쌀(국내산), 입국, 누룩, 주정, 정제수', '300ml / 700ml', - '(1공장) 경남 창녕군 대지면 대지농공단지길 40, (2공장) 경남 창원시 의창군 북면 천주로 1173번길29', '경남', '4000', - 'https://shopping-phinf.pstatic.net/main_8245082/82450824259.1.jpg'); + price, image, latitude, longitude) +VALUES ('붉은 원숭이', '살균탁주', '술샘', '10.8%', '쌀(국내산 경기미 100%), 누룩, 홍국, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', '7,000', + 'https://shopping-phinf.pstatic.net/main_1219695/12196950265.20220816155846.jpg', '37.233502177738202', '127.298614632461'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('동학 1957', '청주', '고헌정영농조합법인', '13%', '쌀(국내산), 구연산, 효모, 젖산, 정제효소제, 국, 주정, 정제수', '375ml / 700ml', - '충북 충주시 산척면 샛강영길 39', '충북', '3500', - 'https://shopping-phinf.pstatic.net/main_3281025/32810252619.20220608180214.jpg'); + price, image, latitude, longitude) +VALUES ('조선주조사', '청주', '농업회사법인 우포의아침(주)', '14%', '쌀(국내산), 입국, 누룩, 주정, 정제수', '300ml / 700ml', '경남 창원시 의창군 북면 천주로 1173번길29', '경남', '4000', + 'https://shopping-phinf.pstatic.net/main_8245082/82450824259.1.jpg', '35.356272194386598', '128.607945752761'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('제주샘주 오메기술', '약주', '제주샘영농조합법인', '13%', '쌀, 차조, 입국, 누룩, 효모, 효소, 청호, 조릿대, 감초, 정제수', '375ml', - '제주특별자치도 제주시 애월읍 애원로 283', '제주', '7,800', 'https://shopping-phinf.pstatic.net/main_8431561/84315616378.jpg'); + price, image, latitude, longitude) +VALUES ('동학 1957', '청주', '고헌정영농조합법인', '13%', '쌀(국내산), 구연산, 효모, 젖산, 정제효소제, 국, 주정, 정제수', '375ml / 700ml', '충북 충주시 산척면 샛강영길 39', '충북', '3500', + 'https://shopping-phinf.pstatic.net/main_3281025/32810252619.20220608180214.jpg', '37.101464727434802', '127.966401757646'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) +VALUES ('제주샘주 오메기술', '약주', '제주샘영농조합법인', '13%', '쌀, 차조, 입국, 누룩, 효모, 효소, 청호, 조릿대, 감초, 정제수', '375ml', '제주특별자치도 제주시 애월읍 애원로 283', '제주', '7,800', + 'https://shopping-phinf.pstatic.net/main_8431561/84315616378.jpg', '33.444787575044799', '126.337530129204'); +INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, + price, image, latitude, longitude) VALUES ('1000억 유산균막걸리', '탁주', '(주)국순당', '5%', '쌀(국내산), 밀(국내산), 누룩, 정제수', '750ml', '강원도 횡성군 둔내면 강변로 975', '강원', '3,200', - 'https://shopping-phinf.pstatic.net/main_4062137/40621376528.jpg'); + 'https://shopping-phinf.pstatic.net/main_4062137/40621376528.jpg', '37.488285940926602', '128.19734659608801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('샤토미소 스위트 로제', '과실주', '도란원', '12%', '포도, 산화방지제, 효모, 설탕 등', '375ml', '충북 영동군 매곡면 유전 장척길 143', '충북', '20,000', - 'https://shopping-phinf.pstatic.net/main_2599696/25996965409.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_2599696/25996965409.1.jpg', '36.1920939357517', '127.936725157583'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('문경바람 백자 40도', '일반증류주', '농업회사법인(주)제이엘', '40%', '사과(문경산)', '750ml / 375ml', '경북 문경시 문경읍 새재로 609', '경북', '40000', - 'https://shopping-phinf.pstatic.net/main_1338155/13381557946.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_1338155/13381557946.2.jpg', '36.736133308451798', '128.09134747187099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('능이주', '살균약주', '내국양조', '13%', '국내산 쌀, 능이농충액, 누룩, 정제수', '375ml', '충남 논산시 연무읍 마종로 361', '충남', '12,000', - 'https://shopping-phinf.pstatic.net/main_8102971/81029713920.3.jpg'); + 'https://shopping-phinf.pstatic.net/main_8102971/81029713920.3.jpg', '36.111715028494103', '127.06884996469'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('고운달 오크', '일반증류주', '농업회사법인(주)제이엘', '52%', '오미자(문경산)', '500ml / 200ml', '경북 문경시 문경읍 새재로 609', '경북', - '360,000(500ml), ₩180,000(200ml)', 'https://shopping-phinf.pstatic.net/main_3405663/34056638628.jpg'); + price, image, latitude, longitude) +VALUES ('고운달 오크', '일반증류주', '농업회사법인(주)제이엘', '52%', '오미자(문경산)', '500ml / 200ml', '경북 문경시 문경읍 새재로 609', '경북', '360,000(500ml), ₩180,000(200ml)', + 'https://shopping-phinf.pstatic.net/main_3405663/34056638628.jpg', '36.736133308451798', '128.09134747187099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('황금보리소주25', '증류식소주', '황금보리(유)농업회사법인', '25%', '보리, 누룩, 정제수', '375ml', '충남 홍성군 서부면 서부로 696', '충남', - '42,500(375ml*5병)', 'https://shopping-phinf.pstatic.net/main_3306300/33063009619.20220621163903.jpg'); + price, image, latitude, longitude)ㅋ +VALUES ('황금보리소주25', '증류식소주', '황금보리(유)농업회사법인', '25%', '보리, 누룩, 정제수', '375ml', '충남 홍성군 서부면 서부로 696', '충남', '42,500(375ml*5병)', + 'https://shopping-phinf.pstatic.net/main_3306300/33063009619.20220621163903.jpg', '36.593712808577799', '126.511906219501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('겨울소주 25', '증류식소주', '두이술공방', '25%', '증류원액(국내산쌀), 효모, 효소, 정제수', '360ml', '충남 청양군 대치면 방죽골길 46-19', '충남', '10,000', - 'https://shopping-phinf.pstatic.net/main_3315278/33152784623.20220627111506.jpg'); + 'https://shopping-phinf.pstatic.net/main_3315278/33152784623.20220627111506.jpg', '36.469465990120199', '126.841460370935'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('금정산성 막걸리_750ml', '탁주', '(유)금정산성토산주', '8%', '백미, 밀누룩, 정제수, 아스파탐', '750ml', '부산시 금정구 산성로 453(금성동)', '부산', - '19000', 'https://shopping-phinf.pstatic.net/main_1909275/19092758909.20190506141625.jpg'); + price, image, latitude, longitude) +VALUES ('금정산성 막걸리_750ml', '탁주', '(유)금정산성토산주', '8%', '백미, 밀누룩, 정제수, 아스파탐', '750ml', '부산시 금정구 산성로 453(금성동)', '부산', '19000', + 'https://shopping-phinf.pstatic.net/main_1909275/19092758909.20190506141625.jpg', '35.250350843657699', '129.056434456445'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('세우리', '일반증류주', '제주샘영농조합법인', '45%', '산양삼, 하수오, 구기자, 쌀', '700ml', '제주특별자치도 제주시 애월읍 애원로 283', '제주', '250,000', - 'https://shopping-phinf.pstatic.net/main_4057213/40572139435.jpg'); + 'https://shopping-phinf.pstatic.net/main_4057213/40572139435.jpg', '33.444787575044799', '126.337530129204'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('희양산막걸리 9%', '탁주', '두술도가', '9%', '쌀(국내산), 누룩, 정제수', '750ml', '경북 문경시 가은읍 가은5길 7', '경북', '8,000', - 'https://shopping-phinf.pstatic.net/main_3585683/35856837685.jpg'); + 'https://shopping-phinf.pstatic.net/main_3585683/35856837685.jpg', '36.646609268067202', '128.060988946648'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('나루 생막걸리 11.5%', '탁주', '한강주조', '11.5%', '쌀(국내산), 국, 효모, 정제수', '500ml', '서울특별시 성동구 둘레15길 12, 2층', '서울', '11,000', - 'https://shopping-phinf.pstatic.net/main_8618148/86181484345.jpg'); + 'https://shopping-phinf.pstatic.net/main_8618148/86181484345.jpg', '37.535786298933999', '127.055724371916'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('추사백25', '일반증류주', '예산사과와인', '25%', '증류원액(사과증류원액, 사과: 국내산), 정제수', '350ml', '충청남도 예산군 고덕면 대몽로 107-25', '충남', - '12,000', 'https://shopping-phinf.pstatic.net/main_4059862/40598628621.20230614152537.jpg'); + price, image, latitude, longitude) +VALUES ('추사백25', '일반증류주', '예산사과와인', '25%', '증류원액(사과증류원액, 사과: 국내산), 정제수', '350ml', '충청남도 예산군 고덕면 대몽로 107-25', '충남', '12,000', + 'https://shopping-phinf.pstatic.net/main_4059862/40598628621.20230614152537.jpg', '36.761850437703899', '126.698077768781'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이도 32', '증류주', '조은술세종', '32%', '물, 증류원액(유기농 쌀, 국내산)', '750ml', '충청북도 청주시 청원구 사천로18번길 5-2', '충북', '37,000', - 'https://shopping-phinf.pstatic.net/main_2659188/26591885656.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_2659188/26591885656.1.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('안동소주 일품 40도 골드', '증류식소주', '안동소주일품', '40%', '국내산 쌀, 입국', '500ml', '경북 안동시 풍산읍 괴정리 926-5번지', '경북', '18,000', - 'https://shopping-phinf.pstatic.net/main_1211617/12116173029.20170828112541.jpg'); + 'https://shopping-phinf.pstatic.net/main_1211617/12116173029.20170828112541.jpg', '36.581512322914897', '128.52468486311301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('백련 맑은술', '약주', '신평양조장', '12%', '백미, 정제수, 물엿, 과당, 누룩, 백련잎, 누룩 등', '375ml', '충남 당진시 신평면 신평로 813', '충남', '7,000', - 'https://shopping-phinf.pstatic.net/main_8219714/82197140694.jpg'); + 'https://shopping-phinf.pstatic.net/main_8219714/82197140694.jpg', '36.883595059409302', '126.77478495639301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('녹파주', '약주', '농업회사법인(주)솔송주', '15%', '국내산 찹쌀, 멥쌀, 누룩, 정제수', '375ml', '경남 함양군 지곡면 지곡창촌길3', '경남', '35,000', - 'https://shopping-phinf.pstatic.net/main_8268689/82686894388.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8268689/82686894388.1.jpg', '35.566395785851398', '127.775478094034'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('석로주', '약주', '석이원주조', '13%', '멥쌀(국내산), 석이버섯(국내산), 정제수, 누룩(밀함유), 효모', '500ml', '대전 동구 송촌남로 13', '대전', '20000', - 'https://shopping-phinf.pstatic.net/main_8218985/82189853353.10.jpg'); + 'https://shopping-phinf.pstatic.net/main_8218985/82189853353.10.jpg', '36.353001326496198', '127.44133406344901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('예천주복 만월24', '일반증류주', '농업회사법인(주)착한농부', '24%', '복분자(국내산)증류원액, 복분자(국내산)과즙, 정제수', '350ml', '경북 예천군 용문면 복천길 16-8', - '경북', '12,800', 'https://shopping-phinf.pstatic.net/main_8250054/82500545211.4.jpg'); + price, image, latitude, longitude) +VALUES ('예천주복 만월24', '일반증류주', '농업회사법인(주)착한농부', '24%', '복분자(국내산)증류원액, 복분자(국내산)과즙, 정제수', '350ml', '경북 예천군 용문면 복천길 16-8', '경북', '12,800', + 'https://shopping-phinf.pstatic.net/main_8250054/82500545211.4.jpg', '36.687178399449699', '128.407192918866'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('담향 대대포 블루', '탁주', '농업회사법인 (주)죽향도가', '6%', '백미(국내산, 무기농 무농약), 벌꿀(국내산), 정제수', '600ml', '전남 담양군 담양읍 외다길30', '전남', - '4,000', 'https://shopping-phinf.pstatic.net/main_2885797/28857975589.20211202113023.jpg'); + price, image, latitude, longitude) +VALUES ('담향 대대포 블루', '탁주', '농업회사법인 (주)죽향도가', '6%', '백미(국내산, 무기농 무농약), 벌꿀(국내산), 정제수', '600ml', '전남 담양군 담양읍 외다길30', '전남', '4,000', + 'https://shopping-phinf.pstatic.net/main_2885797/28857975589.20211202113023.jpg', '35.320841904300799', '126.96358072111001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('혼디주', '과실주', '농업회사법인(주)시트러스', '12%', '감귤(제주산)100%, 정제수, 백설탕, 구연산, 무수아황산', '330ml', '제주특별자치도 서귀포시 남원읍 신례천로46', - '제주', '8,000', 'https://shopping-phinf.pstatic.net/main_2406701/24067016531.20200907122748.jpg'); + price, image, latitude, longitude) +VALUES ('혼디주', '과실주', '농업회사법인(주)시트러스', '12%', '감귤(제주산)100%, 정제수, 백설탕, 구연산, 무수아황산', '330ml', '제주특별자치도 서귀포시 남원읍 신례천로46', '제주', '8,000', + 'https://shopping-phinf.pstatic.net/main_2406701/24067016531.20200907122748.jpg', '33.286622663977703', '126.62495592789'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('안동소주 일품 21도', '증류식소주', '안동소주일품', '21%', '국내산 쌀, 입국', '350ml', '경북 안동시 풍산읍 괴정리 926-5번지', '경북', '13500', - 'https://shopping-phinf.pstatic.net/main_1211608/12116084874.20220817101130.jpg'); + 'https://shopping-phinf.pstatic.net/main_1211608/12116084874.20220817101130.jpg', '36.581512322914897', '128.52468486311301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('지평 생 쌀막걸리', '탁주', '지평주조', '5%', '쌀(국내산), 정제수, 국, 효모, 정제효소 등', '1.7L', '경기 양평군 지평면 지평의병로62번길 27', '경기', '2,700', - 'https://shopping-phinf.pstatic.net/main_8389643/83896434987.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8389643/83896434987.1.jpg', '37.474767429810399', '127.635337254996'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('만강에 비친 달', '탁주', '예술', '10%', '홍천 쌀, 정제수, 단호박, 곡자(밀 누룩)', '500ml', '강원도 홍천군 내촌면 물걸리 508-2', '강원', '12,000', - 'https://shopping-phinf.pstatic.net/main_1219695/12196952114.20170919174953.jpg'); + 'https://shopping-phinf.pstatic.net/main_1219695/12196952114.20170919174953.jpg', '37.794118721509101', '128.16925568029399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('회곡 생 막걸리', '탁주', '회곡양조장', '6%', '쌀, 입국, 누룩, 아스파탐, 효모, 정제수, 아세설팜칼륨', '750ml', '경상북도 안동시 풍산읍 산업단지 5길 39', '경북', - '1,300', 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg'); + price, image, latitude, longitude) +VALUES ('회곡 생 막걸리', '탁주', '회곡양조장', '6%', '쌀, 입국, 누룩, 아스파탐, 효모, 정제수, 아세설팜칼륨', '750ml', '경상북도 안동시 풍산읍 산업단지 5길 39', '경북', '1,300', + 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg', '36.602499222654203', '128.540009544139'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('아황주', '약주', '최행숙 전통주가', '17%', '찹쌀, 멥쌀, 누룩, 정제수', '500ml', '경기도 파주시 법원읍 사임당로 763', '경기', '23,000', - 'https://shopping-phinf.pstatic.net/main_4046434/40464340865.jpg'); + 'https://shopping-phinf.pstatic.net/main_4046434/40464340865.jpg', '37.8500082336259', '126.86550419641399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('운암1945', '약주', '농업회사법인 우포의아침 주식회사', '12%', '쌀(국내산), 누룩, 정제수', '750ml', '경상남도 창녕군 대지면 대지농공단지길 40', '경남', - '28,000', 'https://shopping-phinf.pstatic.net/main_8396478/83964785562.jpg'); + price, image, latitude, longitude) +VALUES ('운암1945', '약주', '농업회사법인 우포의아침 주식회사', '12%', '쌀(국내산), 누룩, 정제수', '750ml', '경상남도 창녕군 대지면 대지농공단지길 40', '경남', '28,000', + 'https://shopping-phinf.pstatic.net/main_8396478/83964785562.jpg', '35.537988437001097', '128.46041806824701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('한산소곡주', '살균약주', '한산소곡주', '18%', '찹쌀, 누룩, 백미, 정제수, 야국, 메주콩, 생강, 홍고추', '360ml', '충청남도 서천군 한산면 충절로 1118번지', '충남', - '6,500', 'https://shopping-phinf.pstatic.net/main_1195683/11956838281.20180327164858.jpg'); + price, image, latitude, longitude) +VALUES ('한산소곡주', '살균약주', '한산소곡주', '18%', '찹쌀, 누룩, 백미, 정제수, 야국, 메주콩, 생강, 홍고추', '360ml', '충청남도 서천군 한산면 충절로 1118번지', '충남', '6,500', + 'https://shopping-phinf.pstatic.net/main_1195683/11956838281.20180327164858.jpg', '36.0800411361503', '126.80234354141'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('옛날 막걸리 古', '탁주', '국순당', '7.8%', '배정제수, 쌀(국산), 국(밀), 과당, 효모 / 에탄올 함량 : 7.8%', '750ml', '강원도 횡성군 둔내면 강변로 975', - '강원', '2700', 'https://shopping-phinf.pstatic.net/main_8639598/86395989854.1.jpg'); + price, image, latitude, longitude) + ('옛날 막걸리 古', '탁주', '국순당', '7.8%', '배정제수, 쌀(국산), 국(밀), 과당, 효모 / 에탄올 함량 : 7.8%', '750ml', '강원도 횡성군 둔내면 강변로 975', '강원', '2700', + 'https://shopping-phinf.pstatic.net/main_8639598/86395989854.1.jpg', '37.488285940926602', '128.19734659608801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('명품 진도홍주', '일반증류주', '대대로영농조합법인', '38%', '쌀, 보리, 누룩, 지초, 정제수', '375ml', '전남 진도군 군내면 명량대첩로288-23', '전남', '20,000', - 'https://shopping-phinf.pstatic.net/main_2820873/28208737241.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_2820873/28208737241.1.jpg', '34.5524630981744', '126.303581332932'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('백련 생막걸리 Misty', '탁주', '신평양조장', '7%', '백미, 정제수, 물엿, 과당, 누룩, 백련잎, 누룩 등', '750ml', '충남 당진시 신평면 신평로 813', '충남', - '3,000', 'https://shopping-phinf.pstatic.net/main_1211592/12115926419.20170828151357.jpg'); + price, image, latitude, longitude) +VALUES ('백련 생막걸리 Misty', '탁주', '신평양조장', '7%', '백미, 정제수, 물엿, 과당, 누룩, 백련잎, 누룩 등', '750ml', '충남 당진시 신평면 신평로 813', '충남', '3,000', + 'https://shopping-phinf.pstatic.net/main_1211592/12115926419.20170828151357.jpg', '36.883595059409302', '126.77478495639301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('황금보리소주17', '증류식소주', '황금보리(유)농업회사법인', '17%', '보리, 누룩, 정제수', '375ml', '충남 홍성군 서부면 서부로 696', '충남', '25000', - 'https://shopping-phinf.pstatic.net/main_3888702/38887025618.20230324102338.jpg'); + 'https://shopping-phinf.pstatic.net/main_3888702/38887025618.20230324102338.jpg', '36.593712808577799', '126.511906219501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('죽향 생막걸리', '탁주', '농업회사법인 (주)죽향도가', '6%', '쌀(국내산), 정제효소, 젖산, 효모, 아스파탐, 정제수', '750ml', '전남 담양군 담양읍 외다길30', '전남', - '2,000', 'https://shopping-phinf.pstatic.net/main_3747392/37473929992.jpg'); + price, image, latitude, longitude) +VALUES ('죽향 생막걸리', '탁주', '농업회사법인 (주)죽향도가', '6%', '쌀(국내산), 정제효소, 젖산, 효모, 아스파탐, 정제수', '750ml', '전남 담양군 담양읍 외다길30', '전남', '2,000', + 'https://shopping-phinf.pstatic.net/main_3747392/37473929992.jpg', '35.320841904300799', '126.96358072111001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('지란지교 탁주', '탁주', '(유)친구들의술지란지교', '13%', '탁주 찹쌀(국내산), 멥쌀(국내산), 누룩(국내산), 정제수', '500ml', '전라북도 순창군 순창읍 순창7길 5-1', - '전북', '30000', 'https://shopping-phinf.pstatic.net/main_8388223/83882232244.1.jpg'); + price, image, latitude, longitude) +VALUES ('지란지교 탁주', '탁주', '(유)친구들의술지란지교', '13%', '탁주 찹쌀(국내산), 멥쌀(국내산), 누룩(국내산), 정제수', '500ml', '전라북도 순창군 순창읍 순창7길 5-1', '전북', '30000', + 'https://shopping-phinf.pstatic.net/main_8388223/83882232244.1.jpg', '35.374021302211197', '127.141767111218'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('진맥소주 22%', '증류식소주', '농업회사법인 (주)밀과노닐다', '22%', '유기농 우리밀 100%', '375ml', '경북 안동시 도산면 신성중앙길32', '경북', '22,000', - 'https://shopping-phinf.pstatic.net/main_8261583/82615831107.jpg'); + 'https://shopping-phinf.pstatic.net/main_8261583/82615831107.jpg', '36.765562810421997', '128.88020251773901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('타미앙스', '일반증류주', '추성고을', '40%', '쌀, 정제수, 누룩, 오미자, 구기자, 상심자, 갈근', '500 ml', '전남 담양군 용명 추령로 29', '전남', '50,000', - 'https://shopping-phinf.pstatic.net/main_8103617/81036179028.jpg'); + 'https://shopping-phinf.pstatic.net/main_8103617/81036179028.jpg', '35.3663541314138', '126.985321210495'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('병영소주', '증류식소주', '병영주조장', '40%', '정제수, 보리증류식 소주원액(보리 : 국내산)', '700ml', '전남 강진군 병영면 하멜로 407', '전남', '59,400', - 'https://shopping-phinf.pstatic.net/main_8530832/85308326956.jpg'); + 'https://shopping-phinf.pstatic.net/main_8530832/85308326956.jpg', '34.716166108572502', '126.814735606588'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('술취한 원숭이', '생탁주', '술샘', '10.8%', '쌀(국내산 경기미 100%), 누룩, 홍국, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', - '7,000', 'https://shopping-phinf.pstatic.net/main_1211592/12115929782.20220808143207.jpg'); + price, image, latitude, longitude) +VALUES ('술취한 원숭이', '생탁주', '술샘', '10.8%', '쌀(국내산 경기미 100%), 누룩, 홍국, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', '7,000', + 'https://shopping-phinf.pstatic.net/main_1211592/12115929782.20220808143207.jpg', '37.233502177738202', '127.298614632461'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('동몽', '약주', '예술', '17%', '홍천 쌀, 정제수, 단호박, 국(밀 누룩)', '500ml', '강원도 홍천군 내촌면 물걸리 508-2', '강원', '30,000', - 'https://shopping-phinf.pstatic.net/main_3649886/36498867082.20221214095937.jpg'); + 'https://shopping-phinf.pstatic.net/main_3649886/36498867082.20221214095937.jpg', '37.794118721509101', '128.16925568029399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('로얄 안동소주 18년', '증류식소주', '농업회사법인 유토피아(주)', '45%', '국내산 쌀, 입국', '600ml', '경북 안동시 남후면 광음리 1111-2', '경북', '72,000', - 'https://shopping-phinf.pstatic.net/main_2866984/28669848555.20210901145801.jpg'); + 'https://shopping-phinf.pstatic.net/main_2866984/28669848555.20210901145801.jpg', '36.502925619915899', '128.659360822503'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('부자 10', '살균탁주', '배혜정 도가', '10%', '쌀, 정제수, 고과당, 효모 등', '375ml', '경기도 화성시 정남면 문학리 674-23', '경기', '5,000', - 'https://shopping-phinf.pstatic.net/main_8494476/84944769554.jpg'); + 'https://shopping-phinf.pstatic.net/main_8494476/84944769554.jpg', '37.149336281531802', '126.960871275363'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('황진이', '살균약주', '농업회사법인(유)술소리', '12%', '쌀, 오미자, 산수유', '375ml', '전라북도 남원시 시묘길 130(오암동)', '전북', '3,500', - 'https://shopping-phinf.pstatic.net/main_1909443/19094430920.20190506160333.jpg'); + 'https://shopping-phinf.pstatic.net/main_1909443/19094430920.20190506160333.jpg', '35.384001729462199', '127.380353410198'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('문경바람 백자 25도', '일반증류주', '농업회사법인(주)제이엘', '25%', '사과(문경산)', '750ml / 375ml', '경북 문경시 문경읍 새재로 609', '경북', '30000', - 'https://shopping-phinf.pstatic.net/main_1406082/14060823947.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_1406082/14060823947.2.jpg', '36.736133308451798', '128.09134747187099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('대관령 복분자주', '과실주', '농업회사법인(주)홍지원', '16%', '국내산 복분자', '400ml', '강원도 평창군 평창읍 농공단지길 24-14', '강원', '13,000', - 'https://shopping-phinf.pstatic.net/main_8334773/83347735683.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8334773/83347735683.1.jpg', '37.3932858621638', '128.408644465745'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('고창복분자주300', '과실주', '농업회사법인 고창선운산(유)', '13%', '복분자과실, 주정, 효모, 구연산, 정제수', '300ml', '전북 고창군 심원면 심원로 270-73', '전북', - '50000', 'https://shopping-phinf.pstatic.net/main_8431116/84311161751.2.jpg'); + price, image, latitude, longitude) +VALUES ('고창복분자주300', '과실주', '농업회사법인 고창선운산(유)', '13%', '복분자과실, 주정, 효모, 구연산, 정제수', '300ml', '전북 고창군 심원면 심원로 270-73', '전북', '50000', + 'https://shopping-phinf.pstatic.net/main_8431116/84311161751.2.jpg', '35.526108261764499', '126.561553885392'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('봉하쌀 생막걸리', '탁주', '농업회사법인 (주)죽향도가', '6%', '쌀(국내산), 정제효소, 젖산, 효모, 아스파탐, 정제수', '750ml', '전남 담양군 담양읍 외다길30', '전남', - '2,000', 'https://shopping-phinf.pstatic.net/main_8279827/82798272182.6.jpg'); + price, image, latitude, longitude) +VALUES ('봉하쌀 생막걸리', '탁주', '농업회사법인 (주)죽향도가', '6%', '쌀(국내산), 정제효소, 젖산, 효모, 아스파탐, 정제수', '750ml', '전남 담양군 담양읍 외다길30', '전남', '2,000', + 'https://shopping-phinf.pstatic.net/main_8279827/82798272182.6.jpg', '35.320841904300799', '126.96358072111001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('연천 우주', '일반증류주', '농업회사법인 연천양조(주)', '22%', '쌀(국내산), 누룩, 효모, 효소, 연천율무, 정제수', '360ml', - '경기도 연천군 마산면 청정로 1738번길 15', '경기', '8,500', 'https://shopping-phinf.pstatic.net/main_3583685/35836859415.jpg'); + price, image, latitude, longitude) +VALUES ('연천 우주', '일반증류주', '농업회사법인 연천양조(주)', '22%', '쌀(국내산), 누룩, 효모, 효소, 연천율무, 정제수', '360ml', '경기도 연천군 마산면 청정로 1738번길 15', '경기', '8,500', + 'https://shopping-phinf.pstatic.net/main_3583685/35836859415.jpg', '38.0833213060315', '127.041489522638'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('명작복분자', '과실주', '(농)국순당고창명주(주)', '13%', '복분자, 효모, 주정, 정제수, 과당, 구연산', '375ml', '전북 고창군 심원면 선운대로 2197', '전북', - '78000', 'https://shopping-phinf.pstatic.net/main_3883241/38832413620.20230322155030.jpg'); + price, image, latitude, longitude) +VALUES ('명작복분자', '과실주', '(농)국순당고창명주(주)', '13%', '복분자, 효모, 주정, 정제수, 과당, 구연산', '375ml', '전북 고창군 심원면 선운대로 2197', '전북', '78000', + 'https://shopping-phinf.pstatic.net/main_3883241/38832413620.20230322155030.jpg', '35.540070746365302', '126.572620307829'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('문배술헤리티지25', '증류식소주', '문배주양조원', '25%', '메조, 찰수수, 쌀', '375ml', '경기도 김포시 통진읍 서암리 203-4', '경기', '55000', - 'https://shopping-phinf.pstatic.net/main_1190085/11900858087.20180404181559.jpg'); + 'https://shopping-phinf.pstatic.net/main_1190085/11900858087.20180404181559.jpg', '37.700682713839399', '126.59423705906001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('안동소주 일품 17도', '증류식소주', '안동소주일품', '17%', '국내산 쌀, 입국', '350ml', '경북 안동시 풍산읍 괴정리 926-5번지', '경북', '12000', - 'https://shopping-phinf.pstatic.net/main_3070141/30701414621.20220817101546.jpg'); + 'https://shopping-phinf.pstatic.net/main_3070141/30701414621.20220817101546.jpg', '36.581512322914897', '128.52468486311301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이화백주', '탁주', '이화백주 순탁주', '6%', '국내산 햅쌀, 전통 누룩, 정제수', '940ml', '경남 양산시 상북면 충렬로 941', '경남', '12,000', - 'https://shopping-phinf.pstatic.net/main_2867026/28670266557.20230404123654.jpg'); + 'https://shopping-phinf.pstatic.net/main_2867026/28670266557.20230404123654.jpg', '35.4230049501952', '129.060249869069'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('백운 복분자 와인', '기타주류', '농업회사법인(주)백운주가', '11%', '쌀, 토종 복분자과즙', '360ml', '전라남도 광양시 옥룡면 신재로 946-18', '전남', '7,000', - 'https://shopping-phinf.pstatic.net/main_8014701/80147019267.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8014701/80147019267.1.jpg', '35.042153812676503', '127.619908560813'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('고도리 복숭아와인', '과실주', '고도리 와이너리', '6.5%', '복숭아(경북 영천)', '750ml', '경북 영천시 고경면 고도리 494', '경북', '38,000', - 'https://shopping-phinf.pstatic.net/main_1302217/13022179363.5.jpg'); + 'https://shopping-phinf.pstatic.net/main_1302217/13022179363.5.jpg', '35.983168660140599', '128.998618766791'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('한비 무병장수술', '리큐르', '제천한약영농조합법인', '35%', '국내산쌀, 흑삼, 인삼, 오가피, 오미자, 구기자, 복분자, 차전자, 토사자, 산수유', '375ml / 750ml', - '충북 제천시 봉양읍 북부로 5길 16-10', '충북', '30000', 'https://shopping-phinf.pstatic.net/main_4070510/40705101227.jpg'); + price, image, latitude, longitude) +VALUES ('한비 무병장수술', '리큐르', '제천한약영농조합법인', '35%', '국내산쌀, 흑삼, 인삼, 오가피, 오미자, 구기자, 복분자, 차전자, 토사자, 산수유', '375ml / 750ml', '충북 제천시 봉양읍 북부로 5길 16-10', '충북', '30000', + 'https://shopping-phinf.pstatic.net/main_4070510/40705101227.jpg', '37.133529256317203', '128.08870720361699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('허니문와인', '기타주류', '아이비영농조합법인', '10%', '국내산 벌꿀', '375ml', '경기도 양평군 강하면 왕창부로길 110', '경기', '35,000', - 'https://shopping-phinf.pstatic.net/main_3912440/39124402619.20230403111510.jpg'); + 'https://shopping-phinf.pstatic.net/main_3912440/39124402619.20230403111510.jpg', '37.482277474707999', '127.40731816580301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('순향주', '약주', '(주)농업회사법인 추연당', '15%', '국내산 쌀, 누룩, 정제수', '375ml', '경기도 여주시 가남읍 금당리길 1-111', '경기', '56000', - 'https://shopping-phinf.pstatic.net/main_4003184/40031843845.20230516104624.jpg'); + 'https://shopping-phinf.pstatic.net/main_4003184/40031843845.20230516104624.jpg', '37.206353843422399', '127.608692438734'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('마주 소곡주', '약주', '옥순가 소곡주 마주', '16%', '찹쌀(국내산), 백미(국내산), 모싯잎, 우리밀 누룩, 정제수, 효모', '500ml', - '충청남도 서천군 서초면 시초동로 88-1', '충남', '17,000', 'https://shopping-phinf.pstatic.net/main_8232964/82329648424.2.jpg'); + price, image, latitude, longitude) +VALUES ('마주 소곡주', '약주', '옥순가 소곡주 마주', '16%', '찹쌀(국내산), 백미(국내산), 모싯잎, 우리밀 누룩, 정제수, 효모', '500ml', '충남 서천군 서천읍 서림로 19', '충남', '17,000', + 'https://shopping-phinf.pstatic.net/main_8232964/82329648424.2.jpg', '36.078030463952302', '126.70289727667399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이상헌 약주', '약주', '이가수불', '18%', '아산쌀, 국(국내산 밀누룩), 정제수', '500ml', '충남 아산시 도고면 기곡로 77번길 30-7', '충남', '45,000', - 'https://shopping-phinf.pstatic.net/main_3747385/37473853998.jpg'); + 'https://shopping-phinf.pstatic.net/main_3747385/37473853998.jpg', '36.760031579643702', '126.88363347823601'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('술샘 이화주', '탁주', '술샘', '8%', '쌀(국내산 경기미 100%), 누룩, 정제수', '100ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', '7,600', - 'https://shopping-phinf.pstatic.net/main_1211593/12115939843.20220817003133.jpg'); + 'https://shopping-phinf.pstatic.net/main_1211593/12115939843.20220817003133.jpg', '37.233502177738202', '127.298614632461'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('해창 생 막걸리 12도', '탁주', '해창주조장', '12%', '햅쌀, 찹쌀, 물, 누룩', '900ml', '전남 해남군 화산면 해창길1', '전남', '10,000', - 'https://shopping-phinf.pstatic.net/main_4009970/40099701717.jpg'); + 'https://shopping-phinf.pstatic.net/main_4009970/40099701717.jpg', '34.517616531498902', '126.53811119380801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('구름을 벗삼아', '탁주', '문경주조', '6%', '정제수, 찹쌀·백미(국내산햅쌀 100%), 입국 등', '750ml', '경북 문경시 동로면 노은2리 49-15', '경북', '1,500', - 'https://shopping-phinf.pstatic.net/main_8231137/82311378468.jpg'); + price, image, latitude, longitude) +VALUES ('구름을 벗삼아', '탁주', '문경주조', '6%', '정제수, 찹쌀·백미(국내산햅쌀 100%), 입국 등', '750ml', '경북 문경시 동로면 노은1길 49-15', '경북', '1,500', + 'https://shopping-phinf.pstatic.net/main_8231137/82311378468.jpg', '36.772205009239599', '128.314028995874'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('허니비 와인', '기타주류', '아이비영농조합법인', '8%', '국내산 벌꿀', '500ml', '경기도 양평군 강하면 왕창부로길 110', '경기', '35,000', - 'https://shopping-phinf.pstatic.net/main_3912447/39124472618.20230403112002.jpg'); + 'https://shopping-phinf.pstatic.net/main_3912447/39124472618.20230403112002.jpg', '37.482277474707999', '127.40731816580301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('풍정사계 동', '증류식소주', '농업회사법인(유)화양', '42%, 25%', '국내산찹살, 향온곡', '375ml', '충북 청주시 청원구 내수읍 풍정1길 8-4', '충북', '25000', - 'https://shopping-phinf.pstatic.net/main_8506016/85060161938.jpg'); + 'https://shopping-phinf.pstatic.net/main_8506016/85060161938.jpg', '36.701814585674001', '127.54556270058499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('려(驪)증류소주 25도', '증류식소주', '(농)국순당 여주명주(주)', '25%', '고구마(여주산 100%), 쌀(여주산 100%)', '375ml / 500ml', - '경기도 여주시 강천면 부평로 330', '경기', '30,000', - 'https://shopping-phinf.pstatic.net/main_2013736/20137360521.20190709103019.jpg'); + price, image, latitude, longitude) +VALUES ('려(驪)증류소주 25도', '증류식소주', '(농)국순당 여주명주(주)', '25%', '고구마(여주산 100%), 쌀(여주산 100%)', '375ml / 500ml', '경기도 여주시 강천면 부평로 330', '경기', '30,000', + 'https://shopping-phinf.pstatic.net/main_2013736/20137360521.20190709103019.jpg', '37.281144440518297', '127.74262548642'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('감사', '약주', '술샘', '14%', '쌀(국내산 경기미 100%), 누룩, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', '15,000', - 'https://shopping-phinf.pstatic.net/main_8409654/84096544142.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8409654/84096544142.2.jpg', '37.233502177738202', '127.298614632461'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('해창 생 막걸리 9도', '탁주', '해창주조장', '9%', '햅쌀, 찹쌀, 물, 누룩', '900ml', '전남 해남군 화산면 해창길1', '전남', '6,000', - 'https://shopping-phinf.pstatic.net/main_4009977/40099775192.jpg'); + 'https://shopping-phinf.pstatic.net/main_4009977/40099775192.jpg', '34.517616531498902', '126.53811119380801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('고운달 백자', '일반증류주', '농업회사법인(주)제이엘', '52%', '오미자(문경산)', '500ml / 200ml', '경북 문경시 문경읍 새재로 609', '경북', '360000', - 'https://shopping-phinf.pstatic.net/main_3405635/34056350026.jpg'); + 'https://shopping-phinf.pstatic.net/main_3405635/34056350026.jpg', '36.736133308451798', '128.09134747187099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('신례명주', '일반증류주', '농업회사법인(주)시트러스', '50%', '감귤(제주산)100%, 감귤 증류주 100%', '750ml', '제주특별자치도 서귀포시 남원읍 신례천로46', '제주', - '99,000', 'https://shopping-phinf.pstatic.net/main_3885455/38854552619.20230323152845.jpg'); + price, image, latitude, longitude) +VALUES ('신례명주', '일반증류주', '농업회사법인(주)시트러스', '50%', '감귤(제주산)100%, 감귤 증류주 100%', '750ml', '제주특별자치도 서귀포시 남원읍 신례천로46', '제주', '99,000', + 'https://shopping-phinf.pstatic.net/main_3885455/38854552619.20230323152845.jpg', '33.286622663977703', '126.62495592789'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('맑은내일 발효막걸리', '탁주', '농업회사법인 우포의아침(주)', '7%', '쌀(국내산), 누룩, 효소, 아스파탐, 정제수', '750ml / 1,000ml', - '(1공장) 경남 창녕군 대지면 대지농공단지길 40, (2공장) 경남 창원시 의창군 북면 천주로 1173번길29', '경남', '2200', - 'https://shopping-phinf.pstatic.net/main_4022712/40227121945.jpg'); + price, image, latitude, longitude) +VALUES ('맑은내일 발효막걸리', '탁주', '농업회사법인 우포의아침(주)', '7%', '쌀(국내산), 누룩, 효소, 아스파탐, 정제수', '750ml / 1,000ml', '경남 창원시 의창군 북면 천주로 1173번길29', '경남', '2200', + 'https://shopping-phinf.pstatic.net/main_4022712/40227121945.jpg', '35.537988437001097', '128.46041806824701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('맑은내일 Winery 단감명작', '과실주', '농업회사법인 우포의아침 주식회사', '7%', - '단감(국내산_창녕), 정제수, 설탕, 효소제, 무수구연산, 효모, 무수아황산(산아방지제), 소브산(보존료)', '750ml', '경상남도 창녕군 대지면 대지농공단지길 40', '경남', - '20,000', 'https://shopping-phinf.pstatic.net/main_3965798/39657983101.jpg'); + price, image, latitude, longitude) +VALUES ('맑은내일 Winery 단감명작', '과실주', '농업회사법인 우포의아침 주식회사', '7%', '단감(국내산_창녕), 정제수, 설탕, 효소제, 무수구연산, 효모, 무수아황산(산아방지제), 소브산(보존료)', '750ml', '경상남도 창녕군 대지면 대지농공단지길 40', '경남', '20,000', + 'https://shopping-phinf.pstatic.net/main_3965798/39657983101.jpg', '35.537988437001097', '128.46041806824701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('가평 잣 막걸리', '탁주', '가평 우리술', '6%', '쌀, 정제수, 쌀입국, 잣, 효모, 정제효소 등', '750ml', '경기도 가평군 조종면 대보간선로 26, 29', '경기', - '1,450', 'https://shopping-phinf.pstatic.net/main_8596979/85969794780.1.jpg'); + price, image, latitude, longitude) +VALUES ('가평 잣 막걸리', '탁주', '가평 우리술', '6%', '쌀, 정제수, 쌀입국, 잣, 효모, 정제효소 등', '750ml', '경기도 가평군 조종면 대보간선로 29', '경기', '1,450', + 'https://shopping-phinf.pstatic.net/main_8596979/85969794780.1.jpg', '37.8198965463965', '127.356241651869'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('담은', '생막걸리', '(주)1932 포천일동막걸리', '6.5%', '쌀(국내산), 입국, 효모, 고과당, 정제효소제, 정제수', '750ml', '경기도 포천시 일동면 운악청계로 1597', - '경기', '33,000', 'https://shopping-phinf.pstatic.net/main_1909157/19091579927.20200310102023.jpg'); + price, image, latitude, longitude) +VALUES ('담은', '생막걸리', '(주)1932 포천일동막걸리', '6.5%', '쌀(국내산), 입국, 효모, 고과당, 정제효소제, 정제수', '750ml', '경기도 포천시 일동면 운악청계로 1597', '경기', '33,000', + 'https://shopping-phinf.pstatic.net/main_1909157/19091579927.20200310102023.jpg', '37.945460025718802', '127.333298092871'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('자연송이주', '리큐르', '솔래원', '18%', '자연송이버섯', '720ml', '강원도 양구군 방산면 칠전길 12-7', '강원', '32900', - 'https://shopping-phinf.pstatic.net/main_9285436/9285436647.jpg'); + 'https://shopping-phinf.pstatic.net/main_9285436/9285436647.jpg', '38.207246944746402', '127.946933432465'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('맑은 문희주', '약주', '문경주조', '13%', '유기농찹쌀 (국산), 멥쌀 (국산), 전통누룩 (우리 밀), 정제수', '750ml', '경북 문경시 동로면 노은2리 49-15', '경북', - '36,000', 'https://shopping-phinf.pstatic.net/main_8002099/80020994487.2.jpg'); + price, image, latitude, longitude) +VALUES ('맑은 문희주', '약주', '문경주조', '13%', '유기농찹쌀 (국산), 멥쌀 (국산), 전통누룩 (우리 밀), 정제수', '750ml', '경북 문경시 동로면 노은1길 49-15', '경북', '36,000', + 'https://shopping-phinf.pstatic.net/main_8002099/80020994487.2.jpg', '36.772205009239599', '128.314028995874'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('레돔 내추럴 스파클링 로제와인', '과실주', '농업회사법인 작은알자스', '7.5%', '포도(99.99%)', '750ml', '충북 충주시 엄정면 도자기길 32', '충북', '38,000', - 'https://shopping-phinf.pstatic.net/main_8162791/81627914817.jpg'); + 'https://shopping-phinf.pstatic.net/main_8162791/81627914817.jpg', '37.093309059214498', '127.942510060773'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('자연담은 복분자막걸리', '살균탁주', '(농)국순당고창명주(주)', '6%', '복분자, 쌀, 효모, 국, 과당, 구연산, 젖산, 정제수', '360ml', - '전북 고창군 심원면 선운대로 2197', '전북', '56,000(360ml*20병)', - 'https://shopping-phinf.pstatic.net/main_3280585/32805854618.20220608125405.jpg'); + price, image, latitude, longitude) +VALUES ('자연담은 복분자막걸리', '살균탁주', '(농)국순당고창명주(주)', '6%', '복분자, 쌀, 효모, 국, 과당, 구연산, 젖산, 정제수', '360ml', '전북 고창군 심원면 선운대로 2197', '전북', '56,000(360ml*20병)', + 'https://shopping-phinf.pstatic.net/main_3280585/32805854618.20220608125405.jpg', '35.540070746365302', '126.572620307829'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('청명주 500', '약주', '중원당', '17%', '국내산 찹쌀, 누룩, 소맥분', '500ml', '충북 충주시 중앙탑면 청금로 112-10', '충북', '23,000', - 'https://shopping-phinf.pstatic.net/main_1258843/12588430168.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_1258843/12588430168.1.jpg', '36.997313189936698', '127.87882984338'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('우곡생주', '탁주', '배혜정도가', '10%', '쌀(국내산), 국, 효모, 정제수', '750ml', '경기도 화성시 정남면 문학리 674-23', '경기', '6,500', - 'https://shopping-phinf.pstatic.net/main_2771384/27713845522.20210628113829.jpg'); + 'https://shopping-phinf.pstatic.net/main_2771384/27713845522.20210628113829.jpg', '37.149336281531802', '126.960871275363'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('원조 한산소곡주', '약주', '원조소곡주', '16%', '찹쌀, 멥쌀, 누룩, 대두, 구절초', '750ml', '충남 서천군 한산면 한마로34', '충남', '12,000', - 'https://shopping-phinf.pstatic.net/main_8210432/82104322978.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8210432/82104322978.1.jpg', '36.085936043534602', '126.806392031538'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('황금보리소주40', '증류식소주', '황금보리(유)농업회사법인', '40%', '보리, 누룩, 정제수', '375ml', '충남 홍성군 서부면 서부로 696', '충남', '78500', - 'https://shopping-phinf.pstatic.net/main_3915047/39150476620.20230404103322.jpg'); + 'https://shopping-phinf.pstatic.net/main_3915047/39150476620.20230404103322.jpg', '36.593712808577799', '126.511906219501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('고창선운산 땡큐블루베리주', '과실주', '농업회사법인 고창선운산(유)', '13%', '블루베리과실, 주정, 효모, 구연산, 정제수', '300ml', '전북 고창군 심원면 심원로 270-73', - '전북', '60000', 'https://shopping-phinf.pstatic.net/main_8544724/85447249278.jpg'); + price, image, latitude, longitude) +VALUES ('고창선운산 땡큐블루베리주', '과실주', '농업회사법인 고창선운산(유)', '13%', '블루베리과실, 주정, 효모, 구연산, 정제수', '300ml', '전북 고창군 심원면 심원로 270-73', '전북', '60000', + 'https://shopping-phinf.pstatic.net/main_8544724/85447249278.jpg', '35.526108261764499', '126.561553885392'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('삼양춘 청주', '청주', '송도향전통주조', '15%', '강화섬쌀, 정제수, 백국, 황국, 전통누룩, 토종효모', '500ml', '인천광역시 남동구 호구포로 50, 8층 819-1호', - '인천', '16,800', 'https://shopping-phinf.pstatic.net/main_8262713/82627133799.1.jpg'); + price, image, latitude, longitude) +VALUES ('삼양춘 청주', '청주', '송도향전통주조', '15%', '강화섬쌀, 정제수, 백국, 황국, 전통누룩, 토종효모', '500ml', '인천광역시 남동구 호구포로 50, 8층 819-1호', '인천', '16,800', + 'https://shopping-phinf.pstatic.net/main_8262713/82627133799.1.jpg', '37.389117652051702', '126.700781786467'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('홍로', '증류주', '영농조합법인 석전상온전통주가', '45%', '백련, 찹쌀, 멥쌀, 누룩, 자초', '500ml', '경북 칠곡군 왜관읍 동산2길19', '경북', '50,000', - 'https://shopping-phinf.pstatic.net/main_8010228/80102288884.15.jpg'); + 'https://shopping-phinf.pstatic.net/main_8010228/80102288884.15.jpg', '35.9969329267036', '128.409161576504'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('진맥소주 40%', '증류식소주', '농업회사법인 (주)밀과노닐다', '40%', '유기농 우리밀 100%', '200ml / 500ml', '경북 안동시 도산면 신성중앙길32', '경북', - '22000', 'https://shopping-phinf.pstatic.net/main_8261580/82615809115.jpg'); + price, image, latitude, longitude) +VALUES ('진맥소주 40%', '증류식소주', '농업회사법인 (주)밀과노닐다', '40%', '유기농 우리밀 100%', '200ml / 500ml', '경북 안동시 도산면 신성중앙길32', '경북', '22000', + 'https://shopping-phinf.pstatic.net/main_8261580/82615809115.jpg', '36.765562810421997', '128.88020251773901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이강주 2호', '리큐르', '전주 이강주', '25%', '쌀, 소맥분, 정맥, 배, 생강, 계피, 울금, 꿀', '750ml', '전주시 덕진구 매암길 28', '전주', '28,000', - 'https://shopping-phinf.pstatic.net/main_2886005/28860053586.20210915172701.jpg'); + 'https://shopping-phinf.pstatic.net/main_2886005/28860053586.20210915172701.jpg', '35.8734330016797', '127.027053333515'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('오매락퍽', '리큐르', '(주)배상면주가', '40%', '구운매실, 배증류원액', '500ml', '경기도 포천시 화현면 화동로 432번길 25', '경기', '52,000', - 'https://shopping-phinf.pstatic.net/main_3373822/33738227713.jpg'); + 'https://shopping-phinf.pstatic.net/main_3373822/33738227713.jpg', '37.905995687213199', '127.30990487507501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('안동소주 22도', '증류식소주', '명인 안동소주', '22%', '쌀(국내산), 누룩, 정제수', '360ml', '경북 안동시 풍산읍 산업단지6길 6', '경북', '27000', - 'https://shopping-phinf.pstatic.net/main_1211612/12116122428.20170919172822.jpg'); + 'https://shopping-phinf.pstatic.net/main_1211612/12116122428.20170919172822.jpg', '36.603877947741999', '128.54135891751901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('우도 땅콩 전통주', '기타주류', '조은술 세종', '6%', '정제수, 전분당, 백미, 국, 땅콩분, 효모, 젖산 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', - '4,000', 'https://shopping-phinf.pstatic.net/main_8216453/82164530421.1.jpg'); + price, image, latitude, longitude) +VALUES ('우도 땅콩 전통주', '기타주류', '조은술 세종', '6%', '정제수, 전분당, 백미, 국, 땅콩분, 효모, 젖산 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '4,000', + 'https://shopping-phinf.pstatic.net/main_8216453/82164530421.1.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('그랑꼬또 청수', '과실주', '그린영농조합법인', '12%', '포도(청수)', '750ml', '경기도 안산시 단원구 뻐꾹산길 107(대부북동)', '경기', '73,500', - 'https://shopping-phinf.pstatic.net/main_8265135/82651356839.4.jpg'); + 'https://shopping-phinf.pstatic.net/main_8265135/82651356839.4.jpg', '37.257471389325403', '126.582545230378'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('소백산 생 막걸리', '탁주', '대강양조장', '6%', '쌀, 정제수, 소맥분, 입국, 효모 등', '1,700ml, 750ml', '충북 단양군 대강면 장림리 113-7', '충북', - '1,980', 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg'); + price, image, latitude, longitude) +VALUES ('소백산 생 막걸리', '탁주', '대강양조장', '6%', '쌀, 정제수, 소맥분, 입국, 효모 등', '1,700ml, 750ml', '충북 단양군 대강면 장림리 113-7', '충북', '1,980', + 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg', '36.922265636051897', '128.353720606488'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('청춘', '청주', '농업회사법인신탄진주조(주)', '15%', '쌀, 누룩, 정제수', '750ml', '대전시 대덕구 신탄진로 738번길 128', '대전', '20,000', - 'https://shopping-phinf.pstatic.net/main_8564119/85641193309.jpg'); + 'https://shopping-phinf.pstatic.net/main_8564119/85641193309.jpg', '36.439741971840697', '127.434134455764'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('문배술 헤리티지 40도', '증류식소주', '문배주양조원', '40%', '메조, 찰수수, 쌀', '200ml', '경기도 김포시 통진읍 서암리 203-4', '경기', '48000', - 'https://shopping-phinf.pstatic.net/main_8210571/82105716672.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8210571/82105716672.1.jpg', '37.700682713839399', '126.59423705906001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('복분자음', '과실주', '농업회사법인 배상면주가 고창LB', '12%', '복분자(국내산), 정제수', '375ml', '전북 고창군 아산면 병암길 48', '전북', '6,000', - 'https://shopping-phinf.pstatic.net/main_1194873/11948737391.20180103172816.jpg'); + 'https://shopping-phinf.pstatic.net/main_1194873/11948737391.20180103172816.jpg', '35.477708368498803', '126.62313871901399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('톡 한잔 소주', '증류식소주', '농업회사법인(유)대마주조', '30%', '찰보리 90%, 쌀 10%', '500ml', '전라남도 영광군 대마면 동삼로 699', '전남', '10,000', - 'https://shopping-phinf.pstatic.net/main_4037697/40376974318.jpg'); + 'https://shopping-phinf.pstatic.net/main_4037697/40376974318.jpg', '35.300699106384201', '126.579745972528'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('추사 애플와인', '과실주', '예산사과와인(주)', '12%', '사과(국내산)', '375ml', '충남 예산군 고덕면 대몽로 107-25', '충남', '20,000', - 'https://shopping-phinf.pstatic.net/main_3762808/37628081426.jpg'); + 'https://shopping-phinf.pstatic.net/main_3762808/37628081426.jpg', '36.761850437703899', '126.698077768781'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('한주', '증류식소주', '한주양조', '35%', '국내산 쌀, 밀누룩, 정제수', '360ml', '경기도 안성시 서운면 서운로 241-14', '경기', '12,000', - 'https://shopping-phinf.pstatic.net/main_2406934/24069344528.20200907174838.jpg'); + 'https://shopping-phinf.pstatic.net/main_2406934/24069344528.20200907174838.jpg', '36.936010993671403', '127.261043638914'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('김포약주 PET', '살균약주', '김포양조', '11%', '옥수수 전분, 밀, 국, 효모, 젖산, 효소제, 정제수', '750ml', '경기도 김포시 월곶면 김포대로 2763', '경기', - '9,000', 'https://shopping-phinf.pstatic.net/main_2982472/29824727349.20211125021109.jpg'); + price, image, latitude, longitude) +VALUES ('김포약주 PET', '살균약주', '김포양조', '11%', '옥수수 전분, 밀, 국, 효모, 젖산, 효소제, 정제수', '750ml', '경기도 김포시 월곶면 김포대로 2763', '경기', '9,000', + 'https://shopping-phinf.pstatic.net/main_2982472/29824727349.20211125021109.jpg', '37.711509317937598', '126.546803490044'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('배도가 로아 40도 옐로우', '일반증류주', '배혜정 도가', '40%', '쌀(국산), 배(국산)', '350ml', '경기도 화성시 정남면 문학리 674-23', '경기', '20,000', - 'https://shopping-phinf.pstatic.net/main_3315711/33157111621.20220627141944.jpg'); + 'https://shopping-phinf.pstatic.net/main_3315711/33157111621.20220627141944.jpg', '37.149336281531802', '126.960871275363'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('호모루덴스', '탁주', '농업회사법인(주)산수', '12%', '쌀, 누룩, 정제수', '500ml', '강원도 홍천군 화촌면 야시대로 211-57', '강원', '12,000', - 'https://shopping-phinf.pstatic.net/main_4104843/41048434554.jpg'); + 'https://shopping-phinf.pstatic.net/main_4104843/41048434554.jpg', '37.796095256391098', '127.967935231575'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('강소주', '일반증류주', '내국양조', '50%', '국내산 쌀, 정제수', '200ml / 1,800ml', '충남 논산시 연무읍 마종로 361', '충남', '11000', - 'https://shopping-phinf.pstatic.net/main_8234327/82343276907.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8234327/82343276907.1.jpg', '36.111715028494103', '127.06884996469'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('송이주', '살균약주', '내국양조', '13%', '국내산 쌀, 송이농충액, 누룩, 정제수', '375ml', '충남 논산시 연무읍 마종로 361', '충남', '12,000', - 'https://shopping-phinf.pstatic.net/main_8238111/82381113081.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8238111/82381113081.1.jpg', '36.111715028494103', '127.06884996469'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('고창복분자주1800', '과실주', '농업회사법인 고창선운산(유)', '15%', '복분자과실, 주정, 효모, 구연산, 정제수', '1,800ml', '전북 고창군 심원면 심원로 270-73', - '전북', '27,000', 'https://shopping-phinf.pstatic.net/main_2127671/21276710415.20191111114109.jpg'); + price, image, latitude, longitude) +VALUES ('고창복분자주1800', '과실주', '농업회사법인 고창선운산(유)', '15%', '복분자과실, 주정, 효모, 구연산, 정제수', '1,800ml', '전북 고창군 심원면 심원로 270-73', '전북', '27,000', + 'https://shopping-phinf.pstatic.net/main_2127671/21276710415.20191111114109.jpg', '35.526108261764499', '126.561553885392'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('여포의 꿈 (레드 드라이)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '750ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', - '20,000', 'https://shopping-phinf.pstatic.net/main_3258227/32582279479.1.jpg'); + price, image, latitude, longitude) +VALUES ('여포의 꿈 (레드 드라이)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '750ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', '20,000', + 'https://shopping-phinf.pstatic.net/main_3258227/32582279479.1.jpg', '36.126228935186901', '127.744545237346'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('레돔 시드르', '과실주', '농업회사법인 작은알자스', '6%', '사과(100%)', '750ml', '충북 충주시 엄정면 도자기길 32', '충북', '32,000', - 'https://shopping-phinf.pstatic.net/main_8162785/81627858861.jpg'); + 'https://shopping-phinf.pstatic.net/main_8162785/81627858861.jpg', '37.093309059214498', '127.942510060773'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('어우야', '기타주류', '왕지케양조장 (제주본초협동조합)', '16%', '야관문(제주산), 정제수, 포도당, 효모', '365ml', '제주특별자치도 제주시 한경면 고산로 2길 22-13', - '제주', '9,900', 'https://shopping-phinf.pstatic.net/main_3967489/39674895697.jpg'); + price, image, latitude, longitude) +VALUES ('어우야', '기타주류', '왕지케양조장 (제주본초협동조합)', '16%', '야관문(제주산), 정제수, 포도당, 효모', '365ml', '제주특별자치도 제주시 한경면 고산로 2길 22-13', '제주', '9,900', + 'https://shopping-phinf.pstatic.net/main_3967489/39674895697.jpg', '33.302547681846399', '126.182306376797'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('술공방 9.0 생막걸리', '탁주', '두이술공방', '9%', '쌀(국내산), 밀누룩(국내산), 국, 효모, 효소, 올리고당', '500ml', '충남 청양군 대치면 방죽골길 46-19', - '충남', '5000', 'https://shopping-phinf.pstatic.net/main_3315474/33154748619.20220627112444.jpg'); + price, image, latitude, longitude) +VALUES ('술공방 9.0 생막걸리', '탁주', '두이술공방', '9%', '쌀(국내산), 밀누룩(국내산), 국, 효모, 효소, 올리고당', '500ml', '충남 청양군 대치면 방죽골길 46-19', '충남', '5000', + 'https://shopping-phinf.pstatic.net/main_3315474/33154748619.20220627112444.jpg', '36.469465990120199', '126.841460370935'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('정고집 나주쌀 생막걸리', '탁주', '남도탁주', '6%', '쌀, 쌀가루(국내산), 조제종국, 정제효소, 젖산, 아스파탐, 아세셀팜칼', '750ml', '전남 나주시 노안면 노안로379', - '전남', '12,000(750ml*10병)', 'https://shopping-phinf.pstatic.net/main_4008396/40083968821.jpg'); + price, image, latitude, longitude) +VALUES ('정고집 나주쌀 생막걸리', '탁주', '남도탁주', '6%', '쌀, 쌀가루(국내산), 조제종국, 정제효소, 젖산, 아스파탐, 아세셀팜칼', '750ml', '전남 나주시 노안면 노안로379', '전남', '12,000(750ml*10병)', + 'https://shopping-phinf.pstatic.net/main_4008396/40083968821.jpg', '35.071896829590898', '126.734271400304'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('도깨비술 7%', '탁주', '농업회사법인 (주)도깨비양조장', '7%', '멥쌀(국내산), 누룩, 효모, 정제수', '750ml', '충북 단양군 가곡면 사평3길 5', '충북', '8,000', - 'https://shopping-phinf.pstatic.net/main_8222112/82221128958.jpg'); + 'https://shopping-phinf.pstatic.net/main_8222112/82221128958.jpg', '37.026388066216199', '128.38473760987199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('그랑꼬또 레드와인', '과실주', '그린영농조합법인', '12%', '포도(캠벨얼리)', '750ml', '경기도 안산시 단원구 뻐꾹산길 107(대부북동)', '경기', '35,000', - 'https://shopping-phinf.pstatic.net/main_1316682/13166821201.6.jpg'); + 'https://shopping-phinf.pstatic.net/main_1316682/13166821201.6.jpg', '37.257471389325403', '126.582545230378'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('희양산막걸리 15%', '탁주', '두술도가', '15%', '쌀(국내산), 누룩, 정제수', '500ml', '경북 문경시 가은읍 가은5길 7', '경북', '9,500', - 'https://shopping-phinf.pstatic.net/main_3585687/35856875901.jpg'); + 'https://shopping-phinf.pstatic.net/main_3585687/35856875901.jpg', '36.646609268067202', '128.060988946648'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('막시모40', '일반증류주', '농업회사법인(주)착한농부', '40%', '오미자(국내산)증류원액, 오미자(국내산)원액, 정제수', '500ml', '경북 예천군 용문면 복천길 16-8', '경북', - '49,000', 'https://shopping-phinf.pstatic.net/main_8532987/85329879795.jpg'); + price, image, latitude, longitude) +VALUES ('막시모40', '일반증류주', '농업회사법인(주)착한농부', '40%', '오미자(국내산)증류원액, 오미자(국내산)원액, 정제수', '500ml', '경북 예천군 용문면 복천길 16-8', '경북', '49,000', + 'https://shopping-phinf.pstatic.net/main_8532987/85329879795.jpg', '36.687178399449699', '128.407192918866'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('유기농 이도14', '약주', '농업회사법인 조은술세종(주)', '14%', '유기농쌀(국내산), 우리밀누룩, 조제종국, 효모, 정제수', '750ml', - '충북 청주시 청원구 사천로 18번길 5-2', '충북', '20,000', - 'https://shopping-phinf.pstatic.net/main_3883314/38833145622.20230322155810.jpg'); + price, image, latitude, longitude) +VALUES ('유기농 이도14', '약주', '농업회사법인 조은술세종(주)', '14%', '유기농쌀(국내산), 우리밀누룩, 조제종국, 효모, 정제수', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '20,000', + 'https://shopping-phinf.pstatic.net/main_3883314/38833145622.20230322155810.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('유기농 이도 42', '증류식소주', '조은술 세종', '42%', '유기농쌀 (100%), 정제수, 증류원액, 국, 조제종국, 효모 등', '750ml', - '충북 청주시 청원구 사천로 18번길 5-2', '충북', '42,000', 'https://shopping-phinf.pstatic.net/main_8200977/82009775191.jpg'); + price, image, latitude, longitude) +VALUES ('유기농 이도 42', '증류식소주', '조은술 세종', '42%', '유기농쌀 (100%), 정제수, 증류원액, 국, 조제종국, 효모 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '42,000', + 'https://shopping-phinf.pstatic.net/main_8200977/82009775191.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('려(驪)고구마증류소주 25도', '증류식소주', '(농)국순당 여주명주(주)', '25%', '고구마(여주산 100%)', '500ml', '경기도 여주시 강천면 부평로 330', '경기', - '35000', 'https://shopping-phinf.pstatic.net/main_2013736/20137360521.20190709103019.jpg'); + price, image, latitude, longitude) +VALUES ('려(驪)고구마증류소주 25도', '증류식소주', '(농)국순당 여주명주(주)', '25%', '고구마(여주산 100%)', '500ml', '경기도 여주시 강천면 부평로 330', '경기', '35000', + 'https://shopping-phinf.pstatic.net/main_2013736/20137360521.20190709103019.jpg', '37.281144440518297', '127.74262548642'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('양촌 우렁이쌀 손 막걸리', '탁주', '양촌양조', '7.5%', '쌀, 정제수 효모, 정제효소, 효소처리 스테비아', '750ml', '충남 논산시 양촌면 매죽헌로 1665번길 14-7', - '충남', '39000', 'https://shopping-phinf.pstatic.net/main_3599373/35993735067.jpg'); + price, image, latitude, longitude) +VALUES ('양촌 우렁이쌀 손 막걸리', '탁주', '양촌양조', '7.5%', '쌀, 정제수 효모, 정제효소, 효소처리 스테비아', '750ml', '충남 논산시 양촌면 매죽헌로 1665번길 14-7', '충남', '39000', + 'https://shopping-phinf.pstatic.net/main_3599373/35993735067.jpg', '36.1380648488284', '127.234326485841'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('진도홍주 루비콘', '리큐르', '대대로영농조합법인', '40%', '쌀, 누룩, 지초, 정제수', '375ml', '전남 진도군 군내면 명량대첩로288-23', '전남', '10,000', - 'https://shopping-phinf.pstatic.net/main_3536976/35369769142.jpg'); + 'https://shopping-phinf.pstatic.net/main_3536976/35369769142.jpg', '34.5524630981744', '126.303581332932', ); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('무주 구천동 머루와인', '과실주', '덕유양조', '12%', '국내산 산머루', '750ml', '전북 무주군 안성면 장무로 1375-7', '전북', '25,000', - 'https://shopping-phinf.pstatic.net/main_1258843/12588431043.3.jpg'); + 'https://shopping-phinf.pstatic.net/main_1258843/12588431043.3.jpg', '35.814874542122503', '127.63055424029299'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('야관문 쌀 막걸리', '탁주', '지리산그린영농조합 운봉주조', '6%', '쌀(국내산), 종국, 정제수, 누룩, 효모, 야관문', '750ml', '전라북도 남원시 운봉읍 황산로 1018', - '전북', '1,500', 'https://shopping-phinf.pstatic.net/main_8305511/83055112252.jpg'); + price, image, latitude, longitude) +VALUES ('야관문 쌀 막걸리', '탁주', '지리산그린영농조합 운봉주조', '6%', '쌀(국내산), 종국, 정제수, 누룩, 효모, 야관문', '750ml', '전라북도 남원시 운봉읍 황산로 1018', '전북', '1,500', + 'https://shopping-phinf.pstatic.net/main_8305511/83055112252.jpg', '35.437291911597697', '127.524013307426'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('매실 막걸리', '살균탁주', '농업회사법인(주)백운주가', '7%', '쌀, 매실과즙', '750ml', '전라남도 광양시 옥룡면 신재로 946-18', '전남', '3,500', - 'https://shopping-phinf.pstatic.net/main_8529129/85291297389.jpg'); + 'https://shopping-phinf.pstatic.net/main_8529129/85291297389.jpg', '35.042153812676503', '127.619908560813'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('소백산 검은콩 막걸리', '탁주', '대강양조장', '6%', '백미, 소맥분, 검은콩, 검은깨 등', '1,500ml, 1,200ml, 750ml', '충북 단양군 대강면 장림리 113-7', - '충북', '3000', 'https://shopping-phinf.pstatic.net/main_2941249/29412491628.20211026145456.jpg'); + price, image, latitude, longitude) +VALUES ('소백산 검은콩 막걸리', '탁주', '대강양조장', '6%', '백미, 소맥분, 검은콩, 검은깨 등', '1,500ml, 1,200ml, 750ml', '충북 단양군 대강면 장림리 113-7', '충북', '3000', + 'https://shopping-phinf.pstatic.net/main_2941249/29412491628.20211026145456.jpg', '36.922265636051897', '128.353720606488'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('지평 생 쌀막걸리', '탁주', '지평주조', '5%', '쌀(국내산), 정제수, 국, 효모, 정제효소 등', '700ml', '경기 양평군 지평면 지평의병로62번길 27', '경기', - '1,650', 'https://shopping-phinf.pstatic.net/main_8389643/83896434987.1.jpg'); + price, image, latitude, longitude) +VALUES ('지평 생 쌀막걸리', '탁주', '지평주조', '5%', '쌀(국내산), 정제수, 국, 효모, 정제효소 등', '700ml', '경기 양평군 지평면 지평의병로62번길 27', '경기', '1,650', + 'https://shopping-phinf.pstatic.net/main_8389643/83896434987.1.jpg', '37.474767429810399', '127.635337254996'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('부안 참뽕 와인', '과실주', '내변산(동진주조)', '13%', '오디(국내산), 정제수, 주정', '750ml', '전북 부안군 행안면 부안농공단지길 14-11', '전북', '18,000', - 'https://shopping-phinf.pstatic.net/main_8600869/86008695315.jpg'); + 'https://shopping-phinf.pstatic.net/main_8600869/86008695315.jpg', '35.739039307569001', '126.72129600612'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('안동소주 양반탈', '증류식소주', '명인 안동소주', '45%', '쌀(국내산), 누룩, 정제수', '800ml', '경북 안동시 풍산읍 산업단지6길 6', '경북', '35,000', - 'https://shopping-phinf.pstatic.net/main_1211617/12116177388.20171009144702.jpg'); + 'https://shopping-phinf.pstatic.net/main_1211617/12116177388.20171009144702.jpg', '36.603877947741999', '128.54135891751901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('백운 복분자주', '기타주류', '농업회사법인(주)백운주가', '13%', '쌀, 토종 복분자과즙', '360ml', '전라남도 광양시 옥룡면 신재로 946-18', '전남', '7,000', - 'https://shopping-phinf.pstatic.net/main_2836447/28364471754.jpg'); + 'https://shopping-phinf.pstatic.net/main_2836447/28364471754.jpg', '35.042153812676503', '127.619908560813'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('삼양춘 생탁주', '탁주', '송도향전통주조', '12.5%', '강화섬쌀, 전통누룩, 정제수', '500ml', '인천광역시 남동구 호구포로 50, 8층 819-1호', '인천', '12,000', - 'https://shopping-phinf.pstatic.net/main_2692337/26923375837.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_2692337/26923375837.2.jpg', '37.389117652051702', '126.700781786467'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('두레앙 브랜디', '브랜디', '농업회사법인(주)두레양조', '35%', '거봉포도원액', '750ml', '충남 천안시 서북구 입장면 율목길17-6', '충남', '70,000', - 'https://shopping-phinf.pstatic.net/main_8315160/83151603073.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8315160/83151603073.2.jpg', '36.913552838896202', '127.20273128950799'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('다래와인 3004', '과실주', '영농조합법인 오름주가', '8%', '참다래', '375ml', '경상남도 사천시 미룡길 31-20', '경남', '10,000', - 'https://shopping-phinf.pstatic.net/main_8254721/82547214203.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8254721/82547214203.2.jpg', '34.986470058128702', '128.055498424505'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('여포의 꿈(레드스위트)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '750ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', - '20000', 'https://shopping-phinf.pstatic.net/main_2013737/20137377461.20190709104018.jpg'); + price, image, latitude, longitude) +VALUES ('여포의 꿈(레드스위트)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '750ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', '20000', + 'https://shopping-phinf.pstatic.net/main_2013737/20137377461.20190709104018.jpg', '36.126228935186901', '127.744545237346'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('삼양춘 생약주', '약주', '송도향전통주조', '15%', '강화섬쌀, 전통누룩, 정제수', '500ml', '인천광역시 남동구 호구포로 50, 8층 819-1호', '인천', '20,000', - 'https://shopping-phinf.pstatic.net/main_2692337/26923375875.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_2692337/26923375875.2.jpg', '37.389117652051702', '126.700781786467'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('민속주 안동소주', '증류식소주', '민속주 안동소주', '45%', '쌀(국내산), 누룩, 정제수', '800ml', '경북 안동시 강남로 71-1', '경북', '33,500', - 'https://shopping-phinf.pstatic.net/main_2866631/28666319559.20210901113236.jpg'); + 'https://shopping-phinf.pstatic.net/main_2866631/28666319559.20210901113236.jpg', '36.549763429825802', '128.708699757434'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('한스오차드 사과와인', '과실주', '(주)한국애플리즈', '11%', '국산사과원액 100%', '750ml', '경북 의성군 단촌면 일직점곡로 755', '경북', '20,000', - 'https://shopping-phinf.pstatic.net/main_8038014/80380147942.4.jpg'); + 'https://shopping-phinf.pstatic.net/main_8038014/80380147942.4.jpg', '36.437001839678501', '128.72290274697301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('명가원 복분자술', '과실주', '명가원영농조합법인', '16%', '복분자 37.65%, 주정, 정제수, 구연산, 호박산, 정제식염, 액상과당, 효모, 설탕', '750ml', - '경남 함양군 지곡면 지곡창촌길3', '경남', '20,000', 'https://shopping-phinf.pstatic.net/main_1077837/10778370217.1.jpg'); + price, image, latitude, longitude) +VALUES ('명가원 복분자술', '과실주', '명가원영농조합법인', '16%', '복분자 37.65%, 주정, 정제수, 구연산, 호박산, 정제식염, 액상과당, 효모, 설탕', '750ml', '경남 함양군 지곡면 지곡창촌길3', '경남', '20,000', + 'https://shopping-phinf.pstatic.net/main_1077837/10778370217.1.jpg', '35.566395785851398', '127.775478094034'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('청산녹수 생탁주', '탁주', '농업회사법인(주)청산녹수', '6%', '쌀(국내산), 사과농축액, 효모, 정제효소', '750ml', '전남 장성군 장성읍 남양촌길(백계리) 19', '전남', - '12000', 'https://shopping-phinf.pstatic.net/main_2958940/29589405165.1.jpg'); + price, image, latitude, longitude) +VALUES ('청산녹수 생탁주', '탁주', '농업회사법인(주)청산녹수', '6%', '쌀(국내산), 사과농축액, 효모, 정제효소', '750ml', '전남 장성군 장성읍 남양촌길(백계리) 19', '전남', '12000', + 'https://shopping-phinf.pstatic.net/main_2958940/29589405165.1.jpg', '35.345218252623603', '126.812850520064'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('감그린 레귤러', '과실주', '청도감와인(주)', '12%', '감(국내산)', '750ml', '경북 청도군 풍각면 봉길1길27', '경북', '18,000', - 'https://shopping-phinf.pstatic.net/main_8042884/80428842036.jpg'); + price, image, latitude, longitude) +VALUES ('감그린 레귤러', '과실주', '청도감와인(주)', '12%', '감(국내산)', '750ml', '경북 청도군 화양읍 송금길 100', '경북', '18,000', + 'https://shopping-phinf.pstatic.net/main_8042884/80428842036.jpg', '35.715140164656603', '128.720534775423'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('술예쁘다 생탁주', '탁주', '농업회사법인(주)좋은술', '13%', '국내산 쌀, 누룩', '500ml', '경기도 평택시 오성면 숙성뜰길 108', '경기', '18,000', - 'https://shopping-phinf.pstatic.net/main_1316773/13167731890.jpg'); + 'https://shopping-phinf.pstatic.net/main_1316773/13167731890.jpg', '37.000493267959698', '126.98939334495201'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('공주애 오디와인', '과실주', '농업회사법인 사곡양조원', '15%', '국내산 오디, 정제수, 주정, 과당, 효모', '375ml', '충남 공주시 사곡면 마곡사로 49', '충남', - '6,000', 'https://shopping-phinf.pstatic.net/main_8088045/80880451689.jpg'); + price, image, latitude, longitude) +VALUES ('공주애 오디와인', '과실주', '농업회사법인 사곡양조원', '15%', '국내산 오디, 정제수, 주정, 과당, 효모', '375ml', '충남 공주시 사곡면 마곡사로 49', '충남', '6,000', + 'https://shopping-phinf.pstatic.net/main_8088045/80880451689.jpg', '36.498162563814503', '127.028732308614'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('영일만친구 막걸리', '탁주', '동해명주', '6%', '국내산 쌀, 물엿, 우뭇가사리, 효모, 조제 종국, 정제효소제, 아스파탐, 젖산', '750ml', - '경북 포항시 남구 동해면 일월리 51-1', '경북', '15000', 'https://shopping-phinf.pstatic.net/main_8451051/84510516588.jpg'); + price, image, latitude, longitude) +VALUES ('영일만친구 막걸리', '탁주', '동해명주', '6%', '국내산 쌀, 물엿, 우뭇가사리, 효모, 조제 종국, 정제효소제, 아스파탐, 젖산', '750ml', '경북 포항시 남구 동해면 일월로 51-1', '경북', '15000', + 'https://shopping-phinf.pstatic.net/main_8451051/84510516588.jpg', '35.9890551664434', '129.43864414901401'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('선운산 복분자와인', '과실주', '(주)선운산복분자주 흥진', '13%', '복분자(고창산), 구연산, 과당, 아스파탐, 주정, 정제수', '300ml', '전북 고창군 부안면 복분자로535', - '전북', '6,000', 'https://shopping-phinf.pstatic.net/main_3885471/38854718619.20230323154318.jpg'); + price, image, latitude, longitude) +VALUES ('선운산 복분자와인', '과실주', '(주)선운산복분자주 흥진', '13%', '복분자(고창산), 구연산, 과당, 아스파탐, 주정, 정제수', '300ml', '전북 고창군 부안면 복분자로535', '전북', '6,000', + 'https://shopping-phinf.pstatic.net/main_3885471/38854718619.20230323154318.jpg', '35.510942199674602', '126.64644550584801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('감 보드카', '일반증류주', '양촌감영농조합법인', '32%', '감(국내산) 100%', '375ml', '충남 논산시 황산벌로 1075-21', '충남', '14,000', - 'https://shopping-phinf.pstatic.net/main_8637617/86376172204.jpg'); + 'https://shopping-phinf.pstatic.net/main_8637617/86376172204.jpg', '36.177842932451', '127.201208703747'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('행운 막걸리', '탁주', '성포양조장', '6%', '쌀(국내산), 소맥분(미국산), 전분당, 정제수, 정제효소, 종국, 효모, 젖산, 아스파탐', '750ml', - '경남 거제시 사등면 지석3길3', '경남', '1,100', 'https://shopping-phinf.pstatic.net/main_8607031/86070310107.jpg'); + price, image, latitude, longitude) +VALUES ('행운 막걸리', '탁주', '성포양조장', '6%', '쌀(국내산), 소맥분(미국산), 전분당, 정제수, 정제효소, 종국, 효모, 젖산, 아스파탐', '750ml', '경남 거제시 사등면 지석3길3', '경남', '1,100', + 'https://shopping-phinf.pstatic.net/main_8607031/86070310107.jpg', '34.9079763686006', '128.51637920273899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('도깨비술 9%', '탁주', '농업회사법인 (주)도깨비양조장', '9%', '멥쌀(국내산), 누룩, 효모, 정제수', '750ml', '충북 단양군 가곡면 사평3길 5', '충북', '10,000', - 'https://shopping-phinf.pstatic.net/main_8222112/82221128958.jpg'); + 'https://shopping-phinf.pstatic.net/main_8222112/82221128958.jpg', '37.026388066216199', '128.38473760987199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('한산소곡주', '살균약주', '한산소곡주', '18%', '찹쌀, 누룩, 백미, 정제수, 야국, 메주콩, 생강, 홍고추', '700ml', '충청남도 서천군 한산면 충절로 1118번지', '충남', - '15,000', 'https://shopping-phinf.pstatic.net/main_1195683/11956838281.20180327164858.jpg'); + price, image, latitude, longitude) +VALUES ('한산소곡주', '살균약주', '한산소곡주', '18%', '찹쌀, 누룩, 백미, 정제수, 야국, 메주콩, 생강, 홍고추', '700ml', '충청남도 서천군 한산면 충절로 1118번지', '충남', '15,000', + 'https://shopping-phinf.pstatic.net/main_1195683/11956838281.20180327164858.jpg', '36.0800411361503', '126.80234354141'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('추성주', '일반증류주', '추성고을', '25%', '쌀, 정제수, 누룩, 오미자, 구기자, 상심자, 갈근', '700ml', '전라남도 담양군 용면 추령로 29', '전남', '80,000', - 'https://shopping-phinf.pstatic.net/main_1211671/12116716453.20171009174930.jpg'); + 'https://shopping-phinf.pstatic.net/main_1211671/12116716453.20171009174930.jpg', '35.366386575009301', '126.985286653335'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('한산소곡주(살균주)', '살균약주', '녹천주조장', '16%', '찹쌀, 누룩, 백미, 정제수', '750ml', '충청남도 서천군 한산면 한마로 105', '충남', '12,000', - 'https://shopping-phinf.pstatic.net/main_8333770/83337705111.jpg'); + 'https://shopping-phinf.pstatic.net/main_8333770/83337705111.jpg', '36.0892972955549', '126.801257103803'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('메로니아', '기타주류', '배혜정 도가', '4%', '쌀, 국, 효모, 젖산, 멜론 향, 물엿 등', '750ml', '경기도 화성시 정남면 문학리 674-23', '경기', '2,000', - 'https://shopping-phinf.pstatic.net/main_8233106/82331060594.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8233106/82331060594.2.jpg', '37.149336281531802', '126.960871275363'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('솔송주', '살균약주', '명가원 영농조합법인', '13%', '정제수, 백미(국내산), 국내산 송순 농축액(송순33%, 정제수67%) 5.24%, 누룩, 조제종국, 효모', '375ml', - '경남 함양군 지곡면 지곡창촌길3', '경남', '7,000', - 'https://shopping-phinf.pstatic.net/main_3885151/38851514627.20230323130418.jpg'); + price, image, latitude, longitude) +VALUES ('솔송주', '살균약주', '명가원 영농조합법인', '13%', '정제수, 백미(국내산), 국내산 송순 농축액(송순33%, 정제수67%) 5.24%, 누룩, 조제종국, 효모', '375ml', '경남 함양군 지곡면 지곡창촌길3', '경남', '7,000', + 'https://shopping-phinf.pstatic.net/main_3885151/38851514627.20230323130418.jpg', '35.566395785851398', '127.775478094034'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('불소곡주', '리큐르', '한산소곡주', '43%', '찹쌀, 누룩, 백미, 정제수, 야국, 메주콩, 생강, 홍고추', '700ml', '충청남도 서천군 한산면 충절로 1118번지', '충남', - '30,000', 'https://shopping-phinf.pstatic.net/main_1197926/11979264416.20200507170658.jpg'); + price, image, latitude, longitude) +VALUES ('불소곡주', '리큐르', '한산소곡주', '43%', '찹쌀, 누룩, 백미, 정제수, 야국, 메주콩, 생강, 홍고추', '700ml', '충청남도 서천군 한산면 충절로 1118번지', '충남', '30,000', + 'https://shopping-phinf.pstatic.net/main_1197926/11979264416.20200507170658.jpg', '36.0800411361503', '126.80234354141'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('줄포 생 막걸리', '탁주', '내변산(동진주조)', '6%', '쌀(국내산), 종국정제수, 누룩, 효모, 아스파탐', '750ml', '전북 부안군 행안면 부안농공단지길 14-11', '전북', - '1,200', 'https://shopping-phinf.pstatic.net/main_8231137/82311379192.jpg'); + price, image, latitude, longitude) +VALUES ('줄포 생 막걸리', '탁주', '내변산(동진주조)', '6%', '쌀(국내산), 종국정제수, 누룩, 효모, 아스파탐', '750ml', '전북 부안군 행안면 부안농공단지길 14-11', '전북', '1,200', + 'https://shopping-phinf.pstatic.net/main_8231137/82311379192.jpg', '35.739039307569001', '126.72129600612'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('홍삼 인삼주', '일반증류주', '태평주가', '38%', '쌀, 정제주정, 인삼침출액, 홍삼농축액, 고과당 등', '750ml', '전북 진안군 진안읍 거북바위로 3길 15-35', '전북', - '70,000', 'https://shopping-phinf.pstatic.net/main_2869418/28694189489.jpg'); + price, image, latitude, longitude) +VALUES ('홍삼 인삼주', '일반증류주', '태평주가', '38%', '쌀, 정제주정, 인삼침출액, 홍삼농축액, 고과당 등', '750ml', '전북 진안군 진안읍 거북바위로 3길 15-35', '전북', '70,000', + 'https://shopping-phinf.pstatic.net/main_2869418/28694189489.jpg', '35.7728321025496', '127.380470853199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('천마 이야기', '탁주', '농업회사법인산들벗(주)', '6%', '팽화미, 입국미, 무주천마분말, 오미자추출액', '750ml', '전라북도 무주군 적상면 서창로 72', '전북', '1,500', - 'https://shopping-phinf.pstatic.net/main_4128451/41284517501.jpg'); + 'https://shopping-phinf.pstatic.net/main_4128451/41284517501.jpg', '35.948300024358097', '127.6694633609'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('소곡화주', '리큐르', '녹천주조장', '41%', '찹쌀, 누룩, 백미, 정제수', '480ml', '충청남도 서천군 한산면 한마로 105', '충남', '45,000', - 'https://shopping-phinf.pstatic.net/main_8153656/81536562919.jpg'); + 'https://shopping-phinf.pstatic.net/main_8153656/81536562919.jpg', '36.0892972955549', '126.801257103803'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('천비향 약주', '약주', '농업회사법인(주)좋은술', '16%', '국내산 쌀, 누룩', '500ml', '경기도 평택시 오성면 숙성뜰길 108', '경기', '41,000', - 'https://shopping-phinf.pstatic.net/main_1316773/13167732286.3.jpg'); + 'https://shopping-phinf.pstatic.net/main_1316773/13167732286.3.jpg', '37.000493267959698', '126.98939334495201'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('금산인삼주', '약주', '농업회사법인(주)금산인삼주', '12.5%', '쌀, 인삼, 누룩, 정제수 등', '375ml', '충남 금산군 금성면 파초길 23', '충남', '12000', - 'https://shopping-phinf.pstatic.net/main_2885938/28859388587.20210915162740.jpg'); + 'https://shopping-phinf.pstatic.net/main_2885938/28859388587.20210915162740.jpg', '36.127661377353597', '127.466418152423'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('청양 둔송 구기주', '약주', '청양 둔송 구기주', '16%', '쌀, 누룩, 구기자, 감초, 두충껍질', '700ml', '충남 청양군 운곡면 추광길 2-10', '충남', '23000', - 'https://shopping-phinf.pstatic.net/main_4029408/40294086468.jpg'); + 'https://shopping-phinf.pstatic.net/main_4029408/40294086468.jpg', '36.5628296869317', '126.859497722295'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('주몽 복분자주', '기타주류', '농업회사법인(유)술소리', '16%', '쌀, 복분자', '375ml', '전라북도 남원시 시묘길 130(오암동)', '전북', '5,000', - 'https://shopping-phinf.pstatic.net/main_8009313/80093139478.jpg'); + 'https://shopping-phinf.pstatic.net/main_8009313/80093139478.jpg', '35.384001729462199', '127.380353410198'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('면천두견주', '약주', '(주)면천두견주', '18%', '국내산 찹쌀, 누룩, 진달래꽃', '900ml', '충남 당진시 면천로 성하로 250', '충남', '120,000(900ml*2병)', - 'https://shopping-phinf.pstatic.net/main_8275849/82758493697.1.jpg'); + price, image, latitude, longitude) +VALUES ('면천두견주', '약주', '(주)면천두견주', '18%', '국내산 찹쌀, 누룩, 진달래꽃', '900ml', '충남 당진시 면천면 성하로 250', '충남', '120,000(900ml*2병)', + 'https://shopping-phinf.pstatic.net/main_8275849/82758493697.1.jpg', '36.8128310711189', '126.66286381048'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('원매', '리큐르', '더한주류', '15%', '매실원주액, 매실청, 꿀, 카라멜, 효소처리스테비아, 정제수', '750ml', '서울시 은평구 증산로7길 28-13', '서울', '35,000', - 'https://shopping-phinf.pstatic.net/main_8237832/82378326858.jpg'); + 'https://shopping-phinf.pstatic.net/main_8237832/82378326858.jpg', '37.585459697923397', '126.90696666699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('계룡백일주 40도', '리큐르', '계룡백일주', '40%', '찹쌀, 백미, 누룩, 재리종국화꽃, 오미자, 진달래, 재래종 솔잎', '600ml*2개', '충남 공주시 봉정길 32', '충남', - '80,000', 'https://shopping-phinf.pstatic.net/main_1218107/12181071507.1.jpg'); + price, image, latitude, longitude) +VALUES ('계룡백일주 40도', '리큐르', '계룡백일주', '40%', '찹쌀, 백미, 누룩, 재리종국화꽃, 오미자, 진달래, 재래종 솔잎', '600ml*2개', '충남 공주시 봉정길 32', '충남', '80,000', + 'https://shopping-phinf.pstatic.net/main_1218107/12181071507.1.jpg', '36.417515675848698', '127.09112543844201'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('백련 생막걸리 snow', '탁주', '신평양조장', '6%', '백미, 연잎, 정제수, 종국, 효모, 아스파탐, 물엿 등', '750ml', '충남 당진시 신평면 신평로 813', '충남', - '1,600', 'https://shopping-phinf.pstatic.net/main_3619926/36199266943.jpg'); + price, image, latitude, longitude) +VALUES ('백련 생막걸리 snow', '탁주', '신평양조장', '6%', '백미, 연잎, 정제수, 종국, 효모, 아스파탐, 물엿 등', '750ml', '충남 당진시 신평면 신평로 813', '충남', '1,600', + 'https://shopping-phinf.pstatic.net/main_3619926/36199266943.jpg', '36.883595059409302', '126.77478495639301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('복분자주 360', '과실주', '내장산 복분자 영농조합', '16%', '복분자, 주정, 정제수, 설탕 등', '360ml', '전북 정읍시 북면 장학 1길', '전북', '6,000', - 'https://shopping-phinf.pstatic.net/main_3388714/33887149963.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_3388714/33887149963.1.jpg', '35.6300696579953', '126.914539614606'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('뱅꼬레화이트', '과실주', '(주)한국와인', '11%', '양조용포도(경북 영천)', '375ml', '경북 영천시 금호읍 창산길 100-44', '경북', '23,000', - 'https://shopping-phinf.pstatic.net/main_3044221/30442213619.20220106142542.jpg'); + 'https://shopping-phinf.pstatic.net/main_3044221/30442213619.20220106142542.jpg', '35.906983465688199', '128.882685333909'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('회곡 생 동동주', '탁주', '회곡양조장', '7%', '쌀, 입국, 누룩, 아스파탐, 효모, 정제수, 아세설팜칼륨', '1,200ml', '경상북도 안동시 풍산읍 산업단지 5길 39', '경북', - '1,300', 'https://shopping-phinf.pstatic.net/main_8233108/82331088703.jpg'); + price, image, latitude, longitude) +VALUES ('회곡 생 동동주', '탁주', '회곡양조장', '7%', '쌀, 입국, 누룩, 아스파탐, 효모, 정제수, 아세설팜칼륨', '1,200ml', '경상북도 안동시 풍산읍 산업단지 5길 39', '경북', '1,300', + 'https://shopping-phinf.pstatic.net/main_8233108/82331088703.jpg', '36.602499222654203', '128.540009544139'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('세종 쌀 막걸리', '살균탁주', '조은술 세종', '6%', '정제수, 백미, 소맥분, 전분당, 효모, 젖산 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', - '1,500', 'https://shopping-phinf.pstatic.net/main_8216453/82164530421.1.jpg'); + price, image, latitude, longitude) +VALUES ('세종 쌀 막걸리', '살균탁주', '조은술 세종', '6%', '정제수, 백미, 소맥분, 전분당, 효모, 젖산 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '1,500', + 'https://shopping-phinf.pstatic.net/main_8216453/82164530421.1.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('복숭아와인', '과실주', '영농조합법인 금이산농원', '12%', '복숭아(국내산), 백설탕, 효모, 메타중아황산칼륨', '500ml', '세종시 전의면 가느실길 127', '세종', - '20,000', 'https://shopping-phinf.pstatic.net/main_8304309/83043090461.7.jpg'); + price, image, latitude, longitude) +VALUES ('복숭아와인', '과실주', '영농조합법인 금이산농원', '12%', '복숭아(국내산), 백설탕, 효모, 메타중아황산칼륨', '500ml', '세종시 전의면 가느실길 127', '세종', '20,000', + 'https://shopping-phinf.pstatic.net/main_8304309/83043090461.7.jpg', '36.640502652310801', '127.18926016454699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('해미읍성 딸기와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '해미딸기(99.99%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', - '충남', '20,000', 'https://shopping-phinf.pstatic.net/main_3254589/32545890618.20220523152941.jpg'); + price, image, latitude, longitude) +VALUES ('해미읍성 딸기와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '해미딸기(99.99%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', '충남', '20,000', + 'https://shopping-phinf.pstatic.net/main_3254589/32545890618.20220523152941.jpg', '36.697507437676599', '126.53612877610099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('두레앙 22', '일반증류주', '농업회사법인 (주)두레양조', '22%', '거봉포도원액', '375ml', '충남 천안시 서북구 입장면 율목길17-6', '충남', '5,000', - 'https://shopping-phinf.pstatic.net/main_4082238/40822385620.20230626144820.jpg'); + 'https://shopping-phinf.pstatic.net/main_4082238/40822385620.20230626144820.jpg', '36.913552838896202', '127.20273128950799'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('스타베리오디', '과실주', '(주)한국와인', '12%', '양조용포도(경북 영천)', '500ml', '경북 영천시 금호읍 창산길 100-44', '경북', '28,000', - 'https://shopping-phinf.pstatic.net/main_8158852/81588529740.jpg'); + 'https://shopping-phinf.pstatic.net/main_8158852/81588529740.jpg', '35.906983465688199', '128.882685333909'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('도깨비술 11%', '탁주', '농업회사법인 (주)도깨비양조장', '11%', '멥쌀(국내산), 누룩, 효모, 정제수', '750ml', '충북 단양군 가곡면 사평3길 5', '충북', - '12,000', 'https://shopping-phinf.pstatic.net/main_8222114/82221141769.jpg'); + price, image, latitude, longitude) +VALUES ('도깨비술 11%', '탁주', '농업회사법인 (주)도깨비양조장', '11%', '멥쌀(국내산), 누룩, 효모, 정제수', '750ml', '충북 단양군 가곡면 사평3길 5', '충북', '12,000', + 'https://shopping-phinf.pstatic.net/main_8222114/82221141769.jpg', '37.026388066216199', '128.38473760987199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('메밀로', '일반증류주', '농업회사법인 두루(주)', '45%', '국내산쌀, 메밀, 누룩, 정제수', '500ml', '강원도 홍천 내촌면 용포길 31-25', '강원', '150,000', - 'https://shopping-phinf.pstatic.net/main_8336411/83364111446.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8336411/83364111446.1.jpg', '37.814024413609701', '128.05857840803199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('백년향', '탁주', '(주)농업회사법인 추연당', '10%', '국내산 쌀, 누룩, 정제수', '500ml', '경기도 여주시 가남읍 금당리길 1-111', '경기', - '33,000(500ml*3병)', 'https://shopping-phinf.pstatic.net/main_8053584/80535847368.jpg'); + price, image, latitude, longitude) +VALUES ('백년향', '탁주', '(주)농업회사법인 추연당', '10%', '국내산 쌀, 누룩, 정제수', '500ml', '경기도 여주시 가남읍 금당리길 1-111', '경기', '33,000(500ml*3병)', + 'https://shopping-phinf.pstatic.net/main_8053584/80535847368.jpg', '37.206353843422399', '127.608692438734'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('모월 로', '증류식소주', '협동조합 주담', '25%', '쌀(국내산), 누룩, 정제수', '500ml', '강원도 원주시 판부면 판부신촌길 84', '강원', '25,000', - 'https://shopping-phinf.pstatic.net/main_8459419/84594193071.7.jpg'); + 'https://shopping-phinf.pstatic.net/main_8459419/84594193071.7.jpg', '37.299414999973003', '127.97345115422701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('지란지교 무화과 탁주', '탁주', '(유)친구들의술지란지교', '12%', '찹쌀, 멥쌀(국내산), 전통누룩(국내산 밀), 정제수, 무화과청, 레드비트분말, 밀함유', '500ml', - '전라북도 순창군 순창읍 순창7길 5-1', '전북', '30,000(2병)', - 'https://shopping-phinf.pstatic.net/main_8310603/83106038418.1.jpg'); + price, image, latitude, longitude) +VALUES ('지란지교 무화과 탁주', '탁주', '(유)친구들의술지란지교', '12%', '찹쌀, 멥쌀(국내산), 전통누룩(국내산 밀), 정제수, 무화과청, 레드비트분말, 밀함유', '500ml', '전라북도 순창군 순창읍 순창7길 5-1', '전북', '30,000(2병)', + 'https://shopping-phinf.pstatic.net/main_8310603/83106038418.1.jpg', '35.374021302211197', '127.141767111218'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('산내울 사과애주', '리큐르', '거창사과원예농협', '16%', '사과, 설탕, 주정, 정제수, 과당', '750ml', '경남 거창군 거창읍 거함대로 3452-41', '경남', '14,000', - 'https://shopping-phinf.pstatic.net/main_3864137/38641371619.20230314173656.jpg'); + 'https://shopping-phinf.pstatic.net/main_3864137/38641371619.20230314173656.jpg', '35.6718370192538', '127.93503974367999'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('포엠 레드 드라이와인', '과실주', '갈기산포도농원 (주)농업회사법인', '12%', '포도(국내산_MBA), 머루(국내산)', '750ml', '충북 영동군 학산면 모리1길 23', '충북', - '25,000', 'https://shopping-phinf.pstatic.net/main_8337188/83371883120.jpg'); + price, image, latitude, longitude) +VALUES ('포엠 레드 드라이와인', '과실주', '갈기산포도농원 (주)농업회사법인', '12%', '포도(국내산_MBA), 머루(국내산)', '750ml', '충북 영동군 학산면 모리1길 23', '충북', '25,000', + 'https://shopping-phinf.pstatic.net/main_8337188/83371883120.jpg', '36.110856415274299', '127.647530610906'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('지란지교 약주', '약주(생약주)', '(유)친구들의술지란지교', '17%', '찹쌀 · 멥쌀(국내산), 전통누룩(국내산 밀), 정제수, 밀함유', '375ml / 500ml', - '전라북도 순창군 순창읍 순창7길 5-1', '전북', '20,000 / ₩25,000', - 'https://shopping-phinf.pstatic.net/main_8281496/82814964642.1.jpg'); + price, image, latitude, longitude) +VALUES ('지란지교 약주', '약주(생약주)', '(유)친구들의술지란지교', '17%', '찹쌀 · 멥쌀(국내산), 전통누룩(국내산 밀), 정제수, 밀함유', '375ml / 500ml', '전라북도 순창군 순창읍 순창7길 5-1', '전북', '20,000 / ₩25,000', + 'https://shopping-phinf.pstatic.net/main_8281496/82814964642.1.jpg', '35.374021302211197', '127.141767111218'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('산내울 오미자주', '리큐르', '거창사과원예농협', '16%', '오미자, 설탕, 주정, 정제수, 과당', '750ml', '경남 거창군 거창읍 거함대로 3452-41', '경남', - '20,000', 'https://shopping-phinf.pstatic.net/main_8240586/82405869691.jpg'); + price, image, latitude, longitude) +VALUES ('산내울 오미자주', '리큐르', '거창사과원예농협', '16%', '오미자, 설탕, 주정, 정제수, 과당', '750ml', '경남 거창군 거창읍 거함대로 3452-41', '경남', '20,000', + 'https://shopping-phinf.pstatic.net/main_8240586/82405869691.jpg', '35.6718370192538', '127.93503974367999'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('라이스퐁당 17', '약주', '농업회사법인 (주)벗드림', '17%', '찹쌀(국내산), 누룩, 정제수(음양곽, 감초)', '500ml', '부산광역시 북구 덕천로247번길 3, 2층', '부산', - '18,000', 'https://shopping-phinf.pstatic.net/main_8259453/82594534509.2.jpg'); + price, image, latitude, longitude) +VALUES ('라이스퐁당 17', '약주', '농업회사법인 (주)벗드림', '17%', '찹쌀(국내산), 누룩, 정제수(음양곽, 감초)', '500ml', '부산광역시 북구 덕천로247번길 3, 2층', '부산', '18,000', + 'https://shopping-phinf.pstatic.net/main_8259453/82594534509.2.jpg', '35.2109717267058', '129.031358852523'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('여포의 꿈(화이트)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '375ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', - '20,000', 'https://shopping-phinf.pstatic.net/main_3257939/32579393620.20220525152744.jpg'); + price, image, latitude, longitude) +VALUES ('여포의 꿈(화이트)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '375ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', '20,000', + 'https://shopping-phinf.pstatic.net/main_3257939/32579393620.20220525152744.jpg', '36.126228935186901', '127.744545237346'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('소나무와 학_750ml', '일반증류주', '용두산조은술', '43%', '쌀(국내산), 솔잎, 황기, 당귀, 효모, 아스파탐', '750ml', '충북 제천시 송학면 송학주천로647', '충북', - '39,000', 'https://shopping-phinf.pstatic.net/main_1322513/13225135731.1.jpg'); + price, image, latitude, longitude) +VALUES ('소나무와 학_750ml', '일반증류주', '용두산조은술', '43%', '쌀(국내산), 솔잎, 황기, 당귀, 효모, 아스파탐', '750ml', '충북 제천시 송학면 송학주천로647', '충북', '39,000', + 'https://shopping-phinf.pstatic.net/main_1322513/13225135731.1.jpg', '37.215122174466899', '128.23690254954599'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('감홍로 백자_700ml', '일반증류주', '농업회사법인(주)감홍로', '40%', '쌀(70%), 조(30%), 7가지 약재(용안육, 계피, 진피, 정향, 생강, 감초, 지초)', '700ml', - '경기도 파주시 파주읍 부곡리 34-7', '경기', '75,000', 'https://shopping-phinf.pstatic.net/main_8335668/83356685430.jpg'); + price, image, latitude, longitude) +VALUES ('감홍로 백자_700ml', '일반증류주', '농업회사법인(주)감홍로', '40%', '쌀(70%), 조(30%), 7가지 약재(용안육, 계피, 진피, 정향, 생강, 감초, 지초)', '700ml', '경기도 파주시 파주읍 부곡리 34-7', '경기', '75,000', + 'https://shopping-phinf.pstatic.net/main_8335668/83356685430.jpg', '37.816061501636902', '126.83366162562901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('해창 생 막걸리 6도', '탁주', '해창주조장', '6%', '햅쌀, 찹쌀, 물, 누룩', '900ml', '전남 해남군 화산면 해창길1', '전남', '3,000', - 'https://shopping-phinf.pstatic.net/main_4009970/40099701717.jpg'); + 'https://shopping-phinf.pstatic.net/main_4009970/40099701717.jpg', '34.517616531498902', '126.53811119380801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('양촌 생 막걸리', '탁주', '양촌양조', '6%', '팽화미, 소맥분, 정제수, 물엿, 효소, 국 등', '750ml', '충남 논산시 양촌면 매죽헌로 1665번길 14-7', '충남', - '30,000원 1박스 20개입', 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg'); + price, image, latitude, longitude) +VALUES ('양촌 생 막걸리', '탁주', '양촌양조', '6%', '팽화미, 소맥분, 정제수, 물엿, 효소, 국 등', '750ml', '충남 논산시 양촌면 매죽헌로 1665번길 14-7', '충남', '30,000원 1박스 20개입', + 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg', '36.1380648488284', '127.234326485841'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이동 쌀 막걸리', '살균탁주', '이동주조', '6%', '정제수, 백미, 팽화미, 입국, 아스파탐 등', '1,200ml', '경기도 포천시 이동면 화동로 2466', '경기', '1,600', - 'https://shopping-phinf.pstatic.net/main_1375984/13759846049.20180803125315.jpg'); + 'https://shopping-phinf.pstatic.net/main_1375984/13759846049.20180803125315.jpg', '38.062019032200702', '127.386275529044'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('그랑꼬또 로제와인', '과실주', '그린영농조합법인', '12%', '포도(캠벨얼리)', '750ml', '경기도 안산시 단원구 뻐꾹산길 107(대부북동)', '경기', '21,000', - 'https://shopping-phinf.pstatic.net/main_3257950/32579508620.20220525151208.jpg'); + 'https://shopping-phinf.pstatic.net/main_3257950/32579508620.20220525151208.jpg', '37.257471389325403', '126.582545230378'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('문배술 헤리티지 23도', '증류식소주', '문배주양조원', '23%', '메조, 찰수수, 쌀', '375ml', '경기도 김포시 통진읍 서암리 203-4', '경기', - '50,000(375ml*9병)', 'https://shopping-phinf.pstatic.net/main_8177569/81775695249.2.jpg'); + price, image, latitude, longitude) +VALUES ('문배술 헤리티지 23도', '증류식소주', '문배주양조원', '23%', '메조, 찰수수, 쌀', '375ml', '경기도 김포시 통진읍 서암리 203-4', '경기', '50,000(375ml*9병)', + 'https://shopping-phinf.pstatic.net/main_8177569/81775695249.2.jpg', '37.700682713839399', '126.59423705906001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('컨츄리 산머루 와인 (드라이)', '과실주', '컨츄리 농원', '14%', '국산 산머루원액 100%', '750ml', '충북 영동군 영동읍 주곡리 590-14', '충북', '20,000', - 'https://shopping-phinf.pstatic.net/main_1193837/11938371553.jpg'); + 'https://shopping-phinf.pstatic.net/main_1193837/11938371553.jpg', '36.177871843973797', '127.83305038076'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('내장산 복분자주 지통1호', '과실주', '내장산 복분자 영농조합', '16%', '복분자, 주정, 정제수, 설탕 등', '700ml', '전북 정읍시 북면 장학 1길', '전북', '18,000', - 'https://shopping-phinf.pstatic.net/main_8593997/85939977691.jpg'); + 'https://shopping-phinf.pstatic.net/main_8593997/85939977691.jpg', '35.6300696579953', '126.914539614606'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('홍천강 탁주', '탁주', '예술', '11%', '홍천 쌀, 정제수, 국(밀 누룩)', '500ml', '강원도 홍천군 내촌면 물걸리 508-2', '강원', '10,000', - 'https://shopping-phinf.pstatic.net/main_8210211/82102118105.jpg'); + 'https://shopping-phinf.pstatic.net/main_8210211/82102118105.jpg', '37.794118721509101', '128.16925568029399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('안동소주 호리병', '증류식소주', '명인 안동소주', '45%', '쌀(국내산), 누룩, 정제수', '800ml', '경북 안동시 풍산읍 산업단지6길 6', '경북', '30,000', - 'https://shopping-phinf.pstatic.net/main_1211614/12116145995.20170919154306.jpg'); + 'https://shopping-phinf.pstatic.net/main_1211614/12116145995.20170919154306.jpg', '36.603877947741999', '128.54135891751901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('자두와인 레드', '과실주', '자두사랑', '12%', '피자두', '750ml', '경상북도 김천시 대학로 214', '경북', '22,000', - 'https://shopping-phinf.pstatic.net/main_8240478/82404788120.4.jpg'); + 'https://shopping-phinf.pstatic.net/main_8240478/82404788120.4.jpg', '36.139944806994102', '128.08171498016301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('다랭이팜 생 막걸리 (백미)', '탁주', '다랭이팜', '6%', '쌀, 7분도 유기농 현미, 누룩, 효모 등', '750ml', '경남 남해군 남면 홍현리 897번지', '경남', '4,000', - 'https://shopping-phinf.pstatic.net/main_1258901/12589015672.jpg'); + 'https://shopping-phinf.pstatic.net/main_1258901/12589015672.jpg', '34.7274128182437', '127.89413833285499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('문희 햇찹쌀 수제 전통주', '전통 수제 탁주', '문경주조', '13%', '유기농찹쌀 (국산), 멥쌀 (국산), 전통누룩 (우리 밀), 정제수', '700ml', - '경상북도 문경시 동로면 노은리 192', '경북', '18,000', 'https://shopping-phinf.pstatic.net/main_4100714/41007143702.jpg'); + price, image, latitude, longitude) +VALUES ('문희 햇찹쌀 수제 전통주', '전통 수제 탁주', '문경주조', '13%', '유기농찹쌀 (국산), 멥쌀 (국산), 전통누룩 (우리 밀), 정제수', '700ml', '경북 문경시 동로면 노은1길 49-15', '경북', '18,000', + 'https://shopping-phinf.pstatic.net/main_4100714/41007143702.jpg', '36.772205009239599', '128.314028995874'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('예담은 한산소곡화주', '일반증류주', '한산예담은소곡주', '41%', '찹쌀, 멥쌀, 누룩, 대두, 구절초', '500ml', '충청남도 서천군 한산면 한마로 5(동산리)', '충남', - '30,000', 'https://shopping-phinf.pstatic.net/main_1742136/17421366543.1.jpg'); + price, image, latitude, longitude) +VALUES ('예담은 한산소곡화주', '일반증류주', '한산예담은소곡주', '41%', '찹쌀, 멥쌀, 누룩, 대두, 구절초', '500ml', '충청남도 서천군 한산면 한마로 5(동산리)', '충남', '30,000', + 'https://shopping-phinf.pstatic.net/main_1742136/17421366543.1.jpg', '36.0860567020028', '126.809418967434'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('컨츄리캠벨 (스위트)', '과실주', '컨츄리 농원', '12%', '국산 포도원액 100% (캠벨얼리 100%)', '750ml', '충북 영동군 영동읍 주곡리 590-14', '충북', - '15,000', 'https://shopping-phinf.pstatic.net/main_1211606/12116067782.20181025093325.jpg'); + price, image, latitude, longitude) +VALUES ('컨츄리캠벨 (스위트)', '과실주', '컨츄리 농원', '12%', '국산 포도원액 100% (캠벨얼리 100%)', '750ml', '충북 영동군 영동읍 주곡리 590-14', '충북', '15,000', + 'https://shopping-phinf.pstatic.net/main_1211606/12116067782.20181025093325.jpg', '36.177871843973797', '127.83305038076'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('밤꽃향기', '약주', '농업회사법인 사곡양조원', '13.5%', '국내산 쌀, 밤, 누룩, 정제수', '375ml', '충남 공주시 사곡면 마곡사로 49', '충남', '4,000', - 'https://shopping-phinf.pstatic.net/main_8337873/83378730125.jpg'); + 'https://shopping-phinf.pstatic.net/main_8337873/83378730125.jpg', '36.498162563814503', '127.028732308614'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('머루 이야기', '과실주', '농업회사법인산들벗(주)', '12%', '국내산 산머루', '375ml', '전라북도 무주군 적상면 서창로 72', '전북', '6,000', - 'https://shopping-phinf.pstatic.net/main_8203992/82039928000.3.jpg'); + 'https://shopping-phinf.pstatic.net/main_8203992/82039928000.3.jpg', '35.948300024358097', '127.6694633609'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('천비향 오양주 탁주', '탁주', '농업회사법인(주)좋은술', '14%', '국내산 쌀, 누룩', '500ml', '경기도 평택시 오성면 숙성뜰길 108', '경기', '18,000', - 'https://shopping-phinf.pstatic.net/main_8271878/82718782134.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8271878/82718782134.2.jpg', '37.000493267959698', '126.98939334495201'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('오미자 생막걸리', '생탁주', '문경주조', '6.5%', - '정제수, 백미(국내산), 입국(쌀, 밀), 올리고당, 물엿, 허브(유기농), 오미자 2.4%(국내산, 문경로동산), 정제효소, 아스파탐·아세셀펌칼륨(함성감미료, 메닐알라닌 함유)', '750ml', - '경북 문경시 동로면 노은1길 49-15', '경북', '2,500', 'https://shopping-phinf.pstatic.net/main_1302211/13022115312.jpg'); + price, image, latitude, longitude) +VALUES ('오미자 생막걸리', '생탁주', '문경주조', '6.5%', '정제수, 백미(국내산), 입국(쌀, 밀), 올리고당, 물엿, 허브(유기농), 오미자 2.4%(국내산, 문경로동산), 정제효소, 아스파탐·아세셀펌칼륨(함성감미료, 메닐알라닌 함유)', '750ml', '경북 문경시 동로면 노은1길 49-15', '경북', '2,500', + 'https://shopping-phinf.pstatic.net/main_1302211/13022115312.jpg', '36.772205009239599', '128.314028995874'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('술아 순곡주', '약주', '농업회사법인(주)술아원', '20%', '국내산 찹쌀, 누룩, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', - '36,000(375ml*2병)', 'https://shopping-phinf.pstatic.net/main_8244101/82441014737.1.jpg'); + price, image, latitude, longitude) +VALUES ('술아 순곡주', '약주', '농업회사법인(주)술아원', '20%', '국내산 찹쌀, 누룩, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', '36,000(375ml*2병)', + 'https://shopping-phinf.pstatic.net/main_8244101/82441014737.1.jpg', '37.383421504349897', '127.599983995584'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('술아 매화주', '약주', '농업회사법인(주)술아원', '15%', '국내산 찹쌀, 누룩, 건조매화꽃, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', - '36,000(375ml*2병)', 'https://shopping-phinf.pstatic.net/main_8244101/82441012783.1.jpg'); + price, image, latitude, longitude) +VALUES ('술아 매화주', '약주', '농업회사법인(주)술아원', '15%', '국내산 찹쌀, 누룩, 건조매화꽃, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', '36,000(375ml*2병)', + 'https://shopping-phinf.pstatic.net/main_8244101/82441012783.1.jpg', '37.383421504349897', '127.599983995584'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('계룡산 산삼주 금수강산 21%', '일반증류주', '농업회사법인 한국산삼(주)', '21%', '산양산삼, 정제주, 주정', '740ml', '충남 공주시 계룡면 여서울2길9', '충남', - '110,000', 'https://shopping-phinf.pstatic.net/main_8272037/82720370090.jpg'); + price, image, latitude, longitude) +VALUES ('계룡산 산삼주 금수강산 21%', '일반증류주', '농업회사법인 한국산삼(주)', '21%', '산양산삼, 정제주, 주정', '740ml', '충남 공주시 계룡면 여사울2길 9', '충남', '110,000', + 'https://shopping-phinf.pstatic.net/main_8272037/82720370090.jpg', '36.412774787926097', '127.151678229509'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('생 청주 막걸리', '탁주', '조은술 세종', '6%', '쌀, 소맥분, 국, 조제종국, 효모, 물엿 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', - '1,500', 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg'); + price, image, latitude, longitude) +VALUES ('생 청주 막걸리', '탁주', '조은술 세종', '6%', '쌀, 소맥분, 국, 조제종국, 효모, 물엿 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '1,500', + 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('정고집 옛날 생동동주', '탁주', '남도탁주', '6%', '쌀, 쌀가루(국내산), 조제종국, 정제효소, 젖산, 아스파탐, 아세셀팜칼', '750ml / 1,200ml', - '전남 나주시 노안면 노안로379', '전남', '18,000(750ml*10병), ₩28,000(1,200m*10병)', - 'https://shopping-phinf.pstatic.net/main_3757797/37577976080.jpg'); + price, image, latitude, longitude) +VALUES ('정고집 옛날 생동동주', '탁주', '남도탁주', '6%', '쌀, 쌀가루(국내산), 조제종국, 정제효소, 젖산, 아스파탐, 아세셀팜칼', '750ml / 1,200ml', '전남 나주시 노안면 노안로379', '전남', '18,000(750ml*10병), ₩28,000(1,200m*10병)', + 'https://shopping-phinf.pstatic.net/main_3757797/37577976080.jpg', '35.071896829590898', '126.734271400304'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('마셔블랑', '일반증류주', '농업회사법인(주)시트러스', '12%', '감귤과즙(한라봉), 백설탕, 액상효모, 무수아황산', '750ml', '제주특별자치도 서귀포시 남원읍 신례천로46', - '제주', '20,000', 'https://shopping-phinf.pstatic.net/main_2403856/24038568526.20200904115352.jpg'); + price, image, latitude, longitude) +VALUES ('마셔블랑', '일반증류주', '농업회사법인(주)시트러스', '12%', '감귤과즙(한라봉), 백설탕, 액상효모, 무수아황산', '750ml', '제주특별자치도 서귀포시 남원읍 신례천로46', '제주', '20,000', + 'https://shopping-phinf.pstatic.net/main_2403856/24038568526.20200904115352.jpg', '33.286622663977703', '126.62495592789'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('선운산 복분자주', '과실주', '(주)선운산복분자주 흥진', '16%', '복분자(고창산), 과당, 구연산, 아스파탐, 무수아황산', '375ml', '전북 고창군 부안면 복분자로535', - '전북', '25,000(375ml*4병 세트)', 'https://shopping-phinf.pstatic.net/main_2127671/21276710415.20191111114109.jpg'); + price, image, latitude, longitude) +VALUES ('선운산 복분자주', '과실주', '(주)선운산복분자주 흥진', '16%', '복분자(고창산), 과당, 구연산, 아스파탐, 무수아황산', '375ml', '전북 고창군 부안면 복분자로535', '전북', '25,000(375ml*4병 세트)', + 'https://shopping-phinf.pstatic.net/main_2127671/21276710415.20191111114109.jpg', '35.510942199674602', '126.64644550584801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('모월 인', '증류식소주', '협동조합 주담', '41%', '쌀(국내산), 누룩, 정제수', '500ml', '강원도 원주시 판부면 판부신촌길 84', '강원', '40,000', - 'https://shopping-phinf.pstatic.net/main_8459419/84594193071.7.jpg'); + 'https://shopping-phinf.pstatic.net/main_8459419/84594193071.7.jpg', '37.299414999973003', '127.97345115422701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('해파랑', '약주', '농업회사법인(주)영덕주조', '13%', '쌀(국내산), 해방풍(국내산), 계량누룩, 젖산, 이소말토올리고당, 정제수', '375ml', - '경북 영덕군 강구면 소월1길 16-10', '경북', '10,000', - 'https://shopping-phinf.pstatic.net/main_3872126/38721265750.20230718023950.jpg'); + price, image, latitude, longitude) +VALUES ('해파랑', '약주', '농업회사법인(주)영덕주조', '13%', '쌀(국내산), 해방풍(국내산), 계량누룩, 젖산, 이소말토올리고당, 정제수', '375ml', '경북 영덕군 강구면 소월1길 16-10', '경북', '10,000', + 'https://shopping-phinf.pstatic.net/main_3872126/38721265750.20230718023950.jpg', '36.379353762831599', '129.374510560467'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('사과와인', '과실주', '영농조합법인 금이산농원', '12%', '사과(국내산), 백설탕, 효모, 메타중아황산칼륨', '500ml', '세종시 전의면 가느실길 127', '세종', '20,000', - 'https://shopping-phinf.pstatic.net/main_2404086/24040865528.20200904150813.jpg'); + 'https://shopping-phinf.pstatic.net/main_2404086/24040865528.20200904150813.jpg', '36.640502652310801', '127.18926016454699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('도구 막걸리', '탁주', '동해명주', '6%', '밀(외국산), 쌀(국내산, 외국산), 물엿, 효모, 조제종국, 정제효소제, 아스파탐, 젖산', '750ml', - '경북 포항시 남구 동해면 일월리 51-1', '경북', '15,000(750ml*9병)', - 'https://shopping-phinf.pstatic.net/main_3892410/38924102968.20230724080824.jpg'); + price, image, latitude, longitude) +VALUES ('도구 막걸리', '탁주', '동해명주', '6%', '밀(외국산), 쌀(국내산, 외국산), 물엿, 효모, 조제종국, 정제효소제, 아스파탐, 젖산', '750ml', '경북 포항시 남구 동해면 일월로 51-1', '경북', '15,000(750ml*9병)', + 'https://shopping-phinf.pstatic.net/main_3892410/38924102968.20230724080824.jpg', '35.9890551664434', '129.43864414901401'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('장수 오미자주', '과실주', '농업회사법인 (주)알에프', '16.5%', '오미자(국내산), 정제수, 주정, 설탕, 효모', '360ml', '전북 장수군 계남면 침곡로 11-26', '전북', - '5,400', 'https://shopping-phinf.pstatic.net/main_2407005/24070052522.20200907172232.jpg'); + price, image, latitude, longitude) +VALUES ('장수 오미자주', '과실주', '농업회사법인 (주)알에프', '16.5%', '오미자(국내산), 정제수, 주정, 설탕, 효모', '360ml', '전북 장수군 계남면 침곡로 11-26', '전북', '5,400', + 'https://shopping-phinf.pstatic.net/main_2407005/24070052522.20200907172232.jpg', '35.713974812008502', '127.579740614995'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('술헤는밤', '탁주', '농업회사법인 두루(주)', '8%', '국내산쌀, 누룩, 정제수', '750ml', '강원도 홍천 내촌면 용포길 31-25', '강원', '5,900', - 'https://shopping-phinf.pstatic.net/main_8214102/82141024818.jpg'); + 'https://shopping-phinf.pstatic.net/main_8214102/82141024818.jpg', '37.814024413609701', '128.05857840803199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('흑돈주', '기타주류', '왕지케양조장 (제주본초협동조합)', '16%', '황칠나무(제주산), 정제수, 포도당, 효모', '365ml', '제주특별자치도 제주시 한경면 고산로 2길 22-13', - '제주', '12,000원', 'https://shopping-phinf.pstatic.net/main_8462211/84622119340.2.jpg'); + price, image, latitude, longitude) +VALUES ('흑돈주', '기타주류', '왕지케양조장 (제주본초협동조합)', '16%', '황칠나무(제주산), 정제수, 포도당, 효모', '365ml', '제주특별자치도 제주시 한경면 고산로 2길 22-13', '제주', '12,000원', + 'https://shopping-phinf.pstatic.net/main_8462211/84622119340.2.jpg', '33.302547681846399', '126.182306376797'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('모을동주 소주', '증류식소주', '대작영농조합법인', '43%', '쌀(국내산), 조제종국 효모, 정제효소, 정제수', '350ml', '강원도 철원군 동송읍 이평로34번길 20-28', '강원', - '15,000', 'https://shopping-phinf.pstatic.net/main_8611286/86112863900.jpg'); + price, image, latitude, longitude) +VALUES ('모을동주 소주', '증류식소주', '대작영농조합법인', '43%', '쌀(국내산), 조제종국 효모, 정제효소, 정제수', '350ml', '강원도 철원군 동송읍 이평로34번길 20-28', '강원', '15,000', + 'https://shopping-phinf.pstatic.net/main_8611286/86112863900.jpg', '38.2111558989332', '127.22127362829001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('모을동주 약주', '약주', '대작영농조합법인', '13%', '쌀(국내산), 조제종국 효모, 정제효소, 정제수', '375ml', '강원도 철원군 동송읍 이평로34번길 20-28', '강원', - '13,000', 'https://shopping-phinf.pstatic.net/main_4070526/40705262031.jpg'); + price, image, latitude, longitude) +VALUES ('모을동주 약주', '약주', '대작영농조합법인', '13%', '쌀(국내산), 조제종국 효모, 정제효소, 정제수', '375ml', '강원도 철원군 동송읍 이평로34번길 20-28', '강원', '13,000', + 'https://shopping-phinf.pstatic.net/main_4070526/40705262031.jpg', '38.2111558989332', '127.22127362829001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('기다림 34', '탁주', '농업회사법인(주)제이케이크래프트', '12%', '멥쌀(국내산), 찹쌀(국내산), 곡자(밀누룩 국내산), 정제수', '500ml', - '부산광역시 동래구 사직북로48번길 34', '부산', '15,000', 'https://shopping-phinf.pstatic.net/main_3617455/36174554313.jpg'); + price, image, latitude, longitude) +VALUES ('기다림 34', '탁주', '농업회사법인(주)제이케이크래프트', '12%', '멥쌀(국내산), 찹쌀(국내산), 곡자(밀누룩 국내산), 정제수', '500ml', '부산광역시 동래구 사직북로48번길 34', '부산', '15,000', + 'https://shopping-phinf.pstatic.net/main_3617455/36174554313.jpg', '35.200541465722701', '129.06043945188'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('볼빨간막걸리 7', '탁주', '농업회사법인 (주)벗드림', '7%', '찹쌀(국내산), 누룩, 정제수', '500ml', '부산광역시 북구 덕천로247번길 3, 2층', '부산', '5,000', - 'https://shopping-phinf.pstatic.net/main_3972915/39729158602.20230501191324.jpg'); + 'https://shopping-phinf.pstatic.net/main_3972915/39729158602.20230501191324.jpg', '35.2109717267058', '129.031358852523'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('그랑꼬또 화이트와인', '과실주', '그린영농조합법인', '12%', '포도(캠벨얼리)', '750ml', '경기도 안산시 단원구 뻐꾹산길 107(대부북동)', '경기', '40,000', - 'https://shopping-phinf.pstatic.net/main_8265135/82651356839.4.jpg'); + 'https://shopping-phinf.pstatic.net/main_8265135/82651356839.4.jpg', '37.257471389325403', '126.582545230378'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('애석', '약주', '농업회사법인 두루(주)', '15%', '국내산쌀, 누룩, 정제수', '500ml', '강원도 홍천 내촌면 용포길 31-25', '강원', '30,000', - 'https://shopping-phinf.pstatic.net/main_3567696/35676966237.20221107161235.jpg'); + 'https://shopping-phinf.pstatic.net/main_3567696/35676966237.20221107161235.jpg', '37.814024413609701', '128.05857840803199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('진맥소주 53%', '증류식소주', '농업회사법인 (주)밀과노닐다', '53%', '유기농 우리밀 100%', '200ml / 500ml', '경북 안동시 도산면 신성중앙길32', '경북', - '200ml ₩39,000, 500ml ₩88,000', 'https://shopping-phinf.pstatic.net/main_8261582/82615821428.jpg'); + price, image, latitude, longitude) +VALUES ('진맥소주 53%', '증류식소주', '농업회사법인 (주)밀과노닐다', '53%', '유기농 우리밀 100%', '200ml / 500ml', '경북 안동시 도산면 신성중앙길32', '경북', '200ml ₩39,000, 500ml ₩88,000', + 'https://shopping-phinf.pstatic.net/main_8261582/82615821428.jpg', '36.765562810421997', '128.88020251773901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시나브로 로제와인', '과실주', '불휘농장', '10%', '포도(국내산_캠벨얼리)', '500ml', '충북 영동군 심천면 약목2길26', '충북', '30,000', - 'https://shopping-phinf.pstatic.net/main_8041141/80411418330.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8041141/80411418330.2.jpg', '36.201913743030801', '127.72029368720899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('그랑티그르M1988', '과실주', '월류원 (오드린)', '12%', '포도(캠벨얼리), 오미자', '750ml', '충북 영동군 황간면 남성동3길 4-14', '충북', '40,000', - 'https://shopping-phinf.pstatic.net/main_4090781/40907819908.jpg'); + 'https://shopping-phinf.pstatic.net/main_4090781/40907819908.jpg', '36.233829266636299', '127.910170927446'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('배도가 로아 19 레드', '일반증류주', '주식회사 배혜정 농업회사법인', '19%', '사과(국내산)', '350ml', '경기도 화성시 정남면 서봉로 835', '경기', '10,000', - 'https://shopping-phinf.pstatic.net/main_3315442/33154423623.20220627123544.jpg'); + 'https://shopping-phinf.pstatic.net/main_3315442/33154423623.20220627123544.jpg', '37.149585899755898', '126.96094622808'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('연천 연주', '약주', '농업회사법인 연천양조(주)', '12%', '쌀(국내산), 누룩, 정제수', '500ml', '경기도 연천군 마산면 청정로 1738번길 15', '경기', '15,000', - 'https://shopping-phinf.pstatic.net/main_8598013/85980137507.jpg'); + 'https://shopping-phinf.pstatic.net/main_8598013/85980137507.jpg', '38.0833213060315', '127.041489522638'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('한산소곡주_생주', '약주', '녹천주조장', '16%', '찹쌀, 누룩, 백미, 정제수', '750ml', '충청남도 서천군 한산면 한마로 105', '충남', '12,000', - 'https://shopping-phinf.pstatic.net/main_2884218/28842184588.20210914121827.jpg'); + 'https://shopping-phinf.pstatic.net/main_2884218/28842184588.20210914121827.jpg', '36.0892972955549', '126.801257103803'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('초선의 꿈 (로제)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '375ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', - '20,000', 'https://shopping-phinf.pstatic.net/main_3257940/32579400619.20220525152211.jpg'); + price, image, latitude, longitude) +VALUES ('초선의 꿈 (로제)', '과실주 (포도)', '여포와인농장', '12%', '국내산 포도 100%', '375ml', '충북 영동군 양강면 유점지촌길 75(여포와인농장)', '충북', '20,000', + 'https://shopping-phinf.pstatic.net/main_3257940/32579400619.20220525152211.jpg', '36.126228935186901', '127.744545237346'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('천년전주 생 막걸리', '생탁주', '(유)산에들에 농업회사법인', '6%', '정제수, 쌀, 소맥분, 수쿠랄로스, 효모, 젖산, 정제효소', '750ml', '전북 완주군 구이면 구이로 885', - '전북', '1,300', 'https://shopping-phinf.pstatic.net/main_8313178/83131787583.1.jpg'); + price, image, latitude, longitude) +VALUES ('천년전주 생 막걸리', '생탁주', '(유)산에들에 농업회사법인', '6%', '정제수, 쌀, 소맥분, 수쿠랄로스, 효모, 젖산, 정제효소', '750ml', '전북 완주군 구이면 구이로 885', '전북', '1,300', + 'https://shopping-phinf.pstatic.net/main_8313178/83131787583.1.jpg', '35.680515716454302', '127.114971426445'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('미르40', '증류식소주', '술샘', '40%', '쌀(국내산 경기미 100%), 누룩, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', - '23,000', 'https://shopping-phinf.pstatic.net/main_1215430/12154300029.20220808140826.jpg'); + price, image, latitude, longitude) +VALUES ('미르40', '증류식소주', '술샘', '40%', '쌀(국내산 경기미 100%), 누룩, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', '23,000', + 'https://shopping-phinf.pstatic.net/main_1215430/12154300029.20220808140826.jpg', '37.233502177738202', '127.298614632461'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('유자 생 막걸리', '생탁주', '배혜정 도가', '5%', '쌀, 유자, 정제수, 고과당, 효모 등', '750ml', '경기도 화성시 정남면 문학리 674-23', '경기', '1,800', - 'https://shopping-phinf.pstatic.net/main_2941313/29413130619.20211026151905.jpg'); + 'https://shopping-phinf.pstatic.net/main_2941313/29413130619.20211026151905.jpg', '37.149336281531802', '126.960871275363'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('샤토미소 스위트', '과실주', '도란원', '12%', '포도, 산화방지제, 효모, 설탕 등', '750ml', '충북 영동군 매곡면 유전 장척길 143', '충북', '20,000', - 'https://shopping-phinf.pstatic.net/main_3864251/38642510620.20230314172618.jpg'); + 'https://shopping-phinf.pstatic.net/main_3864251/38642510620.20230314172618.jpg', '36.1920939357517', '127.936725157583'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('컨츄리 산머루 와인 (스위트)', '과실주', '컨츄리 농원', '12%', '국산 산머루원액 100%', '750ml', '충북 영동군 영동읍 주곡리 590-14', '충북', '20,000', - 'https://shopping-phinf.pstatic.net/main_1193837/11938371553.jpg'); + 'https://shopping-phinf.pstatic.net/main_1193837/11938371553.jpg', '36.177871843973797', '127.83305038076'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('미소 아이스', '과실주', '도란원', '12%', '포도, 산화방지제, 효모 등', '375ml', '충북 영동군 매곡면 유전 장척길 143', '충북', '40,000', - 'https://shopping-phinf.pstatic.net/main_2407373/24073733349.20200907221916.jpg'); + 'https://shopping-phinf.pstatic.net/main_2407373/24073733349.20200907221916.jpg', '36.1920939357517', '127.936725157583'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('다래와인 7004S', '과실주', '영농조합법인 오름주가', '8%', '참다래', '750ml', '경상남도 사천시 미룡길 31-20', '경남', '18,000', - 'https://shopping-phinf.pstatic.net/main_4059865/40598650620.20230614153115.jpg'); + 'https://shopping-phinf.pstatic.net/main_4059865/40598650620.20230614153115.jpg', '34.986470058128702', '128.055498424505'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('미르25', '증류식소주', '술샘', '25%', '쌀(국내산 경기미 100%), 누룩, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', - '18,000', 'https://shopping-phinf.pstatic.net/main_1215428/12154281947.20220808135409.jpg'); + price, image, latitude, longitude) +VALUES ('미르25', '증류식소주', '술샘', '25%', '쌀(국내산 경기미 100%), 누룩, 정제수', '375ml', '경기도 용인시 처인구 양지면 죽양대로 2298-1', '경기', '18,000', + 'https://shopping-phinf.pstatic.net/main_1215428/12154281947.20220808135409.jpg', '37.233502177738202', '127.298614632461'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('두레앙 증류주', '일반증류주', '농업회사법인(주)두레양조', '35%', '거봉포도원액', '750ml', '충남 천안시 서북구 입장면 율목길17-6', '충남', '35,000', - 'https://shopping-phinf.pstatic.net/main_3545967/35459679412.jpg'); + 'https://shopping-phinf.pstatic.net/main_3545967/35459679412.jpg', '36.913552838896202', '127.20273128950799'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('소곡화주', '리큐르', '녹천주조장', '41%', '찹쌀, 누룩, 백미, 정제수', '500ml', '충청남도 서천군 한산면 한마로 105', '충남', '22,000', - 'https://shopping-phinf.pstatic.net/main_1742136/17421366543.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_1742136/17421366543.1.jpg', '36.0892972955549', '126.801257103803'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('민속주 안동소주', '증류식소주', '민속주안동소주', '45%', '쌀(국내산), 누룩, 정제수', '600ml', '경북 안동시 강남로 71-1', '경북', '28,000', - 'https://shopping-phinf.pstatic.net/main_8302388/83023882407.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8302388/83023882407.1.jpg', '36.549763429825802', '128.708699757434'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('면천두견주', '약주', '(주)면천두견주', '18%', '국내산 찹쌀, 누룩, 진달래꽃', '700ml', '충남 당진시 면천로 성하로 250', '충남', '30,000(700ml*2병)', - 'https://shopping-phinf.pstatic.net/main_8278655/82786556090.jpg'); + price, image, latitude, longitude) +VALUES ('면천두견주', '약주', '(주)면천두견주', '18%', '국내산 찹쌀, 누룩, 진달래꽃', '700ml', '충남 당진시 면천면 성하로 250', '충남', '30,000(700ml*2병)', + 'https://shopping-phinf.pstatic.net/main_8278655/82786556090.jpg', '36.8128310711189', '126.66286381048'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('동정춘', '탁주', '농업회사법인(주)산수', '8%', '쌀, 누국, 정제수', '500ml', '강원도 홍천군 화촌면 야시대로 211-57', '강원', '18,000', - 'https://shopping-phinf.pstatic.net/main_8163398/81633980015.jpg'); + 'https://shopping-phinf.pstatic.net/main_8163398/81633980015.jpg', '37.796095256391098', '127.967935231575'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('감아락 25도', '일반증류주', '(주)배상면주가', '25%', '감증류원액, 쌀(국내산)', '500ml', '경기도 포천시 화현면 화동로 432번길 25', '경기', '26,000', - 'https://shopping-phinf.pstatic.net/main_8459419/84594193070.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8459419/84594193070.2.jpg', '37.905995687213199', '127.30990487507501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('민속주안동소주', '증류식소주', '민속주안동소주', '45%', '쌀(국내산), 누룩, 정제수', '400ml', '경북 안동시 강남로 71-1', '경북', '28,000', - 'https://shopping-phinf.pstatic.net/main_8313574/83135741515.jpg'); + 'https://shopping-phinf.pstatic.net/main_8313574/83135741515.jpg', '36.549763429825802', '128.708699757434'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('예담은 한산소곡주', '약주', '한산예담은소곡주', '16%', '찹쌀, 멥쌀, 누룩, 대두, 구절초', '750ml', '충청남도 서천군 한산면 한마로 5(동산리)', '충남', '12,000', - 'https://shopping-phinf.pstatic.net/main_1190080/11900802463.20200429150600.jpg'); + 'https://shopping-phinf.pstatic.net/main_1190080/11900802463.20200429150600.jpg', '36.0860567020028', '126.809418967434'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('천지주가 생 막걸리', '생탁주', '(유)산에들에 농업회사법인', '6%', '쌀, 정제수, 국, 효모 등', '750ml', '전북 완주군 구이면 구이로 885', '전북', '1,400', - 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg'); + 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg', '35.680515716454302', '127.114971426445'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('김포특주', '약주', '김포금쌀탁주영농조합법인', '15%', '국내산 쌀, 효모, 정제효소, 정제수, 프락토올리고당', '375ml', '경기도 김포시 하성면 하성로 622', '경기', - '3,000', 'https://shopping-phinf.pstatic.net/main_8230981/82309814944.jpg'); + price, image, latitude, longitude) +VALUES ('김포특주', '약주', '김포금쌀탁주영농조합법인', '15%', '국내산 쌀, 효모, 정제효소, 정제수, 프락토올리고당', '375ml', '경기도 김포시 하성면 하성로 622', '경기', '3,000', + 'https://shopping-phinf.pstatic.net/main_8230981/82309814944.jpg', '37.728587106278198', '126.629076579878'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('바나나 주', '기타주류', '조은술 세종', '4%', '쌀, 국 , 정제수, 바나나 농축액, 조제종국, 효모, 물엿 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', - '충북', '1,700', 'https://shopping-phinf.pstatic.net/main_8316588/83165886208.jpg'); + price, image, latitude, longitude) +VALUES ('바나나 주', '기타주류', '조은술 세종', '4%', '쌀, 국 , 정제수, 바나나 농축액, 조제종국, 효모, 물엿 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '1,700', + 'https://shopping-phinf.pstatic.net/main_8316588/83165886208.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('지리산정담생쌀 막걸리', '탁주', '지리산그린영농조합 운봉주조', '6%', '쌀(국내산), 종국, 정제수, 누룩, 효모', '750ml', '전라북도 남원시 운봉읍 황산로 1018', '전북', - '1,500', 'https://shopping-phinf.pstatic.net/main_8305597/83055973637.2.jpg'); + price, image, latitude, longitude) +VALUES ('지리산정담생쌀 막걸리', '탁주', '지리산그린영농조합 운봉주조', '6%', '쌀(국내산), 종국, 정제수, 누룩, 효모', '750ml', '전라북도 남원시 운봉읍 황산로 1018', '전북', '1,500', + 'https://shopping-phinf.pstatic.net/main_8305597/83055973637.2.jpg', '35.437291911597697', '127.524013307426'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('천비향 화주', '증류식소주', '농업회사법인(주)좋은술', '40%', '국내산 쌀, 누룩', '375ml', '경기도 평택시 오성면 숙성뜰길 108', '경기', '50,000', - 'https://shopping-phinf.pstatic.net/main_1316773/13167732287.7.jpg'); + 'https://shopping-phinf.pstatic.net/main_1316773/13167732287.7.jpg', '37.000493267959698', '126.98939334495201'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('수삼단본 23도', '일반증류주', '농업회사법인(주)금산인삼주', '23%', '쌀, 인삼, 누룩, 정제수 등', '720ml', '충남 금산군 금성면 파초길 23', '충남', '32,000', - 'https://shopping-phinf.pstatic.net/main_4051919/40519190135.jpg'); + 'https://shopping-phinf.pstatic.net/main_4051919/40519190135.jpg', '36.127661377353597', '127.466418152423'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('김포 막걸리', '탁주', '김포양조', '6%', '쌀, 누룩, 정제수', '750ml', '경기도 김포시 월곶면 김포대로 2763', '경기', '1,200', - 'https://shopping-phinf.pstatic.net/main_2941334/29413342619.20211026152529.jpg'); + 'https://shopping-phinf.pstatic.net/main_2941334/29413342619.20211026152529.jpg', '37.711509317937598', '126.546803490044'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('왕율주', '일반증류주', '농업회사법인 사곡양조원', '25%', '국내산 쌀, 밤, 누룩, 정제수', '330ml', '충남 공주시 사곡면 마곡사로 49', '충남', '8,000', - 'https://shopping-phinf.pstatic.net/main_8089122/80891229790.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8089122/80891229790.1.jpg', '36.498162563814503', '127.028732308614'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('미인탁주', '탁주', '최행숙 전통주가', '10%', '찹쌀, 누룩, 정제수', '500ml', '경기도 파주시 법원읍 사임당로 763', '경기', '15,000', - 'https://shopping-phinf.pstatic.net/main_3985882/39858823639.jpg'); + 'https://shopping-phinf.pstatic.net/main_3985882/39858823639.jpg', '37.8500082336259', '126.86550419641399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('오미로제 프리미어와인', '과실주', '농업회사법인(주)제이엘', '12%', '오미자(문경산)', '750ml', '경북 문경시 문경읍 새재로 609', '경북', '39,000', - 'https://shopping-phinf.pstatic.net/main_1324006/13240062937.6.jpg'); + 'https://shopping-phinf.pstatic.net/main_1324006/13240062937.6.jpg', '36.736133308451798', '128.09134747187099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('뱅꼬레아이스', '과실주', '(주)한국와인', '12%', '양조용포도(경북 영천)', '375ml', '경북 영천시 금호읍 창산길 100-44', '경북', '90,000', - 'https://shopping-phinf.pstatic.net/main_3912440/39124402619.20230403111510.jpg'); + 'https://shopping-phinf.pstatic.net/main_3912440/39124402619.20230403111510.jpg', '35.906983465688199', '128.882685333909'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('무주 구천동 산머루주', '과실주', '덕유양조', '16%', '국내산 산머루', '750ml', '전북 무주군 안성면 장무로 1375-7', '전북', '15,000', - 'https://shopping-phinf.pstatic.net/main_3291791/32917910624.20220613165702.jpg'); + 'https://shopping-phinf.pstatic.net/main_3291791/32917910624.20220613165702.jpg', '35.814874542122503', '127.63055424029299'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('뱅꼬레로제', '과실주', '(주)한국와인', '11.5%', '양조용포도(경북 영천)', '375ml', '경북 영천시 금호읍 창산길 100-44', '경북', '23,000', - 'https://shopping-phinf.pstatic.net/main_8016540/80165404032.4.jpg'); + 'https://shopping-phinf.pstatic.net/main_8016540/80165404032.4.jpg', '35.906983465688199', '128.882685333909'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('도문대작 생막걸리', '탁주', '방풍도가', '10%', '강릉 쌀, 누룩, 갯방풍나물, 정제수', '750ml', '강원도 강릉시 미노길 103', '강원', '3,000', - 'https://shopping-phinf.pstatic.net/main_4081952/40819525599.jpg'); + 'https://shopping-phinf.pstatic.net/main_4081952/40819525599.jpg', '37.826503892599199', '128.84856690715799'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('오희 스파클링 막걸리', '탁주', '문경주조', '8.5%', '백미, 건오미자, 조효소제, 효모, 정제수', '500ml', '경북 문경시 동로면 노은1길 49-15', '경북', - '36,000(500ml*2병)', 'https://shopping-phinf.pstatic.net/main_1909252/19092520571.20190506132931.jpg'); + price, image, latitude, longitude) +VALUES ('오희 스파클링 막걸리', '탁주', '문경주조', '8.5%', '백미, 건오미자, 조효소제, 효모, 정제수', '500ml', '경북 문경시 동로면 노은1길 49-15', '경북', '36,000(500ml*2병)', + 'https://shopping-phinf.pstatic.net/main_1909252/19092520571.20190506132931.jpg', '36.772205009239599', '128.314028995874'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('애피소드 애플', '과실주', '(주)한국애플리즈', '3.5%', '사과와인, 정제주정, 정제수, 사과농축액, 고과당', '500ml', '경북 의성군 단촌면 일직점곡로 755', '경북', - '21,000(500ml*6병)', 'https://shopping-phinf.pstatic.net/main_3311927/33119273618.20220624142012.jpg'); + price, image, latitude, longitude) +VALUES ('애피소드 애플', '과실주', '(주)한국애플리즈', '3.5%', '사과와인, 정제주정, 정제수, 사과농축액, 고과당', '500ml', '경북 의성군 단촌면 일직점곡로 755', '경북', '21,000(500ml*6병)', + 'https://shopping-phinf.pstatic.net/main_3311927/33119273618.20220624142012.jpg', '36.437001839678501', '128.72290274697301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('계룡산 산삼주 금수강산 40%', '일반증류주', '농업회사법인 한국산삼(주)', '40%', '산양산삼, 정제주, 주정', '740ml', '충남 공주시 계룡면 여서울2길9', '충남', - '150,000', 'https://shopping-phinf.pstatic.net/main_8272037/82720370090.jpg'); + price, image, latitude, longitude) +VALUES ('계룡산 산삼주 금수강산 40%', '일반증류주', '농업회사법인 한국산삼(주)', '40%', '산양산삼, 정제주, 주정', '740ml', '충남 공주시 계룡면 여사울2길 9', '충남', '150,000', + 'https://shopping-phinf.pstatic.net/main_8272037/82720370090.jpg', '36.412774787926097', '127.151678229509'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('청진주', '약주', '전통주연구개발원', '16%', '찹쌀, 누룩, 정제수', '375ml', '경기도 가평군 가평읍 분자골로68번길 82', '경기', '30,000', - 'https://shopping-phinf.pstatic.net/main_3657922/36579226165.20230525233034.jpg'); + 'https://shopping-phinf.pstatic.net/main_3657922/36579226165.20230525233034.jpg', '37.763093765681703', '127.49934117062'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('진쾌남', '리큐르', '농업회사법인 사곡양조원', '25%', '국내산 쌀, 밤, 누룩, 구기자, 오미자, 산수유, 오가피, 동충하초, 정제수', '330ml', - '충남 공주시 사곡면 마곡사로 49', '충남', '8,500', - 'https://shopping-phinf.pstatic.net/main_2067756/20677565547.20190820144941.jpg'); + price, image, latitude, longitude) +VALUES ('진쾌남', '리큐르', '농업회사법인 사곡양조원', '25%', '국내산 쌀, 밤, 누룩, 구기자, 오미자, 산수유, 오가피, 동충하초, 정제수', '330ml', '충남 공주시 사곡면 마곡사로 49', '충남', '8,500', + 'https://shopping-phinf.pstatic.net/main_2067756/20677565547.20190820144941.jpg', '36.498162563814503', '127.028732308614'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('미인약주', '약주', '최행숙 전통주가', '15%', '찹쌀, 누룩, 정제수', '500ml', '경기도 파주시 법원읍 사임당로 763', '경기', '25,000', - 'https://shopping-phinf.pstatic.net/main_3986102/39861023356.jpg'); + 'https://shopping-phinf.pstatic.net/main_3986102/39861023356.jpg', '37.8500082336259', '126.86550419641399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('백자주', '탁주', '농업회사법인(주)산수', '10%', '국내산 찹쌀, 멥쌀, 잣, 누룩, 정제수', '500ml', '강원도 홍천군 화촌면 야시대로 211-57', '강원', '18,000', - 'https://shopping-phinf.pstatic.net/main_8333467/83334675407.jpg'); + 'https://shopping-phinf.pstatic.net/main_8333467/83334675407.jpg', '37.796095256391098', '127.967935231575'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('감그린 아이스와인', '과실주', '청도감와인(주)', '10%', '감(국내산)', '375ml', '경북 청도군 풍각면 봉길1길27', '경북', '89,000', - 'https://shopping-phinf.pstatic.net/main_3912334/39123349620.20230403103431.jpg'); + price, image, latitude, longitude) +VALUES ('감그린 아이스와인', '과실주', '청도감와인(주)', '10%', '감(국내산)', '375ml', '경북 청도군 화양읍 송금길 100', '경북', '89,000', + 'https://shopping-phinf.pstatic.net/main_3912334/39123349620.20230403103431.jpg', '35.715140164656603', '128.720534775423'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('감그린 스페셜', '과실주', '청도감와인(주)', '12%', '감(국내산)', '750ml', '경북 청도군 풍각면 봉길1길27', '경북', '25,000', - 'https://shopping-phinf.pstatic.net/main_8046461/80464615574.jpg'); + price, image, latitude, longitude) +VALUES ('감그린 스페셜', '과실주', '청도감와인(주)', '12%', '감(국내산)', '750ml', '경북 청도군 화양읍 송금길 100', '경북', '25,000', + 'https://shopping-phinf.pstatic.net/main_8046461/80464615574.jpg', '35.715140164656603', '128.720534775423'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('한비 오가피술', '리큐르', '제천한약영농조합법인', '35%', '국내산 쌀, 누룩, 가시오가피 뿌리, 정제수', '375ml / 750ml', '충북 제천시 봉양읍 북부로 5길 16-10', - '충북', '30,000(375ml), ₩50,000(750ml)', 'https://shopping-phinf.pstatic.net/main_2478673/24786735548.3.jpg'); + price, image, latitude, longitude) +VALUES ('한비 오가피술', '리큐르', '제천한약영농조합법인', '35%', '국내산 쌀, 누룩, 가시오가피 뿌리, 정제수', '375ml / 750ml', '충북 제천시 봉양읍 북부로 5길 16-10', '충북', '30,000(375ml), ₩50,000(750ml)', + 'https://shopping-phinf.pstatic.net/main_2478673/24786735548.3.jpg', '37.133529256317203', '128.08870720361699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('한비 동충하초술', '리큐르', '제천한약영농조합법인', '35%', '국내산 쌀, 누룩, 가시오가피 뿌리, 동충하초, 정제수', '375ml / 750ml', - '충북 제천시 봉양읍 북부로 5길 16-10', '충북', '30,000(375ml), ₩50,000(750ml)', - 'https://shopping-phinf.pstatic.net/main_1964548/19645484324.1.jpg'); + price, image, latitude, longitude) +VALUES ('한비 동충하초술', '리큐르', '제천한약영농조합법인', '35%', '국내산 쌀, 누룩, 가시오가피 뿌리, 동충하초, 정제수', '375ml / 750ml', '충북 제천시 봉양읍 북부로 5길 16-10', '충북', '30,000(375ml), ₩50,000(750ml)', + 'https://shopping-phinf.pstatic.net/main_1964548/19645484324.1.jpg', '37.133529256317203', '128.08870720361699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('애피소드 상그리아', '과실주', '(주)한국애플리즈', '3.5%', '포도와인, 정제주정, 정제수, 포도농축액, 고과당', '500ml', '경북 의성군 단촌면 일직점곡로 755', '경북', - '21,000(500ml*6병)', 'https://shopping-phinf.pstatic.net/main_3311920/33119203619.20220624142426.jpg'); + price, image, latitude, longitude) +VALUES ('애피소드 상그리아', '과실주', '(주)한국애플리즈', '3.5%', '포도와인, 정제주정, 정제수, 포도농축액, 고과당', '500ml', '경북 의성군 단촌면 일직점곡로 755', '경북', '21,000(500ml*6병)', + 'https://shopping-phinf.pstatic.net/main_3311920/33119203619.20220624142426.jpg', '36.437001839678501', '128.72290274697301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('애피소드 호프', '기타주류', '(주)한국애플리즈', '3.5%', '사과과즙, 보리, 쌀, 홉', '500ml', '경북 의성군 단촌면 일직점곡로 755', '경북', - '21,000(500ml*6병)', 'https://shopping-phinf.pstatic.net/main_4060392/40603923321.20230614215209.jpg'); + price, image, latitude, longitude) +VALUES ('애피소드 호프', '기타주류', '(주)한국애플리즈', '3.5%', '사과과즙, 보리, 쌀, 홉', '500ml', '경북 의성군 단촌면 일직점곡로 755', '경북', '21,000(500ml*6병)', + 'https://shopping-phinf.pstatic.net/main_4060392/40603923321.20230614215209.jpg', '36.437001839678501', '128.72290274697301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('예밀와인 로제', '과실주', '예밀2리영농조합법인', '12%', '포도(캠벨얼리)', '750ml', '강원도 영월군 김삿갓면 예밀촌길 228-20', '강원', '20,000', - 'https://shopping-phinf.pstatic.net/main_8325340/83253400509.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8325340/83253400509.1.jpg', '37.1429450352326', '128.59223300382399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('세종대왕어주 약주', '약주', '농업회사법인 장희도가(주)', '15%', '쌀(국내산), 누룩, 정제수', '500ml', '충북 청주시 청원구 내수읍 미원초정로 1275', '충북', - '25,900', 'https://shopping-phinf.pstatic.net/main_1262358/12623589756.1.jpg'); + price, image, latitude, longitude) +VALUES ('세종대왕어주 약주', '약주', '농업회사법인 장희도가(주)', '15%', '쌀(국내산), 누룩, 정제수', '500ml', '충북 청주시 청원구 내수읍 미원초정로 1275', '충북', '25,900', + 'https://shopping-phinf.pstatic.net/main_1262358/12623589756.1.jpg', '36.714252378043', '127.605099656731'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시나브로 에뚜왈 스파클링와인', '과실주', '불휘농장', '5%', '포도(청수)', '750ml', '충북 영동군 심천면 약목2길26', '충북', '30,000', - 'https://shopping-phinf.pstatic.net/main_4061131/40611318746.jpg'); + 'https://shopping-phinf.pstatic.net/main_4061131/40611318746.jpg', '36.201913743030801', '127.72029368720899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('편백숲 산소막걸리', '탁주', '농업회사법인 (주)청산녹수', '5.2%', '멥쌀, 올리고당, 사과농축액, 누룩, 아스파탐', '750ml', '전남 장성군 장성읍 남양촌길(백계리) 19', - '전남', '1,900', 'https://shopping-phinf.pstatic.net/main_2958927/29589270115.2.jpg'); + price, image, latitude, longitude) +VALUES ('편백숲 산소막걸리', '탁주', '농업회사법인 (주)청산녹수', '5.2%', '멥쌀, 올리고당, 사과농축액, 누룩, 아스파탐', '750ml', '전남 장성군 장성읍 남양촌길(백계리) 19', '전남', '1,900', + 'https://shopping-phinf.pstatic.net/main_2958927/29589270115.2.jpg', '35.345218252623603', '126.812850520064'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('병영설성사또', '일반증류주', '병영양조장', '40%', '쌀(국내산), 효모, 누룩, 정제수', '700ml', '전남 강진군 병영로 하멜로 407', '전남', '40,000', - 'https://shopping-phinf.pstatic.net/main_3729830/37298307341.jpg'); + price, image, latitude, longitude) +VALUES ('병영설성사또', '일반증류주', '병영양조장', '40%', '쌀(국내산), 효모, 누룩, 정제수', '700ml', '전남 강진군 병영면 하멜로 407', '전남', '40,000', + 'https://shopping-phinf.pstatic.net/main_3729830/37298307341.jpg', '34.716166108572502', '126.814735606588'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('석탄주 약주', '약주', '케이소주 (전주가양주연구소)', '15%', '국내산 찹쌀, 누룩, 정제수', '500ml', '전북 전주시 완산구 중산중앙로27. 3층', '전북', '7,000', - 'https://shopping-phinf.pstatic.net/main_8326514/83265149287.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8326514/83265149287.1.jpg', '35.816654689827899', '127.12120420246499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('예천주복 만월40', '일반증류주', '농업회사법인(주)착한농부', '40%', '복분자(국내산)증류원액, 복분자(국내산)과즙, 정제수', '350ml', '경북 예천군 용문면 복천길 16-8', - '경북', '19,200', 'https://shopping-phinf.pstatic.net/main_8250054/82500546532.4.jpg'); + price, image, latitude, longitude) +VALUES ('예천주복 만월40', '일반증류주', '농업회사법인(주)착한농부', '40%', '복분자(국내산)증류원액, 복분자(국내산)과즙, 정제수', '350ml', '경북 예천군 용문면 복천길 16-8', '경북', '19,200', + 'https://shopping-phinf.pstatic.net/main_8250054/82500546532.4.jpg', '36.687178399449699', '128.407192918866'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('남산애 레드와인', '과실주', '예인화원', '14%', '포도(캠벨얼리, MBA, 산머루)', '750ml', '경북 경주시 남산순환로10', '경북', '45,000', - 'https://shopping-phinf.pstatic.net/main_8275264/82752647217.jpg'); + 'https://shopping-phinf.pstatic.net/main_8275264/82752647217.jpg', '35.794152799248899', '129.24355899000801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('그랑꼬또 M5610', '과실주', '그린영농조합법인', '10%', '포도(캠벨얼리)', '750ml', '경기도 안산시 단원구 뻐꾹산길 107(대부북동)', '경기', '56,000', - 'https://shopping-phinf.pstatic.net/main_1368584/13685848859.6.jpg'); + 'https://shopping-phinf.pstatic.net/main_1368584/13685848859.6.jpg', '37.257471389325403', '126.582545230378'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시나브로 화이트와인', '과실주', '불휘농장', '11%', '청포도(청수)', '500ml', '충북 영동군 심천면 약목2길26', '충북', '30,000', - 'https://shopping-phinf.pstatic.net/main_8041139/80411398502.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8041139/80411398502.2.jpg', '36.201913743030801', '127.72029368720899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('정고집 나주배 약주 15%', '약주', '남도탁주', '15%', '쌀, 쌀가루(국내산), 배착즙액(나주산), 정제효소제, 종국, 젖산, 효모', '500ml', - '전남 나주시 노안면 노안로379', '전남', '20,000', - 'https://shopping-phinf.pstatic.net/main_3384485/33844856618.20220803174048.jpg'); + price, image, latitude, longitude) +VALUES ('정고집 나주배 약주 15%', '약주', '남도탁주', '15%', '쌀, 쌀가루(국내산), 배착즙액(나주산), 정제효소제, 종국, 젖산, 효모', '500ml', '전남 나주시 노안면 노안로379', '전남', '20,000', + 'https://shopping-phinf.pstatic.net/main_3384485/33844856618.20220803174048.jpg', '35.071896829590898', '126.734271400304'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('오산막걸리', '탁주', '농업회사법인 오산양조(주)', '6%', '쌀(국내산), 국, 효모, 정제수', '500ml', '경기도 오산시 시장길 63', '경기', '3,000', - 'https://shopping-phinf.pstatic.net/main_3315278/33152788619.20220627095004.jpg'); + 'https://shopping-phinf.pstatic.net/main_3315278/33152788619.20220627095004.jpg', '37.154513756977401', '127.06913840140901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('모월 연', '약주', '협동조합 주담', '13%', '쌀(국내산), 누룩, 정제수', '500ml', '강원도 원주시 판부면 판부신촌길 84', '강원', '18,000', - 'https://shopping-phinf.pstatic.net/main_8459419/84594193071.7.jpg'); + 'https://shopping-phinf.pstatic.net/main_8459419/84594193071.7.jpg', '37.299414999973003', '127.97345115422701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('기다림 맑은술', '약주', '농업회사법인(주)제이케이크래프트', '15%', '멥쌀(국내산), 찹쌀(국내산), 곡자(밀누룩 국내산), 정제수', '500ml', - '부산광역시 동래구 사직북로48번길 34', '부산', '25,000', - 'https://shopping-phinf.pstatic.net/main_2885829/28858293590.20210915155516.jpg'); + price, image, latitude, longitude) +VALUES ('기다림 맑은술', '약주', '농업회사법인(주)제이케이크래프트', '15%', '멥쌀(국내산), 찹쌀(국내산), 곡자(밀누룩 국내산), 정제수', '500ml', '부산광역시 동래구 사직북로48번길 34', '부산', '25,000', + 'https://shopping-phinf.pstatic.net/main_2885829/28858293590.20210915155516.jpg', '35.200541465722701', '129.06043945188'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('샤토미소 랑', '과실주', '도란원', '12%', '청포도', '375ml', '충북 영동군 매곡면 유전장척길 143', '충북', '20,000', - 'https://shopping-phinf.pstatic.net/main_4009987/40099873167.jpg'); + 'https://shopping-phinf.pstatic.net/main_4009987/40099873167.jpg', '36.1920939357517', '127.936725157583'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('선운산 복분자주 프리미엄', '과실주', '(주)선운산복분자주 흥진', '19%', '복분자(고창산), 과당, 구연산, 아스파탐, 무수아황산', '700ml', '전북 고창군 부안면 복분자로535', - '전북', '40,000', 'https://shopping-phinf.pstatic.net/main_2411433/24114333549.20200910204427.jpg'); + price, image, latitude, longitude) +VALUES ('선운산 복분자주 프리미엄', '과실주', '(주)선운산복분자주 흥진', '19%', '복분자(고창산), 과당, 구연산, 아스파탐, 무수아황산', '700ml', '전북 고창군 부안면 복분자로535', '전북', '40,000', + 'https://shopping-phinf.pstatic.net/main_2411433/24114333549.20200910204427.jpg', '35.510942199674602', '126.64644550584801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('편백숲 산소막걸리 순수령', '탁주', '농업회사법인 (주)청산녹수', '5.8%', '멥쌀, 찹쌀, 누룩', '750ml', '전남 장성군 장성읍 남양촌길(백계리) 19', '전남', - '4,000', 'https://shopping-phinf.pstatic.net/main_8563648/85636485798.jpg'); + price, image, latitude, longitude) +VALUES ('편백숲 산소막걸리 순수령', '탁주', '농업회사법인 (주)청산녹수', '5.8%', '멥쌀, 찹쌀, 누룩', '750ml', '전남 장성군 장성읍 남양촌길(백계리) 19', '전남', '4,000', + 'https://shopping-phinf.pstatic.net/main_8563648/85636485798.jpg', '35.345218252623603', '126.812850520064'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('청송 얼음골 동동주', '탁주', '청송양조장', '6%', '쌀(국내산), 밀가루, 누룩, 입국, 효모, 아스파탐, 청송사과액즙, 정제수', '1,200ml', - '경북 청송군 부남면 대전로 121-1', '경북', '1,800', 'https://shopping-phinf.pstatic.net/main_8235835/82358356731.109.jpg'); + price, image, latitude, longitude) +VALUES ('청송 얼음골 동동주', '탁주', '청송양조장', '6%', '쌀(국내산), 밀가루, 누룩, 입국, 효모, 아스파탐, 청송사과액즙, 정제수', '1,200ml', '경북 청송군 부남면 대전로 121-1', '경북', '1,800', + 'https://shopping-phinf.pstatic.net/main_8235835/82358356731.109.jpg', '36.344811011777999', '129.06331916225901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('샤토미소 영동', '일반증류주', '도란원', '40%', '포도', '200ml', '충북 영동군 매곡면 유전장척길 143', '충북', '30,000', - 'https://shopping-phinf.pstatic.net/main_8240460/82404600913.4.jpg'); + 'https://shopping-phinf.pstatic.net/main_8240460/82404600913.4.jpg', '36.1920939357517', '127.936725157583'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('맑은내일 우포', '살균 약주', '농업회사법인 우포의아침(주)', '12%', '쌀(국내산), 옥수수전분, 효모, 누룩, 양파, 정제수', '325ml / 500ml', - '(1공장) 경남 창녕군 대지면 대지농공단지길 40, (2공장) 경남 창원시 의창군 북면 천주로 1173번길29', '(1', '325ml ₩5,000, 500ml ₩7,000', - 'https://shopping-phinf.pstatic.net/main_8077635/80776356327.jpg'); + price, image, latitude, longitude) +VALUES ('맑은내일 우포', '살균 약주', '농업회사법인 우포의아침(주)', '12%', '쌀(국내산), 옥수수전분, 효모, 누룩, 양파, 정제수', '325ml / 500ml', '경남 창원시 의창군 북면 천주로 1173번길29', '(1', '325ml ₩5,000, 500ml ₩7,000', + 'https://shopping-phinf.pstatic.net/main_8077635/80776356327.jpg', '35.537988437001097', '128.46041806824701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('석탄주 탁주', '탁주', '케이소주 (전주가양주연구소)', '15%', '국내산 찹쌀, 누룩, 정제수', '500ml', '전북 전주시 완산구 중산중앙로27. 3층', '전북', '6,000', - 'https://shopping-phinf.pstatic.net/main_8622122/86221222681.jpg'); + 'https://shopping-phinf.pstatic.net/main_8622122/86221222681.jpg', '35.816654689827899', '127.12120420246499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('마주 소화곡주', '일반증류주', '옥순가 소곡주 마주', '41%', '찹쌀(국내산), 백미(국내산), 모싯잎, 우리밀 누룩, 정제수, 홍고추', '500ml', - '충청남도 서천군 서초면 시초동로 88-1', '충남', '25,000', 'https://shopping-phinf.pstatic.net/main_8272250/82722506568.jpg'); + price, image, latitude, longitude) +VALUES ('마주 소화곡주', '일반증류주', '옥순가 소곡주 마주', '41%', '찹쌀(국내산), 백미(국내산), 모싯잎, 우리밀 누룩, 정제수, 홍고추', '500ml', '충남 서천군 서천읍 서림로 19', '충남', '25,000', + 'https://shopping-phinf.pstatic.net/main_8272250/82722506568.jpg', '36.078030463952302', '126.70289727667399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('두리향', '증류식소주', '케이소주 (전주가양주연구소)', '43%', '국내산 찹쌀, 누룩, 정제수', '500ml', '전북 전주시 완산구 중산중앙로27. 3층', '전북', '36,000', - 'https://shopping-phinf.pstatic.net/main_8288617/82886172536.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8288617/82886172536.1.jpg', '35.816654689827899', '127.12120420246499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('감자술 13%', '약주', '오대서주양조', '13%', '백미(국내산), 감자(국내산), 누룩, 효모, 정제수', '700ml', '강원도 평창군 진부면 영정게길57-1', '강원', - '14,000', 'https://shopping-phinf.pstatic.net/main_4083831/40838317618.20230629152221.jpg'); + price, image, latitude, longitude) +VALUES ('감자술 13%', '약주', '오대서주양조', '13%', '백미(국내산), 감자(국내산), 누룩, 효모, 정제수', '700ml', '강원도 평창군 진부면 영정게길57-1', '강원', '14,000', + 'https://shopping-phinf.pstatic.net/main_4083831/40838317618.20230629152221.jpg', '37.643200804386296', '128.56646470943701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('독산 53', '증류식소주', '농업회사법인 오산양조(주)', '53%', '쌀(국내산), 국, 효모, 정제수', '250ml', '경기도 오산시 시장길 63', '경기', '25,000', - 'https://shopping-phinf.pstatic.net/main_8223011/82230113297.6.jpg'); + 'https://shopping-phinf.pstatic.net/main_8223011/82230113297.6.jpg', '37.154513756977401', '127.06913840140901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('별바랑', '약주', '농업회사법인 (주)금계당', '17.5%', '찹쌀(국내산), 맵쌀(국내산), 누룩(1%), 정제수', '375ml', '경북 안동시 일직면 돌고개길 9, 1층', '경북', - '27,000', 'https://shopping-phinf.pstatic.net/main_8219686/82196863758.jpg'); + price, image, latitude, longitude) +VALUES ('별바랑', '약주', '농업회사법인 (주)금계당', '17.5%', '찹쌀(국내산), 맵쌀(국내산), 누룩(1%), 정제수', '375ml', '경북 안동시 일직면 돌고개길 9, 1층', '경북', '27,000', + 'https://shopping-phinf.pstatic.net/main_8219686/82196863758.jpg', '36.476384770141898', '128.65950503285299'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('한시울', '증류식소주', '농업회사법인 명세주가(주)', '40%', '국내산 쌀, 누룩, 효모, 구연산, 정제수', '500ml', '충북 청주시 상당구 가덕면 한계길 32-5', '충북', - '18,000', 'https://shopping-phinf.pstatic.net/main_8117689/81176894601.1.jpg'); + price, image, latitude, longitude) +VALUES ('한시울', '증류식소주', '농업회사법인 명세주가(주)', '40%', '국내산 쌀, 누룩, 효모, 구연산, 정제수', '500ml', '충북 청주시 상당구 가덕면 한계길 32-5', '충북', '18,000', + 'https://shopping-phinf.pstatic.net/main_8117689/81176894601.1.jpg', '36.596996821294397', '127.567644225908'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('행운주', '청주', '성포양조장', '12%', '백미(국내산), 밀누룩(국내산), 정제수, 종국, 효모, 아스파탐', '750ml', '경남 거제시 사등면 지석3길3', '경남', - '300ml ₩3,500, 500ml ₩5,000, 750ml ₩9,000', 'https://shopping-phinf.pstatic.net/main_8219007/82190078617.jpg'); + price, image, latitude, longitude) +VALUES ('행운주', '청주', '성포양조장', '12%', '백미(국내산), 밀누룩(국내산), 정제수, 종국, 효모, 아스파탐', '750ml', '경남 거제시 사등면 지석3길3', '경남', '300ml ₩3,500, 500ml ₩5,000, 750ml ₩9,000', + 'https://shopping-phinf.pstatic.net/main_8219007/82190078617.jpg', '34.9079763686006', '128.51637920273899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('라이스퐁당 13', '약주', '농업회사법인 (주)벗드림', '13%', '찹쌀(국내산), 누룩, 정제수(음양곽, 감초)', '500ml', '부산광역시 북구 덕천로247번길 3, 2층', '부산', - '15,000', 'https://shopping-phinf.pstatic.net/main_3587029/35870290606.1.jpg'); + price, image, latitude, longitude) +VALUES ('라이스퐁당 13', '약주', '농업회사법인 (주)벗드림', '13%', '찹쌀(국내산), 누룩, 정제수(음양곽, 감초)', '500ml', '부산광역시 북구 덕천로247번길 3, 2층', '부산', '15,000', + 'https://shopping-phinf.pstatic.net/main_3587029/35870290606.1.jpg', '35.2109717267058', '129.031358852523'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('방문주 약주', '약주', '케이소주 (전주가양주연구소)', '15%', '국내산 찹쌀, 누룩, 정제수', '500ml', '전북 전주시 완산구 중산중앙로27. 3층', '전북', '7,000', - 'https://shopping-phinf.pstatic.net/main_8287085/82870854748.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8287085/82870854748.2.jpg', '35.816654689827899', '127.12120420246499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('예천주 사월365', '일반증류주', '농업회사법인(주)착한농부', '36.5%', '오미자(국내산)증류원액, 건오미자(국내산)추출액, 정제수', '375ml', - '경북 예천군 용문면 복천길 16-8', '경북', '29,000', 'https://shopping-phinf.pstatic.net/main_4125763/41257639825.jpg'); + price, image, latitude, longitude) +VALUES ('예천주 사월365', '일반증류주', '농업회사법인(주)착한농부', '36.5%', '오미자(국내산)증류원액, 건오미자(국내산)추출액, 정제수', '375ml', '경북 예천군 용문면 복천길 16-8', '경북', '29,000', + 'https://shopping-phinf.pstatic.net/main_4125763/41257639825.jpg', '36.687178399449699', '128.407192918866'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('호땅', '기타주류', '배혜정도가', '6%', '쌀(국내산), 국, 효모, 정제수, 땅콩(국내산)', '750ml', '경기도 화성시 정남면 문학리 674-23', '경기', '2,700', - 'https://shopping-phinf.pstatic.net/main_3280454/32804548621.20220608121349.jpg'); + 'https://shopping-phinf.pstatic.net/main_3280454/32804548621.20220608121349.jpg', '37.149336281531802', '126.960871275363'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('홍삼명주', '기타주류', '자연과 인삼', '14%', '홍삼추출액, 효모, 정백당, 정제수', '500ml', '충청북도 괴산군 청천면 도경로 640', '충북', '16,000', - 'https://shopping-phinf.pstatic.net/main_8243088/82430884404.5.jpg'); + 'https://shopping-phinf.pstatic.net/main_8243088/82430884404.5.jpg', '36.720491675817897', '127.800397290202'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('이동 생 쌀 막걸리', '탁주', '이동주조', '6%', '정제수, 백미, 팽화미, 입국, 아스파탐 등', '750ml', '경기도 포천시 이동면 화동로 2466', '경기', '1,300', - 'https://shopping-phinf.pstatic.net/main_1375984/13759846049.20180803125315.jpg'); + 'https://shopping-phinf.pstatic.net/main_1375984/13759846049.20180803125315.jpg', '38.062019032200702', '127.386275529044'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('감홍로 청자', '일반증류주', '농업회사법인(주)감홍로', '40%', '쌀(70%), 조(30%), 8가지 약재(용안육, 계피, 진피, 방품, 정향, 생각, 감초, 지초)', '700ml', - '경기도 파주시 파주읍 부곡리 34-7', '경기', '90,000', 'https://shopping-phinf.pstatic.net/main_8335668/83356685430.jpg'); + price, image, latitude, longitude) +VALUES ('감홍로 청자', '일반증류주', '농업회사법인(주)감홍로', '40%', '쌀(70%), 조(30%), 8가지 약재(용안육, 계피, 진피, 방품, 정향, 생각, 감초, 지초)', '700ml', '경기도 파주시 파주읍 부곡리 34-7', '경기', '90,000', + 'https://shopping-phinf.pstatic.net/main_8335668/83356685430.jpg', '37.816061501636902', '126.83366162562901'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('찰막걸리', '생막걸리', '(주)1932 포천일동막걸리', '5.5%', '정제수, 쌀, 밀가루, 찹쌀, 입국, 효모 정제효소제, 아스파탐', '750ml', - '경기도 포천시 일동면 운악청계로 1597', '경기', '30000', - 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg'); + price, image, latitude, longitude) +VALUES ('찰막걸리', '생막걸리', '(주)1932 포천일동막걸리', '5.5%', '정제수, 쌀, 밀가루, 찹쌀, 입국, 효모 정제효소제, 아스파탐', '750ml', '경기도 포천시 일동면 운악청계로 1597', '경기', '30000', + 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg', '37.945460025718802', '127.333298092871'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('복분자 아락', '일반증류주', '농업회사법인 배상면주가 고창LB', '40%', '복분자증류원액(국내산), 정제수', '500ml', '전북 고창군 아산면 병암길 48', '전북', - '40,000', 'https://shopping-phinf.pstatic.net/main_4039175/40391758418.jpg'); + price, image, latitude, longitude) +VALUES ('복분자 아락', '일반증류주', '농업회사법인 배상면주가 고창LB', '40%', '복분자증류원액(국내산), 정제수', '500ml', '전북 고창군 아산면 병암길 48', '전북', '40,000', + 'https://shopping-phinf.pstatic.net/main_4039175/40391758418.jpg', '35.477708368498803', '126.62313871901399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('지리산 허브잎 술', '살균탁주', '지리산그린영농조합 운봉주조', '6%', '쌀(국내산), 종국, 정제수, 누룩, 효모, 국내산허브', '750ml', '전라북도 남원시 운봉읍 황산로 1018', - '전북', '1,500', 'https://shopping-phinf.pstatic.net/main_8305884/83058845889.11.jpg'); + price, image, latitude, longitude) +VALUES ('지리산 허브잎 술', '살균탁주', '지리산그린영농조합 운봉주조', '6%', '쌀(국내산), 종국, 정제수, 누룩, 효모, 국내산허브', '750ml', '전라북도 남원시 운봉읍 황산로 1018', '전북', '1,500', + 'https://shopping-phinf.pstatic.net/main_8305884/83058845889.11.jpg', '35.437291911597697', '127.524013307426'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('계룡백일주 16도', '약주', '계룡백일주', '16%', '찹쌀, 백미, 누룩, 재리종국화꽃, 오미자, 진달래, 재래종 솔잎', '700ml*2개', '충남 공주시 봉정길 32', '충남', - '37,000', 'https://shopping-phinf.pstatic.net/main_8099303/80993036884.jpg'); + price, image, latitude, longitude) +VALUES ('계룡백일주 16도', '약주', '계룡백일주', '16%', '찹쌀, 백미, 누룩, 재리종국화꽃, 오미자, 진달래, 재래종 솔잎', '700ml*2개', '충남 공주시 봉정길 32', '충남', '37,000', + 'https://shopping-phinf.pstatic.net/main_8099303/80993036884.jpg', '36.417515675848698', '127.09112543844201'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('문희 햇찹쌀 수제 전통주', '전통 수제 탁주', '문경주조', '13%', '유기농찹쌀 (국산), 멥쌀 (국산), 전통누룩 (우리 밀), 정제수', '500ml', - '경상북도 문경시 동로면 노은리 192', '경북', '15,000', 'https://shopping-phinf.pstatic.net/main_4100714/41007143702.jpg'); + price, image, latitude, longitude) +VALUES ('문희 햇찹쌀 수제 전통주', '전통 수제 탁주', '문경주조', '13%', '유기농찹쌀 (국산), 멥쌀 (국산), 전통누룩 (우리 밀), 정제수', '500ml', '경북 문경시 동로면 노은1길 49-15', '경북', '15,000', + 'https://shopping-phinf.pstatic.net/main_4100714/41007143702.jpg', '36.772205009239599', '128.314028995874'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('세종 알밤주', '기타주류', '조은술 세종', '6%', '정제수, 백미, 소맥분, 알밤(국내산), 전분당, 효모, 젖산 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', - '충북', '1,500', 'https://shopping-phinf.pstatic.net/main_8435307/84353075214.2.jpg'); + price, image, latitude, longitude) +VALUES ('세종 알밤주', '기타주류', '조은술 세종', '6%', '정제수, 백미, 소맥분, 알밤(국내산), 전분당, 효모, 젖산 등', '750ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '1,500', + 'https://shopping-phinf.pstatic.net/main_8435307/84353075214.2.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('입장탁주', '생탁주', '농업회사법인 입장주조㈜', '6%', '쌀, 정제수, 고과당, 효모 등', '750ml', '충남 천안시 서북구 입장면 성진로 808', '충남', '1,200', - 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg'); + 'https://shopping-phinf.pstatic.net/main_3277380/32773809619.20220606142045.jpg', '36.914569294887599', '127.2202815805'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('두레앙 와인', '과실주', '농업회사법인(주)두레양조', '12%', '거봉포도원액', '750ml', '충남 천안시 서북구 입장면 율목길17-6', '충남', '15,000', - 'https://shopping-phinf.pstatic.net/main_3272973/32729735625.20220603164939.jpg'); + 'https://shopping-phinf.pstatic.net/main_3272973/32729735625.20220603164939.jpg', '36.913552838896202', '127.20273128950799'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('오디랑', '과실주', '국순당 고창명주', '13%', '오디(국산) 18.2%, 정제수, 과당, 주정, 구연산, 효모', '330ml', '전북 고창군 심원면 선운대로 2197', '전북', - '4,000', 'https://shopping-phinf.pstatic.net/main_2406819/24068190523.20200907130214.jpg'); + price, image, latitude, longitude) +VALUES ('오디랑', '과실주', '국순당 고창명주', '13%', '오디(국산) 18.2%, 정제수, 과당, 주정, 구연산, 효모', '330ml', '전북 고창군 심원면 선운대로 2197', '전북', '4,000', + 'https://shopping-phinf.pstatic.net/main_2406819/24068190523.20200907130214.jpg', '35.540070746365302', '126.572620307829'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('선운산의 아침 복분자막걸리', '살균탁주', '(농)국순당고창명주(주)', '6%', '복분자, 쌀, 효모, 국, 과당, 구연산, 젖산, 정제수', '750ml', - '전북 고창군 심원면 선운대로 2197', '전북', '28,000(500ml*12병)', - 'https://shopping-phinf.pstatic.net/main_8238752/82387527317.jpg'); + price, image, latitude, longitude) +VALUES ('선운산의 아침 복분자막걸리', '살균탁주', '(농)국순당고창명주(주)', '6%', '복분자, 쌀, 효모, 국, 과당, 구연산, 젖산, 정제수', '750ml', '전북 고창군 심원면 선운대로 2197', '전북', '28,000(500ml*12병)', + 'https://shopping-phinf.pstatic.net/main_8238752/82387527317.jpg', '35.540070746365302', '126.572620307829'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('홍삼명주', '기타주류', '자연과 인삼', '14%', '홍삼추출액, 효모, 정백당, 정제수', '375ml', '충청북도 괴산군 청천면 도경로 640', '충북', '12,000', - 'https://shopping-phinf.pstatic.net/main_1302213/13022130052.13.jpg'); + 'https://shopping-phinf.pstatic.net/main_1302213/13022130052.13.jpg', '36.720491675817897', '127.800397290202'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('동강더덕주', '리큐르', '영월더덕영농조합법인', '20%', '더덕, 대추구기자, 감초, 원지', '360ml', '강원도 영월군 주천면 솔치로 633', '강원', '3,500', - 'https://shopping-phinf.pstatic.net/main_1308336/13083362424.jpg'); + 'https://shopping-phinf.pstatic.net/main_1308336/13083362424.jpg', '37.2707344392431', '128.249888402468'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('세종 오가닉', '살균약주', '조은술 세종', '13%', '정제수, 유기농 백미, 국, 효모, 정제효소, 구연산', '375ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', - '9,000', 'https://shopping-phinf.pstatic.net/main_4138736/41387368690.jpg'); + price, image, latitude, longitude) +VALUES ('세종 오가닉', '살균약주', '조은술 세종', '13%', '정제수, 유기농 백미, 국, 효모, 정제효소, 구연산', '375ml', '충북 청주시 청원구 사천로 18번길 5-2', '충북', '9,000', + 'https://shopping-phinf.pstatic.net/main_4138736/41387368690.jpg', '36.677043689540803', '127.48008281849501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('청산녹수 꿀막걸리', '탁주', '농업회사법인(주)청산녹수', '8%', '쌀(국내산), 벌꿀(국내산), 사과농축액, 효모, 정제효소', '750ml', - '전남 장성군 장성읍 남양촌길(백계리) 19', '전남', '18,000(750ml*12병 세트)', - 'https://shopping-phinf.pstatic.net/main_2958931/29589312407.jpg'); + price, image, latitude, longitude) +VALUES ('청산녹수 꿀막걸리', '탁주', '농업회사법인(주)청산녹수', '8%', '쌀(국내산), 벌꿀(국내산), 사과농축액, 효모, 정제효소', '750ml', '전남 장성군 장성읍 남양촌길(백계리) 19', '전남', '18,000(750ml*12병 세트)', + 'https://shopping-phinf.pstatic.net/main_2958931/29589312407.jpg', '35.345218252623603', '126.812850520064'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('자두와인 화이트', '과실주', '자두사랑', '12%', '후무사', '750ml', '경상북도 김천시 대학로 214', '경북', '22,000', - 'https://shopping-phinf.pstatic.net/main_3284607/32846079621.20220609143350.jpg'); + 'https://shopping-phinf.pstatic.net/main_3284607/32846079621.20220609143350.jpg', '36.139944806994102', '128.08171498016301'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('다랭이팜 유자 막걸리', '탁주', '다랭이팜', '6%', '남해산 유기농 유자원액, 누룩, 효모 등', '750ml', '경남 남해군 남면 홍현리 897번지', '경남', '4,000', - 'https://shopping-phinf.pstatic.net/main_1258843/12588431101.jpg'); + 'https://shopping-phinf.pstatic.net/main_1258843/12588431101.jpg', '34.7274128182437', '127.89413833285499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('은자골 곶감 생 탁배기', '탁주', '은척양조장', '6%', '백미, 소맥분, 정제수, 곶감분말, 전분당, 국, 누룩, 효소, 아스파탐 등', '750ml', - '경상북도 상주시 은척면 봉중2길 16-9', '경북', '1,500', 'https://shopping-phinf.pstatic.net/main_3956911/39569118004.jpg'); + price, image, latitude, longitude) +VALUES ('은자골 곶감 생 탁배기', '탁주', '은척양조장', '6%', '백미, 소맥분, 정제수, 곶감분말, 전분당, 국, 누룩, 효소, 아스파탐 등', '750ml', '경상북도 상주시 은척면 봉중2길 16-9', '경북', '1,500', + 'https://shopping-phinf.pstatic.net/main_3956911/39569118004.jpg', '36.531378468577302', '128.06976159011899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('진심 홍삼주 19도', '일반증류주', '태평주가', '19%', '쌀, 정제주정, 인삼침출액, 홍삼농축액, 고과당 등', '375ml', '전북 진안군 진안읍 거북바위로 3길 15-35', - '전북', '3,000', 'https://shopping-phinf.pstatic.net/main_8225009/82250092443.jpg'); + price, image, latitude, longitude) +VALUES ('진심 홍삼주 19도', '일반증류주', '태평주가', '19%', '쌀, 정제주정, 인삼침출액, 홍삼농축액, 고과당 등', '375ml', '전북 진안군 진안읍 거북바위로 3길 15-35', '전북', '3,000', + 'https://shopping-phinf.pstatic.net/main_8225009/82250092443.jpg', '35.7728321025496', '127.380470853199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('추사블루', '과실주', '예산사과와인(주)', '12%', '블루베리(국내산)', '375ml', '충남 예산군 고덕면 대몽로 107-25', '충남', '20,000', - 'https://shopping-phinf.pstatic.net/main_8351539/83515399645.jpg'); + 'https://shopping-phinf.pstatic.net/main_8351539/83515399645.jpg', '36.761850437703899', '126.698077768781'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('면천두견주', '약주', '(주)면천두견주', '18%', '국내산 찹쌀, 누룩, 진달래꽃', '360ml', '충남 당진시 면천로 성하로 250', '충남', '32,000(360ml*4병)', - 'https://shopping-phinf.pstatic.net/main_8275849/82758495892.jpg'); + price, image, latitude, longitude) +VALUES ('면천두견주', '약주', '(주)면천두견주', '18%', '국내산 찹쌀, 누룩, 진달래꽃', '360ml', '충남 당진시 면천면 성하로 250', '충남', '32,000(360ml*4병)', + 'https://shopping-phinf.pstatic.net/main_8275849/82758495892.jpg', '36.8128310711189', '126.66286381048'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('고도리 화이트와인 드라이', '과실주', '고도리 와이너리', '10.5%', '거봉포도(경북 영천)', '750ml', '경북 영천시 고경면 고도리 494', '경북', '22,000', - 'https://shopping-phinf.pstatic.net/main_4078524/40785246974.jpg'); + 'https://shopping-phinf.pstatic.net/main_4078524/40785246974.jpg', '35.983168660140599', '128.998618766791'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('소양강 생 막걸리', '탁주', '소양강도가 (구. 천정양조장)', '6%', '백미, 소맥분, 정제수, 팽화미, 아스파탐, 물엿, 정제수', '750ml / 1,700ml', - '강원도 춘천시 신북읍 율문길 65-5', '강원', '1,200 / ₩1,800', - 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg'); + price, image, latitude, longitude) +VALUES ('소양강 생 막걸리', '탁주', '소양강도가 (구. 천정양조장)', '6%', '백미, 소맥분, 정제수, 팽화미, 아스파탐, 물엿, 정제수', '750ml / 1,700ml', '강원도 춘천시 신북읍 율문길 65-5', '강원', '1,200 / ₩1,800', + 'https://shopping-phinf.pstatic.net/main_2408042/24080421524.20230711110841.jpg', '37.9260755148253', '127.745061295344'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('명인 홍삼주', '약주', '농업회사법인(주)금산인삼주', '12.5%', '쌀, 홍삼, 누룩, 정제수 등', '375ml', '충남 금산군 금성면 파초길 23', '충남', - '12,000(375ml*3병)', 'https://shopping-phinf.pstatic.net/main_8203977/82039778836.jpg'); + price, image, latitude, longitude) +VALUES ('명인 홍삼주', '약주', '농업회사법인(주)금산인삼주', '12.5%', '쌀, 홍삼, 누룩, 정제수 등', '375ml', '충남 금산군 금성면 파초길 23', '충남', '12,000(375ml*3병)', + 'https://shopping-phinf.pstatic.net/main_8203977/82039778836.jpg', '36.127661377353597', '127.466418152423'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('술아 막걸리', '탁주', '농업회사법인(주)술아원', '8%', '국내산 찹쌀, 누룩, 정제수', '450ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', - '21,000(450ml*3병)', 'https://shopping-phinf.pstatic.net/main_8271018/82710186435.jpg'); + price, image, latitude, longitude) +VALUES ('술아 막걸리', '탁주', '농업회사법인(주)술아원', '8%', '국내산 찹쌀, 누룩, 정제수', '450ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', '21,000(450ml*3병)', + 'https://shopping-phinf.pstatic.net/main_8271018/82710186435.jpg', '37.383421504349897', '127.599983995584'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('고도리 화이트와인 스위트', '과실주', '고도리 와이너리', '10.5%', '거봉포도(경북 영천)', '750ml', '경북 영천시 고경면 고도리 494', '경북', '22,000', - 'https://shopping-phinf.pstatic.net/main_1302218/13022180224.5.jpg'); + 'https://shopping-phinf.pstatic.net/main_1302218/13022180224.5.jpg', '35.983168660140599', '128.998618766791'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('수삼단본 43도', '일반증류주', '농업회사법인(주)금산인삼주', '43%', '쌀, 인삼, 누룩, 정제수 등', '720ml', '충남 금산군 금성면 파초길 23', '충남', '42,000', - 'https://shopping-phinf.pstatic.net/main_4006423/40064231954.jpg'); + 'https://shopping-phinf.pstatic.net/main_4006423/40064231954.jpg', '36.127661377353597', '127.466418152423'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('소백산 생 만찬주', '탁주', '대강양조장', '6%', '정제수, 쌀, 소맥분, 입국, 효모, 아스파탐 등', '750ml', '충북 단양군 대강면 장림리 113-7', '충북', '1,200', - 'https://shopping-phinf.pstatic.net/main_3747278/37472782063.jpg'); + 'https://shopping-phinf.pstatic.net/main_3747278/37472782063.jpg', '36.922265636051897', '128.353720606488'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('향수 우리밀 막걸리', '탁주', '이원양조장', '9%', '우리밀, 누룩, 정제수, 무감미료', '700ml', '충북 옥천군 이원면 묘목로 113', '충북', '7,900', - 'https://shopping-phinf.pstatic.net/main_8327612/83276121248.jpg'); + 'https://shopping-phinf.pstatic.net/main_8327612/83276121248.jpg', '36.246974796237197', '127.62062231429'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('예주', '과실주', '용두산조은술', '15%', '복분자, 주정, 효모, 정제수', '750ml', '충북 제천시 송학면 송학주천로647', '충북', '29,000', - 'https://shopping-phinf.pstatic.net/main_1204657/12046576923.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_1204657/12046576923.2.jpg', '37.215122174466899', '128.23690254954599'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('미생 막걸리', '탁주', '김포금쌀탁주영농조합법인', '6%', '국내산 쌀, 누룩, 효모, 정제효소, 정제수', '750ml', '경기도 김포시 하성면 하성로 622', '경기', '1,100', - 'https://shopping-phinf.pstatic.net/main_8255086/82550863507.jpg'); + 'https://shopping-phinf.pstatic.net/main_8255086/82550863507.jpg', '37.728587106278198', '126.629076579878'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('김포별주', '살균약주', '김포양조', '13%', '쌀, 옥수수 전분, 국, 효모, 젖산, 효소제, 정제수', '500ml', '경기도 김포시 월곶면 김포대로 2763', '경기', - '4,000', 'https://shopping-phinf.pstatic.net/main_4084076/40840762620.20230627142405.jpg'); + price, image, latitude, longitude) +VALUES ('김포별주', '살균약주', '김포양조', '13%', '쌀, 옥수수 전분, 국, 효모, 젖산, 효소제, 정제수', '500ml', '경기도 김포시 월곶면 김포대로 2763', '경기', '4,000', + 'https://shopping-phinf.pstatic.net/main_4084076/40840762620.20230627142405.jpg', '37.711509317937598', '126.546803490044'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('한비 쌀소주', '증류식소주', '제천한약영농조합법인', '40%', '국내산 쌀, 누룩, 정제수', '375ml / 750ml', '충북 제천시 봉양읍 북부로 5길 16-10', '충북', - '30,000(375ml), ₩40,000(750ml)', 'https://shopping-phinf.pstatic.net/main_1964548/19645484433.1.jpg'); + price, image, latitude, longitude) +VALUES ('한비 쌀소주', '증류식소주', '제천한약영농조합법인', '40%', '국내산 쌀, 누룩, 정제수', '375ml / 750ml', '충북 제천시 봉양읍 북부로 5길 16-10', '충북', '30,000(375ml), ₩40,000(750ml)', + 'https://shopping-phinf.pstatic.net/main_1964548/19645484433.1.jpg', '37.133529256317203', '128.08870720361699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('양촌 생 동동주', '탁주', '양촌양조', '10%', '정제수, 백미, 효소제, 효모 등', '750ml', '충남 논산시 양촌면 매죽헌로 1665번길 14-7', '충남', - '36,000원 1박스 15개입', 'https://shopping-phinf.pstatic.net/main_3599373/35993735067.jpg'); + price, image, latitude, longitude) +VALUES ('양촌 생 동동주', '탁주', '양촌양조', '10%', '정제수, 백미, 효소제, 효모 등', '750ml', '충남 논산시 양촌면 매죽헌로 1665번길 14-7', '충남', '36,000원 1박스 15개입', + 'https://shopping-phinf.pstatic.net/main_3599373/35993735067.jpg', '36.1380648488284', '127.234326485841'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('고도리 레드와인 스위트', '과실주', '고도리 와이너리', '12%', 'MBA 머루포도(경북 영천)', '750ml', '경북 영천시 고경면 고도리 494', '경북', '22,000', - 'https://shopping-phinf.pstatic.net/main_2781946/27819461591.jpg'); + 'https://shopping-phinf.pstatic.net/main_2781946/27819461591.jpg', '35.983168660140599', '128.998618766791'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('쿨샷7.5', '과실주', '농업회사법인 고창선운산(유)', '7.5%', '복분자과실, 주정, 효모, 구연산, 정제수', '300ml', '전북 고창군 심원면 심원로 270-73', '전북', - '60,000(300ml*20병)', 'https://shopping-phinf.pstatic.net/main_3992691/39926910968.jpg'); + price, image, latitude, longitude) +VALUES ('쿨샷7.5', '과실주', '농업회사법인 고창선운산(유)', '7.5%', '복분자과실, 주정, 효모, 구연산, 정제수', '300ml', '전북 고창군 심원면 심원로 270-73', '전북', '60,000(300ml*20병)', + 'https://shopping-phinf.pstatic.net/main_3992691/39926910968.jpg', '35.526108261764499', '126.561553885392'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('술아 연화주', '약주', '농업회사법인(주)술아원', '15%', '국내산 찹쌀, 누룩, 건조연화꽃, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', - '36,000(375ml*2병)', 'https://shopping-phinf.pstatic.net/main_8414656/84146567679.1.jpg'); + price, image, latitude, longitude) +VALUES ('술아 연화주', '약주', '농업회사법인(주)술아원', '15%', '국내산 찹쌀, 누룩, 건조연화꽃, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', '36,000(375ml*2병)', + 'https://shopping-phinf.pstatic.net/main_8414656/84146567679.1.jpg', '37.383421504349897', '127.599983995584'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('술그리다 생탁주', '탁주', '농업회사법인(주)좋은술', '10%', '국내산 쌀, 누룩', '500ml', '경기도 평택시 오성면 숙성뜰길 108', '경기', '9,000', - 'https://shopping-phinf.pstatic.net/main_8271018/82710186435.jpg'); + 'https://shopping-phinf.pstatic.net/main_8271018/82710186435.jpg', '37.000493267959698', '126.98939334495201'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('김포약주 유리병', '살균약주', '김포양조', '11%', '옥수수 전분, 밀, 국, 효모, 젖산, 효소제, 정제수', '750ml', '경기도 김포시 월곶면 김포대로 2763', '경기', - '10,000', 'https://shopping-phinf.pstatic.net/main_8230981/82309814944.jpg'); + price, image, latitude, longitude) +VALUES ('김포약주 유리병', '살균약주', '김포양조', '11%', '옥수수 전분, 밀, 국, 효모, 젖산, 효소제, 정제수', '750ml', '경기도 김포시 월곶면 김포대로 2763', '경기', '10,000', + 'https://shopping-phinf.pstatic.net/main_8230981/82309814944.jpg', '37.711509317937598', '126.546803490044'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('술아 국화주', '약주', '농업회사법인(주)술아원', '15%', '국내산 찹쌀, 누룩, 건조국화꽃, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', - '36,000(375ml*2병)', 'https://shopping-phinf.pstatic.net/main_8344192/83441927882.jpg'); + price, image, latitude, longitude) +VALUES ('술아 국화주', '약주', '농업회사법인(주)술아원', '15%', '국내산 찹쌀, 누룩, 건조국화꽃, 증류주, 정제수', '375ml', '경기도 여주시 대신면 대신1로 120, 나호', '경기', '36,000(375ml*2병)', + 'https://shopping-phinf.pstatic.net/main_8344192/83441927882.jpg', '37.383421504349897', '127.599983995584'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('추사 로제', '과실주', '예산사과와인(주)', '12%', '사과(국내산)', '375ml', '충남 예산군 고덕면 대몽로 107-25', '충남', '20,000', - 'https://shopping-phinf.pstatic.net/main_3257940/32579400620.20220525155552.jpg'); + 'https://shopping-phinf.pstatic.net/main_3257940/32579400620.20220525155552.jpg', '36.761850437703899', '126.698077768781'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('세종대왕어주 탁주', '탁주', '농업회사법인 장희도가(주)', '13%', '쌀(국내산), 누룩, 정제수', '500ml', '충북 청주시 청원구 내수읍 미원초정로 1275', '충북', - '16,900', 'https://shopping-phinf.pstatic.net/main_1215275/12152753510.20170830115123.jpg'); + price, image, latitude, longitude) +VALUES ('세종대왕어주 탁주', '탁주', '농업회사법인 장희도가(주)', '13%', '쌀(국내산), 누룩, 정제수', '500ml', '충북 청주시 청원구 내수읍 미원초정로 1275', '충북', '16,900', + 'https://shopping-phinf.pstatic.net/main_1215275/12152753510.20170830115123.jpg', '36.714252378043', '127.605099656731'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시인의 마을 우리쌀 막걸리', '탁주', '이원양조장', '10%', '쌀(국내산), 누룩, 정제수, 무감미료', '700ml', '충북 옥천군 이원면 묘목로 113', '충북', '7,900', - 'https://shopping-phinf.pstatic.net/main_8312063/83120639229.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8312063/83120639229.2.jpg', '36.246974796237197', '127.62062231429'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('예밀와인 레드 드라이', '과실주', '예밀2리영농조합법인', '13%', '포도(캠벨얼리)', '750ml', '강원도 영월군 김삿갓면 예밀촌길 228-20', '강원', '20,000', - 'https://shopping-phinf.pstatic.net/main_8277017/82770172665.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8277017/82770172665.2.jpg', '37.1429450352326', '128.59223300382399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('설하담', '탁주', '리큐랩주식회사', '8%', '국내산 멥쌀 100%, 개량 누룩, 정제수, 이산화탄소', '950ml / 475ml', '부산광역시 영도구 남항새싹길 186', '부산', - '7,400(950ml), ₩3,900(475ml)', 'https://shopping-phinf.pstatic.net/main_8154529/81545291865.33.jpg'); + price, image, latitude, longitude) +VALUES ('설하담', '탁주', '리큐랩주식회사', '8%', '국내산 멥쌀 100%, 개량 누룩, 정제수, 이산화탄소', '950ml / 475ml', '부산광역시 영도구 남항새싹길 186', '부산', '7,400(950ml), ₩3,900(475ml)', + 'https://shopping-phinf.pstatic.net/main_8154529/81545291865.33.jpg', '35.082174349350197', '129.04243091698601'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('귀감', '일반증류주', '농업회사법인(주)시트러스', '25%', '감귤과즙(제주산), 백설탕, 액상효모, 스테비올배당체, 무수아황산', '350ml', - '제주특별자치도 서귀포시 남원읍 신례천로46', '제주', '25,000', 'https://shopping-phinf.pstatic.net/main_8651846/86518462688.jpg'); + price, image, latitude, longitude) +VALUES ('귀감', '일반증류주', '농업회사법인(주)시트러스', '25%', '감귤과즙(제주산), 백설탕, 액상효모, 스테비올배당체, 무수아황산', '350ml', '제주특별자치도 서귀포시 남원읍 신례천로46', '제주', '25,000', + 'https://shopping-phinf.pstatic.net/main_8651846/86518462688.jpg', '33.286622663977703', '126.62495592789'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('크라테 레드와인 드라이', '과실주', '수도산 와이너리', '11.5%', '산머루', '750ml', '경북 김천시 증산면 금곡리3길 29', '경북', '48,000', - 'https://shopping-phinf.pstatic.net/main_8408236/84082368760.6.jpg'); + 'https://shopping-phinf.pstatic.net/main_8408236/84082368760.6.jpg', '35.875785914943798', '128.04600386593199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('산정호수 동정춘막걸리', '탁주', '(주)농업회사법인 술빚는 전가네', '6%', '국내산 쌀, 누룩, 정제수', '720ml', '경기도 포천시 영북면 산정호수로 322번길 28', '경기', - '20,000', 'https://shopping-phinf.pstatic.net/main_8163398/81633980015.jpg'); + price, image, latitude, longitude) +VALUES ('산정호수 동정춘막걸리', '탁주', '(주)농업회사법인 술빚는 전가네', '6%', '국내산 쌀, 누룩, 정제수', '720ml', '경기도 포천시 영북면 산정호수로 322번길 28', '경기', '20,000', + 'https://shopping-phinf.pstatic.net/main_8163398/81633980015.jpg', '38.0679508645974', '127.30498445885399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('남산애 포트와인', '과실주', '예인화원', '18.5%', '포도(캠벨얼리, MBA, 산머루)', '750ml', '경북 경주시 남산순환로10', '경북', '55,000', - 'https://shopping-phinf.pstatic.net/main_8275264/82752647217.jpg'); + 'https://shopping-phinf.pstatic.net/main_8275264/82752647217.jpg', '35.794152799248899', '129.24355899000801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('해방주 18.8%', '일반증류주', '농업회사법인(주)영덕주조', '18.8%', '쌀(국내산), 해방풍(국내산), 조효소제, 효모, 젖산, 정세효소제, 구연산', '375ml', - '경북 영덕군 강구면 소월1길 16-10', '경북', '12,000(375ml_18.8%)', - 'https://shopping-phinf.pstatic.net/main_8226558/82265581241.jpg'); + price, image, latitude, longitude) +VALUES ('해방주 18.8%', '일반증류주', '농업회사법인(주)영덕주조', '18.8%', '쌀(국내산), 해방풍(국내산), 조효소제, 효모, 젖산, 정세효소제, 구연산', '375ml', '경북 영덕군 강구면 소월1길 16-10', '경북', '12,000(375ml_18.8%)', + 'https://shopping-phinf.pstatic.net/main_8226558/82265581241.jpg', '36.379353762831599', '129.374510560467'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('설련주', '약주', '영농조합법인 석전상온전통주가', '16%', '백련, 찹쌀, 멥쌀, 누룩', '750ml', '경북 칠곡군 왜관읍 동산2길19', '경북', '35,000', - 'https://shopping-phinf.pstatic.net/main_8593438/85934385330.jpg'); + 'https://shopping-phinf.pstatic.net/main_8593438/85934385330.jpg', '35.9969329267036', '128.409161576504'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('감악산 머루주', '과실주', '산머루농원영농조합법인', '12%', '국내산 산머루원액 78.5%, 주정', '360ml', '경기도 파주시 윗배우니길 441-25', '경기', - '360ml*4본 ₩28,000', 'https://shopping-phinf.pstatic.net/main_8363929/83639297630.jpg'); + price, image, latitude, longitude) +VALUES ('감악산 머루주', '과실주', '산머루농원영농조합법인', '12%', '국내산 산머루원액 78.5%, 주정', '360ml', '경기도 파주시 윗배우니길 441-25', '경기', '360ml*4본 ₩28,000', + 'https://shopping-phinf.pstatic.net/main_8363929/83639297630.jpg', '37.960244592630801', '126.95792278122499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('삼선', '탁주', '농업회사법인 두루(주)', '10%', '국내산쌀, 누룩, 정제수', '500ml', '강원도 홍천 내촌면 용포길 31-25', '강원', '15,000', - 'https://shopping-phinf.pstatic.net/main_8422337/84223372069.15.jpg'); + 'https://shopping-phinf.pstatic.net/main_8422337/84223372069.15.jpg', '37.814024413609701', '128.05857840803199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('뉴트로', '탁주', '디오케이브루어리', '8%', '찹쌀(국내산), 멥살(국내산), 누룩, 레몬, 라임, 잉글리쉬블랙퍼스트, 정제수', '600ml', '서울특별시 강북구 삼양로 455, 1층', - '서울', '6,000', 'https://shopping-phinf.pstatic.net/main_8273723/82737237331.26.jpg'); + price, image, latitude, longitude) +VALUES ('뉴트로', '탁주', '디오케이브루어리', '8%', '찹쌀(국내산), 멥살(국내산), 누룩, 레몬, 라임, 잉글리쉬블랙퍼스트, 정제수', '600ml', '서울특별시 강북구 삼양로 455, 1층', '서울', '6,000', + 'https://shopping-phinf.pstatic.net/main_8273723/82737237331.26.jpg', '37.643900176705998', '127.015785423103'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('여강', '증류식소주', '(주)농업회사법인 추연당', '25%', '국내산 쌀, 누룩, 정제수', '375ml', '경기도 여주시 가남읍 금당리길 1-111', '경기', '20,000', - 'https://shopping-phinf.pstatic.net/main_4033563/40335630541.jpg'); + 'https://shopping-phinf.pstatic.net/main_4033563/40335630541.jpg', '37.206353843422399', '127.608692438734'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('크라테 레드와인 스위트', '과실주', '수도산 와이너리', '11.5%', '산머루', '750ml', '경북 김천시 증산면 금곡리3길 29', '경북', '48,000', - 'https://shopping-phinf.pstatic.net/main_8392835/83928351117.2.jpg'); + 'https://shopping-phinf.pstatic.net/main_8392835/83928351117.2.jpg', '35.875785914943798', '128.04600386593199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('예밀와인 레드 스위트', '과실주', '예밀2리영농조합법인', '12%', '포도(캠벨얼리)', '750ml', '강원도 영월군 김삿갓면 예밀촌길 228-20', '강원', '20,000', - 'https://shopping-phinf.pstatic.net/main_8325331/83253314646.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8325331/83253314646.1.jpg', '37.1429450352326', '128.59223300382399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('정고집 나주배 약주 9%', '약주', '남도탁주', '9%', '쌀, 쌀가루(국내산), 배착즙액(나주산), 정제효소제, 종국, 젖산, 효모', '500ml', '전남 나주시 노안면 노안로379', - '전남', '18,000', 'https://shopping-phinf.pstatic.net/main_3384485/33844856618.20220803174048.jpg'); + price, image, latitude, longitude) +VALUES ('정고집 나주배 약주 9%', '약주', '남도탁주', '9%', '쌀, 쌀가루(국내산), 배착즙액(나주산), 정제효소제, 종국, 젖산, 효모', '500ml', '전남 나주시 노안면 노안로379', '전남', '18,000', + 'https://shopping-phinf.pstatic.net/main_3384485/33844856618.20220803174048.jpg', '35.071896829590898', '126.734271400304'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('가을빛 레드와인', '과실주', '예인화원', '14%', '포도(캠벨얼리)', '750ml', '경북 경주시 남산순환로10', '경북', '35,000', - 'https://shopping-phinf.pstatic.net/main_8513151/85131516490.jpg'); + 'https://shopping-phinf.pstatic.net/main_8513151/85131516490.jpg', '35.794152799248899', '129.24355899000801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시나브로 레드 드라이', '과실주', '불휘농장', '12%', '포도(캠벨얼리)', '750ml', '충북 영동군 심천면 약목2길26', '충북', '25,000', - 'https://shopping-phinf.pstatic.net/main_8598065/85980654677.jpg'); + 'https://shopping-phinf.pstatic.net/main_8598065/85980654677.jpg', '36.201913743030801', '127.72029368720899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('천년주', '일반증류주', '농업회사법인(주)영덕주조', '25%', '쌀(국내산), 천년초(열매), 조효소제, 효모, 젖산, 정제효소, 구연산, 정제수', '375ml', - '경북 영덕군 강구면 소월1길 16-10', '경북', '15,000', 'https://shopping-phinf.pstatic.net/main_8256926/82569266626.jpg'); + price, image, latitude, longitude) +VALUES ('천년주', '일반증류주', '농업회사법인(주)영덕주조', '25%', '쌀(국내산), 천년초(열매), 조효소제, 효모, 젖산, 정제효소, 구연산, 정제수', '375ml', '경북 영덕군 강구면 소월1길 16-10', '경북', '15,000', + 'https://shopping-phinf.pstatic.net/main_8256926/82569266626.jpg', '36.379353762831599', '129.374510560467'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('해미읍성 매실와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '매실(80%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', '충남', - '20,000', 'https://shopping-phinf.pstatic.net/main_2404127/24041270526.20200904165729.jpg'); + price, image, latitude, longitude) +VALUES ('해미읍성 매실와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '매실(80%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', '충남', '20,000', + 'https://shopping-phinf.pstatic.net/main_2404127/24041270526.20200904165729.jpg', '36.697507437676599', '126.53612877610099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('오가피와인', '과실주', '영농조합법인 금이산농원', '12%', '오가피 열매(국내산), 백설탕, 효모, 메타중아황산칼륨', '500ml', '세종시 전의면 가느실길 127', '세종', - '20,000', 'https://shopping-phinf.pstatic.net/main_3617579/36175799119.jpg'); + price, image, latitude, longitude) +VALUES ('오가피와인', '과실주', '영농조합법인 금이산농원', '12%', '오가피 열매(국내산), 백설탕, 효모, 메타중아황산칼륨', '500ml', '세종시 전의면 가느실길 127', '세종', '20,000', + 'https://shopping-phinf.pstatic.net/main_3617579/36175799119.jpg', '36.640502652310801', '127.18926016454699'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('볼빨간막걸리 10', '탁주', '농업회사법인 (주)벗드림', '10%', '찹쌀(국내산), 누룩, 정제수', '500ml', '부산광역시 북구 덕천로247번길 3, 2층', '부산', - '7,000', 'https://shopping-phinf.pstatic.net/main_8500872/85008724553.jpg'); + price, image, latitude, longitude) +VALUES ('볼빨간막걸리 10', '탁주', '농업회사법인 (주)벗드림', '10%', '찹쌀(국내산), 누룩, 정제수', '500ml', '부산광역시 북구 덕천로247번길 3, 2층', '부산', '7,000', + 'https://shopping-phinf.pstatic.net/main_8500872/85008724553.jpg', '35.2109717267058', '129.031358852523'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('배꽃담은 연 생막걸리', '탁주', '(주)농업회사법인 술빚는 전가네', '10%', '국내산 쌀, 누룩, 효모, 젖산, 연잎, 정제수', '720ml', - '경기도 포천시 영북면 산정호수로 322번길 28', '경기', '20,000', - 'https://shopping-phinf.pstatic.net/main_1909157/19091579885.20190506120821.jpg'); + price, image, latitude, longitude) +VALUES ('배꽃담은 연 생막걸리', '탁주', '(주)농업회사법인 술빚는 전가네', '10%', '국내산 쌀, 누룩, 효모, 젖산, 연잎, 정제수', '720ml', '경기도 포천시 영북면 산정호수로 322번길 28', '경기', '20,000', + 'https://shopping-phinf.pstatic.net/main_1909157/19091579885.20190506120821.jpg', '38.0679508645974', '127.30498445885399'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('포엠 로제와인', '과실주', '갈기산포도농원 (주)농업회사법인', '12%', '포도(킹데라웨어)', '750ml', '충북 영동군 학산면 모리1길 23', '충북', '35,000', - 'https://shopping-phinf.pstatic.net/main_8270743/82707437481.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8270743/82707437481.1.jpg', '36.110856415274299', '127.647530610906'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('크라테 로제와인', '과실주', '수도산 와이너리', '11.5%', '산머루', '375ml', '경북 김천시 증산면 금곡리3길 29', '경북', '18,000', - 'https://shopping-phinf.pstatic.net/main_8398612/83986127145.3.jpg'); + 'https://shopping-phinf.pstatic.net/main_8398612/83986127145.3.jpg', '35.875785914943798', '128.04600386593199'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('가덕 순쌀 막걸리', '탁주', '농업회사법인 명세주가(주)', '6%', '국내산 쌀, 효모, 조효소재, 물엿, 아스파탐, 정제수', '750ml', '충북 청주시 상당구 가덕면 한계길 32-5', - '충북', '13,500(750ml*9병)', 'https://shopping-phinf.pstatic.net/main_8235450/82354500841.jpg'); + price, image, latitude, longitude) +VALUES ('가덕 순쌀 막걸리', '탁주', '농업회사법인 명세주가(주)', '6%', '국내산 쌀, 효모, 조효소재, 물엿, 아스파탐, 정제수', '750ml', '충북 청주시 상당구 가덕면 한계길 32-5', '충북', '13,500(750ml*9병)', + 'https://shopping-phinf.pstatic.net/main_8235450/82354500841.jpg', '36.596996821294397', '127.567644225908'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('청남대 블루베리 막걸리', '탁주', '농업회사법인 명세주가(주)', '6%', '국내산 쌀, 블루베리엑기스, 효모, 조효소재, 물엿, 아스파탐, 정제수', '750ml', - '충북 청주시 상당구 가덕면 한계길 32-5', '충북', '25,000(750ml*9병)', - 'https://shopping-phinf.pstatic.net/main_4057691/40576917710.jpg'); + price, image, latitude, longitude) +VALUES ('청남대 블루베리 막걸리', '탁주', '농업회사법인 명세주가(주)', '6%', '국내산 쌀, 블루베리엑기스, 효모, 조효소재, 물엿, 아스파탐, 정제수', '750ml', '충북 청주시 상당구 가덕면 한계길 32-5', '충북', '25,000(750ml*9병)', + 'https://shopping-phinf.pstatic.net/main_4057691/40576917710.jpg', '36.596996821294397', '127.567644225908'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시나브로 레드 스위트', '과실주', '불휘농장', '12%', '포도(캠벨얼리)', '750ml', '충북 영동군 심천면 약목2길26', '충북', '25,000', - 'https://shopping-phinf.pstatic.net/main_2353748/23537485945.3.jpg'); + 'https://shopping-phinf.pstatic.net/main_2353748/23537485945.3.jpg', '36.201913743030801', '127.72029368720899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('담양죽력고', '일반증류주', '추성고을', '25%', '정제수, 쌀(국내산), 누룩, 죽력, 계피, 석창포, 생강, 효모', '350ml', '전남 담양군 용면 추령로 29', '전남', - '13,000', 'https://shopping-phinf.pstatic.net/main_8423649/84236491423.2.jpg'); + price, image, latitude, longitude) +VALUES ('담양죽력고', '일반증류주', '추성고을', '25%', '정제수, 쌀(국내산), 누룩, 죽력, 계피, 석창포, 생강, 효모', '350ml', '전남 담양군 용면 추령로 29', '전남', '13,000', + 'https://shopping-phinf.pstatic.net/main_8423649/84236491423.2.jpg', '35.366386575009301', '126.985286653335'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('모월 청', '약주', '협동조합 주담', '16%', '쌀(국내산), 누룩, 정제수', '500ml', '강원도 원주시 판부면 판부신촌길 84', '강원', '21,000', - 'https://shopping-phinf.pstatic.net/main_8332625/83326252088.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8332625/83326252088.1.jpg', '37.299414999973003', '127.97345115422701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('기다림 25', '탁주', '농업회사법인(주)제이케이크래프트', '8%', '백미(국내산), 찹쌀(국내산), 곡자(밀누룩 국내산), 정제수', '750ml', - '부산광역시 동래구 사직북로48번길 34', '부산', '9,900', 'https://shopping-phinf.pstatic.net/main_3617455/36174554313.jpg'); + price, image, latitude, longitude) +VALUES ('기다림 25', '탁주', '농업회사법인(주)제이케이크래프트', '8%', '백미(국내산), 찹쌀(국내산), 곡자(밀누룩 국내산), 정제수', '750ml', '부산광역시 동래구 사직북로48번길 34', '부산', '9,900', + 'https://shopping-phinf.pstatic.net/main_3617455/36174554313.jpg', '35.200541465722701', '129.06043945188'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('포엠 화이트와인', '과실주', '갈기산포도농원 (주)농업회사법인', '12%', '청포도(청수)', '750ml', '충북 영동군 학산면 모리1길 23', '충북', '35,000', - 'https://shopping-phinf.pstatic.net/main_8270747/82707479298.1.jpg'); + 'https://shopping-phinf.pstatic.net/main_8270747/82707479298.1.jpg', '36.110856415274299', '127.647530610906'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('샤토미소 레드 프리미엄 드라이', '과실주', '도란원', '13%', '포도(MBA, 산머루, 캠벨얼리)', '750ml', '충북 영동군 매곡면 유전장척길 143', '충북', '40,000', - 'https://shopping-phinf.pstatic.net/main_8600134/86001343130.jpg'); + 'https://shopping-phinf.pstatic.net/main_8600134/86001343130.jpg', '36.1920939357517', '127.936725157583'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시나브로 에뚜왈 로제 스파클링', '과실주', '불휘농장', '5%', '포도(국내산_캠벨얼리)', '750ml', '충북 영동군 심천면 약목2길26', '충북', '30,000', - 'https://shopping-phinf.pstatic.net/main_4061131/40611318746.jpg'); + 'https://shopping-phinf.pstatic.net/main_4061131/40611318746.jpg', '36.201913743030801', '127.72029368720899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('해미읍성 살구와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '살구(80%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', '충남', - '20,000', 'https://shopping-phinf.pstatic.net/main_2404141/24041419526.20200904164803.jpg'); + price, image, latitude, longitude) +VALUES ('해미읍성 살구와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '살구(80%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', '충남', '20,000', + 'https://shopping-phinf.pstatic.net/main_2404141/24041419526.20200904164803.jpg', '36.697507437676599', '126.53612877610099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('기다림 16', '탁주', '농업회사법인(주)제이케이크래프트', '9%', '찹쌀(국내산), 흑미(국내산), 곡자(밀누룩 국내산), 정제수', '750ml', - '부산광역시 동래구 사직북로48번길 34', '부산', '11,000', 'https://shopping-phinf.pstatic.net/main_4008555/40085551465.jpg'); + price, image, latitude, longitude) +VALUES ('기다림 16', '탁주', '농업회사법인(주)제이케이크래프트', '9%', '찹쌀(국내산), 흑미(국내산), 곡자(밀누룩 국내산), 정제수', '750ml', '부산광역시 동래구 사직북로48번길 34', '부산', '11,000', + 'https://shopping-phinf.pstatic.net/main_4008555/40085551465.jpg', '35.200541465722701', '129.06043945188'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('천년담주', '약주', '농업회사법인 (주)죽향도가', '15%', '백미(국내산, 무기농 무농약), 벌꿀(국내산), 정제수', '500ml', '전남 담양군 담양읍 외다길30', '전남', - '10,000', 'https://shopping-phinf.pstatic.net/main_8308793/83087933758.1.jpg'); + price, image, latitude, longitude) +VALUES ('천년담주', '약주', '농업회사법인 (주)죽향도가', '15%', '백미(국내산, 무기농 무농약), 벌꿀(국내산), 정제수', '500ml', '전남 담양군 담양읍 외다길30', '전남', '10,000', + 'https://shopping-phinf.pstatic.net/main_8308793/83087933758.1.jpg', '35.320841904300799', '126.96358072111001'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('유자 동동주', '탁주', '성포양조장', '6%', '쌀(국내산), 소맥분(미국산), 전분당, 정제수, 유자과즙, 치자, 정제효소, 종국, 효모, 젖산, 아스파탐', '750ml', - '경남 거제시 사등면 지석3길3', '경남', '1,100', 'https://shopping-phinf.pstatic.net/main_8203824/82038248326.1.jpg'); + price, image, latitude, longitude) +VALUES ('유자 동동주', '탁주', '성포양조장', '6%', '쌀(국내산), 소맥분(미국산), 전분당, 정제수, 유자과즙, 치자, 정제효소, 종국, 효모, 젖산, 아스파탐', '750ml', '경남 거제시 사등면 지석3길3', '경남', '1,100', + 'https://shopping-phinf.pstatic.net/main_8203824/82038248326.1.jpg', '34.9079763686006', '128.51637920273899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('포엠 레드 스위트와인', '과실주', '갈기산포도농원 (주)농업회사법인', '12%', '포도(국내산_캠벨얼리, MBA)', '750ml', '충북 영동군 학산면 모리1길 23', '충북', - '25,000', 'https://shopping-phinf.pstatic.net/main_8337189/83371895692.jpg'); + price, image, latitude, longitude) +VALUES ('포엠 레드 스위트와인', '과실주', '갈기산포도농원 (주)농업회사법인', '12%', '포도(국내산_캠벨얼리, MBA)', '750ml', '충북 영동군 학산면 모리1길 23', '충북', '25,000', + 'https://shopping-phinf.pstatic.net/main_8337189/83371895692.jpg', '36.110856415274299', '127.647530610906'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('느낌 30', '증류식소주', '농업회사법인 명품안동소주 (주)', '30%', '백미(국내산), 누룩, 효모, 정제수', '360ml', '경북 안동시 풍산읍 유통단지길 124-34', '경북', - '6,500', 'https://shopping-phinf.pstatic.net/main_8381893/83818934475.4.jpg'); + price, image, latitude, longitude) +VALUES ('느낌 30', '증류식소주', '농업회사법인 명품안동소주 (주)', '30%', '백미(국내산), 누룩, 효모, 정제수', '360ml', '경북 안동시 풍산읍 유통단지길 124-34', '경북', '6,500', + 'https://shopping-phinf.pstatic.net/main_8381893/83818934475.4.jpg', '36.586341214230501', '128.60697754382701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('오목대', '기타주류', '농업회사법인 동문거리양조장(주) (전주술로시티)', '5%', '보리(국내산), 맥아(국내산), 말토텍스트린, 호프펠렛, 효모, 정제효소제, 정제수', '1000ml', - '전북 전주시 완산구 동문길99', '전북', '27,000(1000ml*3병)', - 'https://shopping-phinf.pstatic.net/main_8378764/83787640166.jpg'); + price, image, latitude, longitude) +VALUES ('오목대', '기타주류', '농업회사법인 동문거리양조장(주) (전주술로시티)', '5%', '보리(국내산), 맥아(국내산), 말토텍스트린, 호프펠렛, 효모, 정제효소제, 정제수', '1000ml', '전북 전주시 완산구 동문길99', '전북', '27,000(1000ml*3병)', + 'https://shopping-phinf.pstatic.net/main_8378764/83787640166.jpg', '35.817908767479999', '127.148611928354'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('경기전', '기타주류', '농업회사법인 동문거리양조장(주) (전주술로시티)', '5%', '보리(국내산), 맥아(국내산), 호프펠렛, 효모, 정제효소제, 정제수', '1000ml', - '전북 전주시 완산구 동문길99', '전북', '27,000(1000ml*3병)', - 'https://shopping-phinf.pstatic.net/main_3117150/31171504353.2.jpg'); + price, image, latitude, longitude) +VALUES ('경기전', '기타주류', '농업회사법인 동문거리양조장(주) (전주술로시티)', '5%', '보리(국내산), 맥아(국내산), 호프펠렛, 효모, 정제효소제, 정제수', '1000ml', '전북 전주시 완산구 동문길99', '전북', '27,000(1000ml*3병)', + 'https://shopping-phinf.pstatic.net/main_3117150/31171504353.2.jpg', '35.817908767479999', '127.148611928354'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('해미읍성 모과와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '모과(80%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', '충남', - '20,000', 'https://shopping-phinf.pstatic.net/main_2404094/24040943535.20200904164322.jpg'); + price, image, latitude, longitude) +VALUES ('해미읍성 모과와인', '과실주', '농업회사법인해미읍성딸기와인(주)', '12%', '모과(80%), 아황산염, 소르빈산염', '500ml', '충남 서산시 고북면 산직마을길85', '충남', '20,000', + 'https://shopping-phinf.pstatic.net/main_2404094/24040943535.20200904164322.jpg', '36.697507437676599', '126.53612877610099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('샹스프랑보아즈', '과실주', '(주)선운산복분자주 흥진', '13%', '복분자(고창산), 구연산, 과당, 아스파탐, 주정, 정제수', '500ml', '전북 고창군 부안면 복분자로535', - '전북', '150,000(500ml*10병)', 'https://shopping-phinf.pstatic.net/main_3061937/30619373512.20220120224909.jpg'); + price, image, latitude, longitude) +VALUES ('샹스프랑보아즈', '과실주', '(주)선운산복분자주 흥진', '13%', '복분자(고창산), 구연산, 과당, 아스파탐, 주정, 정제수', '500ml', '전북 고창군 부안면 복분자로535', '전북', '150,000(500ml*10병)', + 'https://shopping-phinf.pstatic.net/main_3061937/30619373512.20220120224909.jpg', '35.510942199674602', '126.64644550584801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('심플리 애플', '기타주류', '주식회사 배혜정 농업회사법인', '12%', '쌀(국산), 사과즙(국산), 벌꿀(국산)', '350ml', '경기도 화성시 정남면 서봉로 835', '경기', - ' 9,000', 'https://shopping-phinf.pstatic.net/main_8283306/82833063686.jpg'); + price, image, latitude, longitude) +VALUES ('심플리 애플', '기타주류', '주식회사 배혜정 농업회사법인', '12%', '쌀(국산), 사과즙(국산), 벌꿀(국산)', '350ml', '경기도 화성시 정남면 서봉로 835', '경기', ' 9,000', + 'https://shopping-phinf.pstatic.net/main_8283306/82833063686.jpg', '37.149585899755898', '126.96094622808'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('느낌 19.8', '증류식소주', '농업회사법인 명품안동소주 (주)', '19.8%', '백미(국내산), 누룩, 효모, 정제수', '360ml', '경북 안동시 풍산읍 유통단지길 124-34', - '경북', '4,000', 'https://shopping-phinf.pstatic.net/main_2171028/21710280921.2.jpg'); + price, image, latitude, longitude) +VALUES ('느낌 19.8', '증류식소주', '농업회사법인 명품안동소주 (주)', '19.8%', '백미(국내산), 누룩, 효모, 정제수', '360ml', '경북 안동시 풍산읍 유통단지길 124-34', '경북', '4,000', + 'https://shopping-phinf.pstatic.net/main_2171028/21710280921.2.jpg', '36.586341214230501', '128.60697754382701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('풍남문', '기타주류', '농업회사법인 동문거리양조장(주) (전주술로시티)', '5%', '보리(국내산), 맥아(국내산), 호프펠렛, 효모, 정제효소제, 정제수', '1000ml', - '전북 전주시 완산구 동문길99', '전북', '27,000(1000ml*3병)', - 'https://shopping-phinf.pstatic.net/main_2490990/24909900212.20201119201846.jpg'); + price, image, latitude, longitude) +VALUES ('풍남문', '기타주류', '농업회사법인 동문거리양조장(주) (전주술로시티)', '5%', '보리(국내산), 맥아(국내산), 호프펠렛, 효모, 정제효소제, 정제수', '1000ml', '전북 전주시 완산구 동문길99', '전북', '27,000(1000ml*3병)', + 'https://shopping-phinf.pstatic.net/main_2490990/24909900212.20201119201846.jpg', '35.817908767479999', '127.148611928354'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('구기홍주 14', '약주', '두이술공방', '14%', '쌀, 국, 구기자추출액, 올리고당, 효모, 효소, 아세설팜칼륨, 정제수', '360ml / 750ml', - '충남 청양군 대치면 방죽골길 46-19', '충남', '360ml ₩10,000, 750ml ₩16,000', - 'https://shopping-phinf.pstatic.net/main_2341027/23410275009.1.jpg'); + price, image, latitude, longitude) +VALUES ('구기홍주 14', '약주', '두이술공방', '14%', '쌀, 국, 구기자추출액, 올리고당, 효모, 효소, 아세설팜칼륨, 정제수', '360ml / 750ml', '충남 청양군 대치면 방죽골길 46-19', '충남', '360ml ₩10,000, 750ml ₩16,000', + 'https://shopping-phinf.pstatic.net/main_2341027/23410275009.1.jpg', '36.469465990120199', '126.841460370935'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('산내울 복분자주', '리큐르', '거창사과원예농협', '16%', '복분자, 설탕, 주정, 정제수, 과당', '750ml', '경남 거창군 거창읍 거함대로 3452-41', '경남', - '20,000', 'https://shopping-phinf.pstatic.net/main_8240587/82405874435.jpg'); + price, image, latitude, longitude) +VALUES ('산내울 복분자주', '리큐르', '거창사과원예농협', '16%', '복분자, 설탕, 주정, 정제수, 과당', '750ml', '경남 거창군 거창읍 거함대로 3452-41', '경남', '20,000', + 'https://shopping-phinf.pstatic.net/main_8240587/82405874435.jpg', '35.6718370192538', '127.93503974367999'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('필 FEEL', '증류식소주', '농업회사법인 명품안동소주 (주)', '40%', '백미(국내산), 누룩, 효모, 정제수', '500ml', '경북 안동시 풍산읍 유통단지길 124-34', '경북', - '25,000', 'https://shopping-phinf.pstatic.net/main_8268951/82689513777.4.jpg'); + price, image, latitude, longitude) +VALUES ('필 FEEL', '증류식소주', '농업회사법인 명품안동소주 (주)', '40%', '백미(국내산), 누룩, 효모, 정제수', '500ml', '경북 안동시 풍산읍 유통단지길 124-34', '경북', '25,000', + 'https://shopping-phinf.pstatic.net/main_8268951/82689513777.4.jpg', '36.586341214230501', '128.60697754382701'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('방문주 탁주', '탁주', '케이소주 (전주가양주연구소)', '15%', '국내산 찹쌀, 누룩, 정제수', '500ml', '전북 전주시 완산구 중산중앙로27. 3층', '전북', '6,000', - 'https://shopping-phinf.pstatic.net/main_8266119/82661195607.3.jpg'); + 'https://shopping-phinf.pstatic.net/main_8266119/82661195607.3.jpg', '35.816654689827899', '127.12120420246499'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('시나브로 드 글로리아', '과실주', '불휘농장', '12%', '포도(캠벨얼리)', '750ml', '충북 영동군 심천면 약목2길26', '충북', '25,000', - 'https://shopping-phinf.pstatic.net/main_3861653/38616534032.jpg'); + 'https://shopping-phinf.pstatic.net/main_3861653/38616534032.jpg', '36.201913743030801', '127.72029368720899'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('감이슬', '일반증류주', '양촌감영농조합법인', '23%', '감(국내산) 100%', '375ml', '충남 논산시 황산벌로 1075-21', '충남', '10,000', - 'https://shopping-phinf.pstatic.net/main_3672942/36729425697.jpg'); + 'https://shopping-phinf.pstatic.net/main_3672942/36729425697.jpg', '36.177842932451', '127.201208703747'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('그랑티그르CE2002', '과실주', '월류원 (오드린)', '12%', '포도(캠벨얼리 100%)', '750ml', '충북 영동군 황간면 남성동3길 4-14', '충북', '40,000', - 'https://shopping-phinf.pstatic.net/main_4090781/40907819908.jpg'); + 'https://shopping-phinf.pstatic.net/main_4090781/40907819908.jpg', '36.233829266636299', '127.910170927446'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) + price, image, latitude, longitude) VALUES ('두유노', '탁주', '디오케이브루어리', '6%', '찹쌀(국내산), 멥살(국내산), 누룩, 밀가루', '600ml', '서울특별시 강북구 삼양로 455, 1층', '서울', '6,000', - 'https://shopping-phinf.pstatic.net/main_3223716/32237165416.20220509133107.jpg'); -INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('서주 16%', '약주', '오대서주양조', '16%', '백미(국내산), 감자(국내산), 누룩, 효모, 정제수', '400ml', '강원도 평창군 진부면 영정게길57-1', '강원', - '45,000(400ml*2병)', 'https://shopping-phinf.pstatic.net/main_4061984/40619842370.20230615172052.jpg'); -INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('33JU', '일반증류주', '농업회사법인 33가 주식회사', '18%', '산양산삼, 주정, 결정과당, 효소처리스테비아, 에리스리톨, 호박산, 꿀', '500ml / 200ml', - '강원도 홍천군 남면 어두원이길 143', '강원', '49,000 / ₩23,000', - 'https://shopping-phinf.pstatic.net/main_3585676/35856766164.jpg'); -INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('바랑 탁', '탁주', '농업회사법인 (주)금계당', '15%', '찹쌀(국내산), 맵쌀(국내산), 누룩, 소맥분, 정제수', '375ml', '경북 안동시 일직면 돌고개길 9, 1층', '경북', - '18,000', 'https://shopping-phinf.pstatic.net/main_8219686/82196861058.jpg'); -INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('신선주 약주', '약주', '농업회사법인(주)신선', '16%', - '찹쌀(국내산), 전통누룩(국내산)(밀함유), 약재(국화, 쇠무릅, 당귀, 하수오, 구기자, 맥문동, 인삼, 육계(계피), 숙지황, 생지황)', '500ml', - '충청북도 청주시 상당구 것대로 5 1층', '충북', '25,000', 'https://shopping-phinf.pstatic.net/main_4070884/40708847116.jpg'); -INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('신선주 증류주', '증류주', '농업회사법인(주)신선', '52% / 42% / 35%', - '찹쌀(국내산), 전통누룩(국내산)(밀함유), 약재(국화, 쇠무릅, 당귀, 하수오, 구기자, 맥문동, 인삼, 육계(계피), 숙지황, 생지황)', '375ml', - '충청북도 청주시 상당구 것대로 5 1층', '충북', '60,000', 'https://shopping-phinf.pstatic.net/main_8224024/82240243659.2.jpg'); -INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image) -VALUES ('백이주', '과실주', '농업회사법인 (주)세찬 제조사', '35%', '쌀(국산), 홍마늘액(국산), 감초(국산), 개량누룩(국산), 효모, 정제효소제, 정제수, 밀함유', '800ml', - '경상북도 영천시 임고면 포은로 842-50', '경북', '30,000', 'https://shopping-phinf.pstatic.net/main_8304112/83041122592.jpg'); + 'https://shopping-phinf.pstatic.net/main_3223716/32237165416.20220509133107.jpg', '37.643900176705998', '127.015785423103'); +INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, + price, image, latitude, longitude) +VALUES ('서주 16%', '약주', '오대서주양조', '16%', '백미(국내산), 감자(국내산), 누룩, 효모, 정제수', '400ml', '강원도 평창군 진부면 영정게길57-1', '강원', '45,000(400ml*2병)', + 'https://shopping-phinf.pstatic.net/main_4061984/40619842370.20230615172052.jpg', '37.643200804386296', '128.56646470943701'); +INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, + price, image, latitude, longitude) +VALUES ('33JU', '일반증류주', '농업회사법인 33가 주식회사', '18%', '산양산삼, 주정, 결정과당, 효소처리스테비아, 에리스리톨, 호박산, 꿀', '500ml / 200ml', '강원도 홍천군 남면 어두원이길 143', '강원', '49,000 / ₩23,000', + 'https://shopping-phinf.pstatic.net/main_3585676/35856766164.jpg', '37.618051008358499', '127.75092705373601'); +INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, + price, image, latitude, longitude) +VALUES ('바랑 탁', '탁주', '농업회사법인 (주)금계당', '15%', '찹쌀(국내산), 맵쌀(국내산), 누룩, 소맥분, 정제수', '375ml', '경북 안동시 일직면 돌고개길 9, 1층', '경북', '18,000', + 'https://shopping-phinf.pstatic.net/main_8219686/82196861058.jpg', '36.476384770141898', '128.65950503285299'); +INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, + price, image, latitude, longitude) +VALUES ('신선주 약주', '약주', '농업회사법인(주)신선', '16%', '찹쌀(국내산), 전통누룩(국내산)(밀함유), 약재(국화, 쇠무릅, 당귀, 하수오, 구기자, 맥문동, 인삼, 육계(계피), 숙지황, 생지황)', '500ml', '충청북도 청주시 상당구 것대로 5 1층', '충북', '25,000', + 'https://shopping-phinf.pstatic.net/main_4070884/40708847116.jpg', '36.6531657154637', '127.54201794414099'); +INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, + price, image, latitude, longitude) +VALUES ('신선주 증류주', '증류주', '농업회사법인(주)신선', '52% / 42% / 35%', '찹쌀(국내산), 전통누룩(국내산)(밀함유), 약재(국화, 쇠무릅, 당귀, 하수오, 구기자, 맥문동, 인삼, 육계(계피), 숙지황, 생지황)', '375ml', '충청북도 청주시 상당구 것대로 5 1층', '충북', '60,000', + 'https://shopping-phinf.pstatic.net/main_8224024/82240243659.2.jpg', '36.6531657154637', '127.54201794414099'); +INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, + price, image, latitude, longitude) +VALUES ('백이주', '과실주', '농업회사법인 (주)세찬 제조사', '35%', '쌀(국산), 홍마늘액(국산), 감초(국산), 개량누룩(국산), 효모, 정제효소제, 정제수, 밀함유', '800ml', '경상북도 영천시 임고면 포은로 842-50', '경북', '30,000', + 'https://shopping-phinf.pstatic.net/main_8304112/83041122592.jpg', '36.0451664108259', '128.995207775642'); From dafa99a7bd2e14ccbebac7880c8c456aeb413aed Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 26 Aug 2023 19:37:30 +0900 Subject: [PATCH 63/76] =?UTF-8?q?style=20:=20Swagger=20=EC=A3=BC=EC=86=8C?= =?UTF-8?q?=20https=20=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/co/kr/jurumarble/config/SwaggerConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java b/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java index e93ac253..5b26f269 100644 --- a/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java +++ b/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java @@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration; @OpenAPIDefinition(servers = { - @Server(url = "http://jurumarble-env.eba-tv8jafay.ap-northeast-2.elasticbeanstalk.com/swagger-ui/index.html"), + @Server(url = "https://jurumarble.site/swagger-ui/index.html"), @Server(url = "http://localhost:8080/") }) @Configuration From 037d6b738285abc388768b6022d53274e577171d Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 26 Aug 2023 19:45:13 +0900 Subject: [PATCH 64/76] =?UTF-8?q?style=20:=20Swagger=20=EC=A3=BC=EC=86=8C?= =?UTF-8?q?=20https=20=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/co/kr/jurumarble/EbHealthCheck.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/co/kr/jurumarble/EbHealthCheck.java b/src/main/java/co/kr/jurumarble/EbHealthCheck.java index 78f76c0c..a1f0f3e0 100644 --- a/src/main/java/co/kr/jurumarble/EbHealthCheck.java +++ b/src/main/java/co/kr/jurumarble/EbHealthCheck.java @@ -10,7 +10,7 @@ @RestController @RequiredArgsConstructor @Controller -public class EbHealthCheck { +public class EbHealthCheck { @Value("${swagger.url}") private String swaggerUrl; From 72714dcfb5e7bad61c1d3b11e753104c649db869 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Sat, 26 Aug 2023 20:03:26 +0900 Subject: [PATCH 65/76] =?UTF-8?q?fix=20:=20Swagger=20=EC=A3=BC=EC=86=8C=20?= =?UTF-8?q?https=20=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/co/kr/jurumarble/config/SwaggerConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java b/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java index 5b26f269..eec13db1 100644 --- a/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java +++ b/src/main/java/co/kr/jurumarble/config/SwaggerConfig.java @@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration; @OpenAPIDefinition(servers = { - @Server(url = "https://jurumarble.site/swagger-ui/index.html"), + @Server(url = "https://jurumarble.site"), @Server(url = "http://localhost:8080/") }) @Configuration From db5afb2e97003d54db6ac56173e03690cd38f30e Mon Sep 17 00:00:00 2001 From: wellbeing-dough Date: Mon, 28 Aug 2023 16:18:15 +0900 Subject: [PATCH 66/76] =?UTF-8?q?feat=20:=20=EC=9C=84=EB=8F=84=20=EA=B2=BD?= =?UTF-8?q?=EB=8F=84=20=EC=86=8C=EC=88=98=EC=A0=90=20=EB=B2=94=EC=9C=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/schema.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql index cbbf89d9..51bec524 100644 --- a/src/main/resources/schema.sql +++ b/src/main/resources/schema.sql @@ -88,10 +88,10 @@ CREATE TABLE drink capacity VARCHAR(50) DEFAULT NULL, manufacture_address VARCHAR(255) DEFAULT NULL, region VARCHAR(10) DEFAULT NULL, - price VARCHAR(50) DEFAULT NULL, + price VARCHAR(50) DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, - latitude DECIMAL(9, 6) DEFAULT NULL, - longitude DECIMAL(9, 6) DEFAULT, + latitude DECIMAL(18, 15) DEFAULT NULL, + longitude DECIMAL(18, 15) DEFAULT NULL, PRIMARY KEY (id) ); From 13b2db36c4c45a17d7019f83b377bbb1725358ee Mon Sep 17 00:00:00 2001 From: wellbeing-dough Date: Mon, 28 Aug 2023 17:29:46 +0900 Subject: [PATCH 67/76] =?UTF-8?q?feat=20:=20=EC=BF=BC=EB=A6=AC=EB=AC=B8=20?= =?UTF-8?q?=EC=98=A4=ED=83=80=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/data.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index 02a633ea..4f5d9290 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -151,7 +151,7 @@ INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, c VALUES ('고운달 오크', '일반증류주', '농업회사법인(주)제이엘', '52%', '오미자(문경산)', '500ml / 200ml', '경북 문경시 문경읍 새재로 609', '경북', '360,000(500ml), ₩180,000(200ml)', 'https://shopping-phinf.pstatic.net/main_3405663/34056638628.jpg', '36.736133308451798', '128.09134747187099'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, - price, image, latitude, longitude)ㅋ + price, image, latitude, longitude) VALUES ('황금보리소주25', '증류식소주', '황금보리(유)농업회사법인', '25%', '보리, 누룩, 정제수', '375ml', '충남 홍성군 서부면 서부로 696', '충남', '42,500(375ml*5병)', 'https://shopping-phinf.pstatic.net/main_3306300/33063009619.20220621163903.jpg', '36.593712808577799', '126.511906219501'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, @@ -240,7 +240,7 @@ VALUES ('한산소곡주', '살균약주', '한산소곡주', '18%', '찹쌀, 'https://shopping-phinf.pstatic.net/main_1195683/11956838281.20180327164858.jpg', '36.0800411361503', '126.80234354141'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, price, image, latitude, longitude) - ('옛날 막걸리 古', '탁주', '국순당', '7.8%', '배정제수, 쌀(국산), 국(밀), 과당, 효모 / 에탄올 함량 : 7.8%', '750ml', '강원도 횡성군 둔내면 강변로 975', '강원', '2700', +VALUES ('옛날 막걸리 古', '탁주', '국순당', '7.8%', '배정제수, 쌀(국산), 국(밀), 과당, 효모 / 에탄올 함량 : 7.8%', '750ml', '강원도 횡성군 둔내면 강변로 975', '강원', '2700', 'https://shopping-phinf.pstatic.net/main_8639598/86395989854.1.jpg', '37.488285940926602', '128.19734659608801'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, price, image, latitude, longitude) From 92ffb9fdd51c188414b4ccec504bfc1ab0a71176 Mon Sep 17 00:00:00 2001 From: wellbeing-dough Date: Mon, 28 Aug 2023 17:39:58 +0900 Subject: [PATCH 68/76] =?UTF-8?q?feat=20:=20=EC=98=A4=ED=83=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index 4f5d9290..d764bdde 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -589,7 +589,7 @@ VALUES ('양촌 우렁이쌀 손 막걸리', '탁주', '양촌양조', '7.5%', ' INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, price, image, latitude, longitude) VALUES ('진도홍주 루비콘', '리큐르', '대대로영농조합법인', '40%', '쌀, 누룩, 지초, 정제수', '375ml', '전남 진도군 군내면 명량대첩로288-23', '전남', '10,000', - 'https://shopping-phinf.pstatic.net/main_3536976/35369769142.jpg', '34.5524630981744', '126.303581332932', ); + 'https://shopping-phinf.pstatic.net/main_3536976/35369769142.jpg', '34.5524630981744', '126.303581332932'); INSERT INTO drink (name, type, product_name, alcoholic_beverage, raw_material, capacity, manufacture_address, region, price, image, latitude, longitude) VALUES ('무주 구천동 머루와인', '과실주', '덕유양조', '12%', '국내산 산머루', '750ml', '전북 무주군 안성면 장무로 1375-7', '전북', '25,000', From f1f24ffcaa2a78ab9b37919777f8de14dc6eeb81 Mon Sep 17 00:00:00 2001 From: wellbeing-dough Date: Wed, 30 Aug 2023 04:24:40 +0900 Subject: [PATCH 69/76] =?UTF-8?q?feat=20:=20=EC=A0=84=ED=86=B5=EC=A3=BC=20?= =?UTF-8?q?=EC=A7=80=EB=8F=84=20=EA=B8=B0=EB=B0=98=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drink/controller/DrinkController.java | 9 +++++++ .../response/GetMapInDrinksResponse.java | 21 ++++++++++++++++ .../drink/domain/dto/MapInDrinkData.java | 24 +++++++++++++++++++ .../jurumarble/drink/domain/entity/Drink.java | 9 ++++--- .../drink/repository/DrinkRepository.java | 13 +++++++++- .../drink/service/DrinkService.java | 15 ++++++++++++ 6 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java create mode 100644 src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java diff --git a/src/main/java/co/kr/jurumarble/drink/controller/DrinkController.java b/src/main/java/co/kr/jurumarble/drink/controller/DrinkController.java index bfef5f5d..11d8a96a 100644 --- a/src/main/java/co/kr/jurumarble/drink/controller/DrinkController.java +++ b/src/main/java/co/kr/jurumarble/drink/controller/DrinkController.java @@ -3,6 +3,7 @@ import co.kr.jurumarble.drink.controller.request.EnjoyDrinkRequest; import co.kr.jurumarble.drink.controller.response.GetDrinkResponse; import co.kr.jurumarble.drink.controller.response.GetHotDrinksResponse; +import co.kr.jurumarble.drink.controller.response.GetMapInDrinksResponse; import co.kr.jurumarble.drink.service.DrinkService; import co.kr.jurumarble.drink.service.response.GetDrinkServiceResponse; import io.swagger.v3.oas.annotations.Operation; @@ -40,4 +41,12 @@ public ResponseEntity> getHotDrinks(@RequestParam in return ResponseEntity.status(HttpStatus.OK) .body(drinkService.getHotDrinks(size)); } + + @Operation(summary = "전통주 지도 조회", description = "요청시 쿼리 파라미터로 좌측상단 좌표, 우측상단 좌표 보내주세요") + @GetMapping("/map") + public ResponseEntity> getMapInDrinks(@RequestParam Double startX, @RequestParam Double startY, @RequestParam Double endX, @RequestParam Double endY, @RequestParam int page, @RequestParam int size) { + Slice drinks = drinkService.getMapInDrinks(startX, startY, endX, endY, page, size); + return new ResponseEntity(drinks, HttpStatus.OK); + } + } diff --git a/src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java b/src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java new file mode 100644 index 00000000..1632f7df --- /dev/null +++ b/src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java @@ -0,0 +1,21 @@ +package co.kr.jurumarble.drink.controller.response; + +import lombok.Getter; + +@Getter +public class GetMapInDrinksResponse { + + private Long drinkId; + private String productName; + private String region; + private Double latitude; + private Double longitude; + + public GetMapInDrinksResponse(Long drinkId, String productName, String region, Double latitude, Double longitude) { + this.drinkId = drinkId; + this.productName = productName; + this.region = region; + this.latitude = latitude; + this.longitude = longitude; + } +} diff --git a/src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java b/src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java new file mode 100644 index 00000000..f7d77fb9 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java @@ -0,0 +1,24 @@ +package co.kr.jurumarble.drink.domain.dto; + + +import co.kr.jurumarble.drink.controller.response.GetMapInDrinksResponse; + +public class MapInDrinkData { + private Long drinkId; + private String productName; + private String region; + private Double latitude; + private Double longitude; + + public MapInDrinkData(Long drinkId, String productName, String region, Double latitude, Double longitude) { + this.drinkId = drinkId; + this.productName = productName; + this.region = region; + this.latitude = latitude; + this.longitude = longitude; + } + + public GetMapInDrinksResponse toMapInDrinksResponse() { + return new GetMapInDrinksResponse(drinkId, productName, region, latitude, longitude); + } +} diff --git a/src/main/java/co/kr/jurumarble/drink/domain/entity/Drink.java b/src/main/java/co/kr/jurumarble/drink/domain/entity/Drink.java index 2b16f89f..eb126d28 100644 --- a/src/main/java/co/kr/jurumarble/drink/domain/entity/Drink.java +++ b/src/main/java/co/kr/jurumarble/drink/domain/entity/Drink.java @@ -41,9 +41,12 @@ public class Drink { private String image; + private Double latitude; + + private Double longitude; @Builder - public Drink(Long id, String name, String type, String productName, String alcoholicBeverage, String rawMaterial, int capacity, String manufactureAddress, String region, int price, String image) { + public Drink(Long id, String name, String type, String productName, String alcoholicBeverage, String rawMaterial, int capacity, String manufactureAddress, String region, int price, String image, Double latitude, Double longitude) { this.id = id; this.name = name; this.type = type; @@ -55,10 +58,10 @@ public Drink(Long id, String name, String type, String productName, String alcoh this.region = region; this.price = price; this.image = image; + this.latitude = latitude; + this.longitude = longitude; } - - @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java b/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java index 0d55b029..6a98b96a 100644 --- a/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java +++ b/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java @@ -1,7 +1,12 @@ package co.kr.jurumarble.drink.repository; +import co.kr.jurumarble.drink.domain.dto.MapInDrinkData; import co.kr.jurumarble.drink.domain.entity.Drink; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Slice; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import java.util.List; @@ -10,4 +15,10 @@ public interface DrinkRepository extends JpaRepository, DrinkEntityRepository { List findDrinksByIdIn(List drinkIds); -} + + @Query("SELECT new co.kr.jurumarble.drink.domain.dto.MapInDrinkData(d.id, d.productName, d.region, d.latitude, d.longitude) FROM Drink d " + + "WHERE (d.latitude BETWEEN :startX AND :endX AND d.longitude BETWEEN :startY AND :endY) " + + "ORDER BY d.productName") + Slice findDrinksByCoordinate(PageRequest pageRequest, @Param("startX") Double startX, @Param("startY") Double startY, @Param("endX") Double endX, @Param("endY") Double endY); + +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/drink/service/DrinkService.java b/src/main/java/co/kr/jurumarble/drink/service/DrinkService.java index 570c524e..a82d6f3b 100644 --- a/src/main/java/co/kr/jurumarble/drink/service/DrinkService.java +++ b/src/main/java/co/kr/jurumarble/drink/service/DrinkService.java @@ -1,7 +1,9 @@ package co.kr.jurumarble.drink.service; import co.kr.jurumarble.drink.controller.response.GetHotDrinksResponse; +import co.kr.jurumarble.drink.controller.response.GetMapInDrinksResponse; import co.kr.jurumarble.drink.domain.EnjoyDrinkValidator; +import co.kr.jurumarble.drink.domain.dto.MapInDrinkData; import co.kr.jurumarble.drink.domain.entity.Drink; import co.kr.jurumarble.drink.domain.entity.EnjoyDrink; import co.kr.jurumarble.drink.repository.DrinkRepository; @@ -54,4 +56,17 @@ private List getGetHotDrinksResponses(Slice .map(HotDrinkData::toHotDrinksResponse) .collect(Collectors.toList()); } + + public Slice getMapInDrinks(Double startX, Double startY, Double endX, Double endY, int page, int size) { + PageRequest pageRequest = PageRequest.of(page, size); + Slice drinkData = drinkRepository.findDrinksByCoordinate(pageRequest, startX, startY, endX, endY); + return new SliceImpl<>(getGetMapInDrinksResponses(drinkData), drinkData.getPageable(), drinkData.hasNext()); + + } + + private List getGetMapInDrinksResponses(Slice drinkData) { + return drinkData.stream() + .map(MapInDrinkData::toMapInDrinksResponse) + .collect(Collectors.toList()); + } } From a4fe6f0fcc40b30aa5d314d4f3782494b9fe045c Mon Sep 17 00:00:00 2001 From: wellbeing-dough Date: Wed, 30 Aug 2023 16:48:14 +0900 Subject: [PATCH 70/76] =?UTF-8?q?feat=20:=20=EC=A1=B0=ED=9A=8C=20=EB=82=B4?= =?UTF-8?q?=EC=9A=A9=20=EC=A0=9C=EC=A1=B0=EC=82=AC=20->=20=EC=83=81?= =?UTF-8?q?=ED=92=88=EB=AA=85=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drink/controller/response/GetMapInDrinksResponse.java | 6 +++--- .../co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java | 8 ++++---- .../kr/jurumarble/drink/repository/DrinkRepository.java | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java b/src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java index 1632f7df..33e5f267 100644 --- a/src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java +++ b/src/main/java/co/kr/jurumarble/drink/controller/response/GetMapInDrinksResponse.java @@ -6,14 +6,14 @@ public class GetMapInDrinksResponse { private Long drinkId; - private String productName; + private String name; private String region; private Double latitude; private Double longitude; - public GetMapInDrinksResponse(Long drinkId, String productName, String region, Double latitude, Double longitude) { + public GetMapInDrinksResponse(Long drinkId, String name, String region, Double latitude, Double longitude) { this.drinkId = drinkId; - this.productName = productName; + this.name = name; this.region = region; this.latitude = latitude; this.longitude = longitude; diff --git a/src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java b/src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java index f7d77fb9..c1504b11 100644 --- a/src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java +++ b/src/main/java/co/kr/jurumarble/drink/domain/dto/MapInDrinkData.java @@ -5,20 +5,20 @@ public class MapInDrinkData { private Long drinkId; - private String productName; + private String name; private String region; private Double latitude; private Double longitude; - public MapInDrinkData(Long drinkId, String productName, String region, Double latitude, Double longitude) { + public MapInDrinkData(Long drinkId, String name, String region, Double latitude, Double longitude) { this.drinkId = drinkId; - this.productName = productName; + this.name = name; this.region = region; this.latitude = latitude; this.longitude = longitude; } public GetMapInDrinksResponse toMapInDrinksResponse() { - return new GetMapInDrinksResponse(drinkId, productName, region, latitude, longitude); + return new GetMapInDrinksResponse(drinkId, name, region, latitude, longitude); } } diff --git a/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java b/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java index 6a98b96a..dd3c8077 100644 --- a/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java +++ b/src/main/java/co/kr/jurumarble/drink/repository/DrinkRepository.java @@ -16,9 +16,9 @@ public interface DrinkRepository extends JpaRepository, DrinkEntity List findDrinksByIdIn(List drinkIds); - @Query("SELECT new co.kr.jurumarble.drink.domain.dto.MapInDrinkData(d.id, d.productName, d.region, d.latitude, d.longitude) FROM Drink d " + + @Query("SELECT new co.kr.jurumarble.drink.domain.dto.MapInDrinkData(d.id, d.name, d.region, d.latitude, d.longitude) FROM Drink d " + "WHERE (d.latitude BETWEEN :startX AND :endX AND d.longitude BETWEEN :startY AND :endY) " + - "ORDER BY d.productName") + "ORDER BY d.name") Slice findDrinksByCoordinate(PageRequest pageRequest, @Param("startX") Double startX, @Param("startY") Double startY, @Param("endX") Double endX, @Param("endY") Double endY); } \ No newline at end of file From 757eba46425fd19f0fe42560ca2f9c01ae4347ba Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 31 Aug 2023 00:46:21 +0900 Subject: [PATCH 71/76] =?UTF-8?q?feat=20:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EC=97=85=EB=A1=9C=EB=93=9C=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 3 + .../jurumarble/client/s3/ImageUploadDto.java | 17 +++++ .../kr/jurumarble/client/s3/S3Controller.java | 43 ++++++++++++ .../kr/jurumarble/client/s3/S3Uploader.java | 67 +++++++++++++++++++ .../co/kr/jurumarble/config/S3Config.java | 28 ++++++++ src/main/resources/application-prod.yml | 14 ++++ 6 files changed, 172 insertions(+) create mode 100644 src/main/java/co/kr/jurumarble/client/s3/ImageUploadDto.java create mode 100644 src/main/java/co/kr/jurumarble/client/s3/S3Controller.java create mode 100644 src/main/java/co/kr/jurumarble/client/s3/S3Uploader.java create mode 100644 src/main/java/co/kr/jurumarble/config/S3Config.java diff --git a/build.gradle b/build.gradle index 28d7487c..4a662379 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,9 @@ dependencies { implementation "com.querydsl:querydsl-jpa:5.0.0" annotationProcessor "com.querydsl:querydsl-apt:5.0.0" + //s3 추가 + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + } // Querydsl 설정 추가 diff --git a/src/main/java/co/kr/jurumarble/client/s3/ImageUploadDto.java b/src/main/java/co/kr/jurumarble/client/s3/ImageUploadDto.java new file mode 100644 index 00000000..6cbe795e --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/s3/ImageUploadDto.java @@ -0,0 +1,17 @@ +package co.kr.jurumarble.client.s3; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class ImageUploadDto { + private String imageUrl; + private String message; + + public ImageUploadDto(String imageUrl, String message) { + this.imageUrl = imageUrl; + this.message = message; + } +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/client/s3/S3Controller.java b/src/main/java/co/kr/jurumarble/client/s3/S3Controller.java new file mode 100644 index 00000000..e219bb72 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/s3/S3Controller.java @@ -0,0 +1,43 @@ +package co.kr.jurumarble.client.s3; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +@RequiredArgsConstructor +@RestController +@RequestMapping("/api/images") +@Tag(name = "image", description = "S3 업로드 api") +public class S3Controller { + + private final S3Uploader s3Uploader; + private static final Logger logger = LoggerFactory.getLogger(S3Controller.class); + + @Operation( + summary = "이미지 파일 업로드", + description = "MultipartFile 형태의 이미지 파일을 'images'라는 키로 form-data 형태로 전송해주세요. 이 API는 전송된 이미지를 S3에 저장하고, 저장된 이미지의 URL을 반환합니다." + ) + @PostMapping(value = "", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity uploadImage(@RequestParam("images") MultipartFile multipartFile) { + try { + String uploadedUrl = s3Uploader.uploadFiles(multipartFile, "static"); + ImageUploadDto imageUpload = new ImageUploadDto(uploadedUrl, "이미지 업로드에 성공했습니다."); + return new ResponseEntity(imageUpload, HttpStatus.OK); + } catch (Exception e) { + logger.error("Error occurred while uploading image: ", e); + return new ResponseEntity("잘못된 요청입니다.", HttpStatus.BAD_REQUEST); + } + } + + +} diff --git a/src/main/java/co/kr/jurumarble/client/s3/S3Uploader.java b/src/main/java/co/kr/jurumarble/client/s3/S3Uploader.java new file mode 100644 index 00000000..f0c0e3b3 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/client/s3/S3Uploader.java @@ -0,0 +1,67 @@ +package co.kr.jurumarble.client.s3; + +import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.model.CannedAccessControlList; +import com.amazonaws.services.s3.model.PutObjectRequest; +import lombok.RequiredArgsConstructor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Optional; +import java.util.UUID; + +@Component +@RequiredArgsConstructor +public class S3Uploader { + + private static final Logger logger = LoggerFactory.getLogger(S3Uploader.class); + private final AmazonS3Client amazonS3Client; + @Value("${cloud.aws.s3.bucket}") + private String bucket; + + public String uploadFiles(MultipartFile multipartFile, String dirName) throws IOException { + File uploadFile = convert(multipartFile) // 파일 변환할 수 없으면 에러 + .orElseThrow(() -> new IllegalArgumentException("error: MultipartFile -> File convert fail")); + return upload(uploadFile, dirName); + } + + public String upload(File uploadFile, String filePath) { + String fileName = filePath + "/" + UUID.randomUUID() + uploadFile.getName(); // S3에 저장된 파일 이름 + String uploadImageUrl = putS3(uploadFile, fileName); // s3로 업로드 + removeNewFile(uploadFile); + return uploadImageUrl; + } + + // S3로 업로드 + private String putS3(File uploadFile, String fileName) { + amazonS3Client.putObject(new PutObjectRequest(bucket, fileName, uploadFile).withCannedAcl(CannedAccessControlList.PublicRead)); + return amazonS3Client.getUrl(bucket, fileName).toString(); + } + + // 로컬에 저장된 이미지 지우기 + private void removeNewFile(File targetFile) { + if (targetFile.delete()) { + logger.info("Successfully deleted local image."); + return; + } + logger.warn("Failed to delete image."); + } + + // 로컬에 파일 업로드 하기 + private Optional convert(MultipartFile file) throws IOException { + File convertFile = new File(System.getProperty("user.dir") + "/" + file.getOriginalFilename()); + if (convertFile.createNewFile()) { // 바로 위에서 지정한 경로에 File이 생성됨 (경로가 잘못되었다면 생성 불가능) + try (FileOutputStream fos = new FileOutputStream(convertFile)) { // FileOutputStream 데이터를 파일에 바이트 스트림으로 저장하기 위함 + fos.write(file.getBytes()); + } + return Optional.of(convertFile); + } + return Optional.empty(); + } +} \ No newline at end of file diff --git a/src/main/java/co/kr/jurumarble/config/S3Config.java b/src/main/java/co/kr/jurumarble/config/S3Config.java new file mode 100644 index 00000000..748c3854 --- /dev/null +++ b/src/main/java/co/kr/jurumarble/config/S3Config.java @@ -0,0 +1,28 @@ +package co.kr.jurumarble.config; + +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.services.s3.AmazonS3Client; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class S3Config { + @Value("${cloud.aws.credentials.access-key}") + private String accessKey; + @Value("${cloud.aws.credentials.secret-key}") + private String secretKey; + @Value("${cloud.aws.region.static}") + private String region; + + @Bean + public AmazonS3Client amazonS3Client() { + BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKey,secretKey); + return (AmazonS3Client) AmazonS3ClientBuilder.standard() + .withRegion(region) + .withCredentials(new AWSStaticCredentialsProvider(awsCreds)) + .build(); + } +} diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 6e33307b..632c7df6 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -109,3 +109,17 @@ springdoc: default-produces-media-type: application/json swagger.url: ${swagger.url} + + +#s3 +cloud: + aws: + credentials: + access-key: ${aws.credentials.access.key} + secret-key: ${aws.credentials.secret.key} + s3: + bucket: elasticbeanstalk-ap-northeast-2-319210348301 + region: + static: ap-northeast-2 + stack: + auto: 'false' \ No newline at end of file From fba81d3870820c4b37f0e31f8c90ccac6aa980db Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 31 Aug 2023 02:18:36 +0900 Subject: [PATCH 72/76] =?UTF-8?q?chore=20:=20=EC=84=9C=EB=B2=84=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EB=A1=9C=EA=B7=B8=20=EB=A0=88=EB=B2=A8=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 632c7df6..d44a9be9 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -91,7 +91,9 @@ tour: logging: level: - '[org.springframework.boot.web]': INFO + '[org.springframework.boot.web]': ERROR + file: + name: /var/log/myapp.log ## JWT 환경변수 설정 From e59bf2960130b5e9de22263e60e3af50f295e04b Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 31 Aug 2023 02:41:54 +0900 Subject: [PATCH 73/76] =?UTF-8?q?chore=20:=20=EC=84=9C=EB=B2=84=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EA=B2=BD=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index d44a9be9..b91fcbff 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -91,9 +91,9 @@ tour: logging: level: - '[org.springframework.boot.web]': ERROR + '[org.springframework.boot.web]': INFO file: - name: /var/log/myapp.log + name: /var/app/current/jurumarble.log ## JWT 환경변수 설정 From 542c2dc8ccbf14b23de20d3f9ebbf5b21b8d8645 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 31 Aug 2023 03:57:40 +0900 Subject: [PATCH 74/76] =?UTF-8?q?chore=20:=20rds=20url=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index b91fcbff..329adc4f 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -6,7 +6,7 @@ server: spring: datasource: - url: jdbc:mysql://${rds.hostname}:${rds.port}/${rds.db.name}?serverTimezone=UTC&characterEncoding=UTF-8 + url: jdbc:mysql://${rds.hostname}:${rds.port}/${rds.db.name} driver-class-name: com.mysql.cj.jdbc.Driver username: ${rds.username} password: ${rds.password} @@ -120,7 +120,7 @@ cloud: access-key: ${aws.credentials.access.key} secret-key: ${aws.credentials.secret.key} s3: - bucket: elasticbeanstalk-ap-northeast-2-319210348301 + bucket: elasticbeanstalk-ap-northeast-2-319210348301 //숨겨야 됨 region: static: ap-northeast-2 stack: From 7885f9d651b042b82f142ae29346f3775b0345de Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 31 Aug 2023 04:14:25 +0900 Subject: [PATCH 75/76] =?UTF-8?q?chore=20:=20JDBC=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 - src/main/resources/application-prod.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 4a662379..f3470723 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'mysql:mysql-connector-java' - runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' runtimeOnly 'com.h2database:h2' implementation 'org.springframework.boot:spring-boot-starter-jdbc' diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 329adc4f..5e457195 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -19,7 +19,7 @@ spring: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl properties: hibernate: - dialect: org.hibernate.dialect.MySQL5Dialect + dialect: org.hibernate.dialect.MySQL8Dialect From 454e86403f105d02a8ea61c4ba47389a7cf54035 Mon Sep 17 00:00:00 2001 From: alsduq1117 Date: Thu, 31 Aug 2023 04:28:07 +0900 Subject: [PATCH 76/76] =?UTF-8?q?chore=20:=20s3=20=EB=B2=84=ED=82=B7=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 5e457195..778d69f4 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -120,7 +120,7 @@ cloud: access-key: ${aws.credentials.access.key} secret-key: ${aws.credentials.secret.key} s3: - bucket: elasticbeanstalk-ap-northeast-2-319210348301 //숨겨야 됨 + bucket: ${aws.s3.bucket} region: static: ap-northeast-2 stack: