Skip to content

Commit

Permalink
[feat] : Column Location
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackBean99 committed Sep 3, 2023
1 parent cac3e1a commit 8afcfc8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand All @@ -22,6 +23,7 @@
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@SecurityRequirement(name = "access-token")
Expand Down Expand Up @@ -83,9 +85,9 @@ public ResponseEntity<Long> deleteComment(@PathVariable(name = "comment-id") Lon
@Operation(summary = "댓글 수정")
@PutMapping("/comments/{comment-id}")
public ResponseEntity updateComment(
@PathVariable(name = "comment-id") Long commentId, @RequestBody String content) {
@PathVariable(name = "comment-id") Long commentId, @RequestBody Map<String, String> content) {
commentUseCase.updateCommentContent(commentId, content);
return new ResponseEntity<>(COMMENT_LIKE_SUCCESS_UPDATE_MESSAGE, HttpStatus.OK);
return new ResponseEntity<>(COMMENT_SUCCESS_UPDATE_MESSAGE, HttpStatus.OK);
}

@Operation(summary = "댓글 좋아요 취소", description = "댓글 좋아요 취소 -> 댓글 좋아요 한번 더 눌러도 동일합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.econovation.recruitdomain.out.CommentRecordPort;
import com.econovation.recruitdomain.out.InterviewerLoadPort;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -181,7 +182,8 @@ public Boolean isCheckedLike(Long commentId) {

@Override
@Transactional
public void updateCommentContent(Long commentId, String content) {
public void updateCommentContent(Long commentId, Map<String, String> contents) {
String content = contents.get("content");
// 내가 작성한 comment 만 수정할 수 있다.
Long idpId = SecurityUtils.getCurrentUserId();
Comment comment = commentLoadPort.findById(commentId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.econovation.recruitdomain.domains.dto.CommentPairVo;
import com.econovation.recruitdomain.domains.dto.CommentRegisterDto;
import java.util.List;
import java.util.Map;

@UseCase
public interface CommentUseCase {
Expand All @@ -22,7 +23,7 @@ public interface CommentUseCase {

Boolean isCheckedLike(Long commentId);

void updateCommentContent(Long commentId, String content);
void updateCommentContent(Long commentId, Map<String, String> contents);

List<CommentPairVo> findByApplicantId(String applicantId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class NcpMailHelper {
@SneakyThrows
public void sendMail(String title, String body, String recipientAddress) {
String timeStamp = String.valueOf(Instant.now().toEpochMilli());
String signature = makeSignature(ncpProperties.getAccessKey(), ncpProperties.getSecretKey(), ncpProperties.getSendUrl(), timeStamp);
String signature = makeSignature(ncpProperties.getAccessKey(), ncpProperties.getSecretKey(), "/api/v1/mails", timeStamp);
ncpClient.sendMail(ncpProperties.getAccessKey(), timeStamp, signature, createSendRawEmailDto(title, body, recipientAddress));
}
public String makeSignature(
Expand Down Expand Up @@ -66,7 +66,6 @@ public String makeSignature(
}
return result;
}

public SendRawEmailDto createSendRawEmailDto(String title, String body, String recipientAddress) {
return SendRawEmailDto.builder()
.senderAddress(ncpProperties.getSenderAddress())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class RecruitStatic {
public static final String INTERVIEWER_SUCCESS_SIGNUP_MESSAGE = "성공적으로 면접관이 등록됐습니다";
public static final String PASSWORD_SUCCESS_CHANGE_MESSAGE = "성공적으로 비밀번호가 변경됐습니다";
public static final String COLUMN_SUCCESS_LOCATION_CHANGE_MESSAGE = "성공적으로 Column의 위치가 변경되었습니다.";
public static final String COMMENT_SUCCESS_UPDATE_MESSAGE = "성공적으로 댓글이 수정됐습니다";
public static final List<String> TIMETABLE_APPLICANT_FIELD = List.of("field", "name");

public static final String[] SwaggerPatterns = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package com.econovation.recruitinfrastructure.ncp;

import com.econovation.recruitinfrastructure.ses.SendRawEmailDto;
import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(name = "NcpClient", url = "${ncp.mail-url}", configuration = NcpConfig.class)
@FeignClient(name = "NcpClient", url = "https://mail.apigw.gov-ntruss.com", configuration = NcpConfig.class)
@Headers("Content-Type: application/json; charset=UTF-8")
public interface NcpClient {
@PostMapping(
path = "/mails",
path = "/api/v1/mails",
consumes = "application/json; charset=UTF-8")
ResponseEntity<Response> sendMail(
@RequestHeader("x-ncp-iam-access-key") String accessKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aws:
ncp:
access-key: ${NCP_ACCESS_KEY}
secret-key: ${NCP_SECRET_KEY}
mail-url: ${NCP_MAIL_URL:https://mail.apigw.gov-ntruss.com/api/v1}
mail-url: ${NCP_MAIL_URL:https://mail.apigw.gov-ntruss.com}
sender-address: ${NCP_SENDER_ADDRESS:}

spring:
Expand Down

0 comments on commit 8afcfc8

Please sign in to comment.