Skip to content

Commit

Permalink
[feat] : Columns Response rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackBean99 committed Sep 3, 2023
1 parent ee78322 commit cac3e1a
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public Comment findById(Long commentId) {

@Override
@RedissonLock(LockName = "댓글좋아요", identifier = "commentId")
@Transactional
public void createCommentLike(Long commentId) {
// 기존에 눌렀으면 취소 처리
Long idpId = SecurityUtils.getCurrentUserId();
Expand Down Expand Up @@ -114,6 +115,7 @@ private void createCommentLike(Comment comment, Long idpId) {

@Override
@RedissonLock(LockName = "댓글좋아요", identifier = "commentId")
@Transactional
public void deleteCommentLike(Long commentId) {
// 현재 내가 눌렀던 댓글만 삭제할 수 있다.
Long idpId = SecurityUtils.getCurrentUserId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public class NcpMailHelper {
static String newLine = "\n"; // new line


@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);
SendRawEmailDto sendRawEmailDto = createSendRawEmailDto(title, body, recipientAddress);
ncpClient.sendMail(ncpProperties.getAccessKey(), timeStamp, signature, sendRawEmailDto);
ncpClient.sendMail(ncpProperties.getAccessKey(), timeStamp, signature, createSendRawEmailDto(title, body, recipientAddress));
}
public String makeSignature(
String accessKey, String secretKey, String url, String timeStamp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
public class ColumnsResponseDto {
private Integer columnsId;
private String title;
private Integer nextColumnsId;
private Integer navigationId;

public static ColumnsResponseDto from(Columns columns) {
return new ColumnsResponseDto(
columns.getId(), columns.getTitle(), columns.getNavigationId());
columns.getId(), columns.getTitle(), columns.getNextColumnsId(), columns.getNavigationId());
}

public static List<ColumnsResponseDto> from(List<Columns> columns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public void plusLikeCount() {
this.likeCount++;
}

public void minusLikeCount() {
this.likeCount++;
}
public void minusLikeCount() { this.likeCount--;}

public boolean isHost(Long idpId) {
return this.idpId.equals(idpId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.econovation.recruitinfrastructure.ses.SendRawEmailDto;
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;
Expand All @@ -11,10 +12,9 @@ public interface NcpClient {
@PostMapping(
path = "/mails",
consumes = "application/json; charset=UTF-8")
public void sendMail(
@RequestHeader("x-ncp-iam-access-key") String accessKey,
@RequestHeader("x-ncp-apigw-timestamp") String timestamp,
@RequestHeader("x-ncp-apigw-signature-v2") String signature,
@RequestBody SendRawEmailDto sendRawEmailDto);

}
ResponseEntity<Response> sendMail(
@RequestHeader("x-ncp-iam-access-key") String accessKey,
@RequestHeader("x-ncp-apigw-timestamp") String timestamp,
@RequestHeader("x-ncp-apigw-signature-v2") String signature,
@RequestBody SendRawEmailDto sendRawEmailDto);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.econovation.recruitinfrastructure.ncp;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Builder
public class Response {
private String requestId;
private int count;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.econovation.recruitinfrastructure.ses;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Parameters {
private String customer_name;
private String BEFORE_GRADE;
private String AFTER_GRADE;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.econovation.recruitinfrastructure.ses;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Getter
@Builder
public class RecipientForRequest {
private String address;
private String name;
private String type = "R";
private Object parameters;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
private Parameters parameters; // 매개변수 모델 추가
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
@Getter
@Builder
public class SendRawEmailDto {
// Replace [email protected] with your "From" address.
// This address must be verified with Amazon SES.
private String senderAddress = "에코노베이션 Recruit팀 <[email protected]>";
private String senderAddress;
private String title;
private String body;
private List<RecipientForRequest> recipients;
}
}

0 comments on commit cac3e1a

Please sign in to comment.