Skip to content

Commit

Permalink
Merge branch 'main' into bug/784-delete-img-url
Browse files Browse the repository at this point in the history
  • Loading branch information
jschoi-96 authored Dec 5, 2024
2 parents eaec052 + 790ec2e commit 5a5a3f6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2Authentic

String email = getEmail(oauth2Response);
String provider = getProvider(oauth2Response);
Member findMember = memberRepository.findByEmail(email).orElse(null);
Member findMember = memberRepository.findByEmail(provider + "_" + email).orElse(null);

if (findMember == null) {
String encodedPassword = passwordEncoder().encode(oauth2Password);
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/balancetalk/talkpick/dto/TalkPickDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
import balancetalk.comment.domain.Comment;
import balancetalk.member.domain.Member;
import balancetalk.talkpick.domain.TalkPick;
import balancetalk.talkpick.dto.fields.BaseTalkPickFields;
import balancetalk.talkpick.dto.fields.ValidatedNotBlankTalkPickFields;
import balancetalk.vote.domain.TalkPickVote;
import balancetalk.vote.domain.VoteOption;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.querydsl.core.annotations.QueryProjection;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;
import java.time.LocalDateTime;
Expand All @@ -29,7 +32,8 @@ public class TalkPickDto {
@AllArgsConstructor
public static class CreateTalkPickRequest {

private BaseTalkPickFields baseFields;
@Valid
private ValidatedNotBlankTalkPickFields baseFields;

@Schema(description = "첨부한 이미지 파일 ID 목록", example = "[12, 41]")
@Size(max = 10, message = "톡픽 생성 시 업로드할 수 있는 파일 개수는 최대 10개입니다.")
Expand Down Expand Up @@ -60,7 +64,8 @@ public boolean containsFileIds() {
@AllArgsConstructor
public static class UpdateTalkPickRequest {

private BaseTalkPickFields baseFields;
@Valid
private ValidatedNotBlankTalkPickFields baseFields;

@Schema(description = "새로 첨부한 이미지 파일 ID 목록", example = "[12, 41]")
@Size(max = 10, message = "톡픽 생성 시 업로드할 수 있는 파일 개수는 최대 10개입니다.")
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/balancetalk/talkpick/dto/TempTalkPickDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import balancetalk.member.domain.Member;
import balancetalk.talkpick.domain.TempTalkPick;
import balancetalk.talkpick.dto.fields.BaseTalkPickFields;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.List;
Expand All @@ -18,7 +20,8 @@ public class TempTalkPickDto {
@AllArgsConstructor
public static class SaveTempTalkPickRequest {

private BaseTempTalkPickFields baseFields;
@Valid
private BaseTalkPickFields baseFields;

@Schema(description = "새로 첨부한 이미지 파일 ID 목록", example = "[12, 41]")
@Size(max = 10, message = "톡픽 생성 시 업로드할 수 있는 파일 개수는 최대 10개입니다.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package balancetalk.talkpick.dto;
package balancetalk.talkpick.dto.fields;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
Expand All @@ -16,6 +16,7 @@ public class BaseTalkPickFields {
private String title;

@Schema(description = "본문 내용", example = "본문 내용")
@Size(max = 2000, message = "본문은 2,000자 이하여야 합니다.")
private String content;

@Schema(description = "선택지 A 이름", example = "선택지 A 이름")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package balancetalk.talkpick.dto;
package balancetalk.talkpick.dto.fields;

import jakarta.validation.constraints.NotBlank;

public class BaseTempTalkPickFields extends BaseTalkPickFields {
public class ValidatedNotBlankTalkPickFields extends BaseTalkPickFields {

public BaseTempTalkPickFields(String title, String content, String optionA, String optionB, String sourceUrl) {
public ValidatedNotBlankTalkPickFields(String title, String content,
String optionA, String optionB, String sourceUrl) {
super(title, content, optionA, optionB, sourceUrl);
}

Expand Down

0 comments on commit 5a5a3f6

Please sign in to comment.