-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from LIKELION-TEAM4-HACKATHON/feature/user-info
나의 정보 수정 기능
- Loading branch information
Showing
5 changed files
with
129 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/likelion/MZConnent/dto/member/request/UpdateMemberInfoRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package likelion.MZConnent.dto.member.request; | ||
|
||
import likelion.MZConnent.domain.member.Age; | ||
import likelion.MZConnent.domain.member.Gender; | ||
import lombok.*; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@ToString | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class UpdateMemberInfoRequest { | ||
private String username; | ||
private List<Long> selfIntroductions; | ||
private String instagramId; | ||
private String facebookId; | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/likelion/MZConnent/dto/member/response/UpdateMemberInfoResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package likelion.MZConnent.dto.member.response; | ||
|
||
import likelion.MZConnent.domain.member.Member; | ||
import likelion.MZConnent.dto.culture.CultureCategoryDto; | ||
import lombok.*; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@ToString | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class UpdateMemberInfoResponse { | ||
private Long memberId; | ||
private String username; | ||
private String instagramId; | ||
private String facebookId; | ||
private List<CultureCategoryDto> selfIntroductions; | ||
|
||
@Builder | ||
public UpdateMemberInfoResponse(Member member) { | ||
this.memberId = member.getId(); | ||
this.username = member.getUsername(); | ||
this.selfIntroductions = member.getSelfIntroductions().stream() | ||
.map(selfIntroduction->new CultureCategoryDto(selfIntroduction.getCultureCategory())) | ||
.collect(Collectors.toList()); | ||
this.instagramId = member.getInstagramId(); | ||
this.facebookId = member.getFacebookId(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/likelion/MZConnent/repository/member/SelfIntroductionRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
package likelion.MZConnent.repository.member; | ||
|
||
import io.lettuce.core.dynamic.annotation.Param; | ||
import jakarta.transaction.Transactional; | ||
import likelion.MZConnent.domain.member.SelfIntroduction; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface SelfIntroductionRepository extends JpaRepository<SelfIntroduction, Long> { | ||
@Modifying | ||
@Transactional | ||
@Query("DELETE FROM SelfIntroduction si WHERE si.member.email = :email") | ||
void deleteByMemberEmail(@Param("email") String email); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters