Skip to content

Commit

Permalink
Merge pull request #37 from dnd-side-project/feat/#32
Browse files Browse the repository at this point in the history
#32 회원 탈퇴 api
  • Loading branch information
min-0 authored Sep 5, 2024
2 parents 5c364fd + 081e261 commit 1cbc7be
Show file tree
Hide file tree
Showing 13 changed files with 452 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.dnd.dndtravel.auth.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;


/**
* QRefreshToken is a Querydsl query type for RefreshToken
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QRefreshToken extends EntityPathBase<RefreshToken> {

private static final long serialVersionUID = 1653736957L;

public static final QRefreshToken refreshToken1 = new QRefreshToken("refreshToken1");

public final DateTimePath<java.time.LocalDateTime> expiredTime = createDateTime("expiredTime", java.time.LocalDateTime.class);

public final NumberPath<Long> id = createNumber("id", Long.class);

public final NumberPath<Long> memberId = createNumber("memberId", Long.class);

public final StringPath refreshToken = createString("refreshToken");

public QRefreshToken(String variable) {
super(RefreshToken.class, forVariable(variable));
}

public QRefreshToken(Path<? extends RefreshToken> path) {
super(path.getType(), path.getMetadata());
}

public QRefreshToken(PathMetadata metadata) {
super(RefreshToken.class, metadata);
}

}

53 changes: 53 additions & 0 deletions src/main/generated/com/dnd/dndtravel/map/domain/QAttraction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.dnd.dndtravel.map.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QAttraction is a Querydsl query type for Attraction
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QAttraction extends EntityPathBase<Attraction> {

private static final long serialVersionUID = 7154276L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QAttraction attraction = new QAttraction("attraction");

public final NumberPath<Long> id = createNumber("id", Long.class);

public final StringPath name = createString("name");

public final QRegion region;

public QAttraction(String variable) {
this(Attraction.class, forVariable(variable), INITS);
}

public QAttraction(Path<? extends Attraction> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QAttraction(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QAttraction(PathMetadata metadata, PathInits inits) {
this(Attraction.class, metadata, inits);
}

public QAttraction(Class<? extends Attraction> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.region = inits.isInitialized("region") ? new QRegion(forProperty("region")) : null;
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.dnd.dndtravel.map.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QMemberAttraction is a Querydsl query type for MemberAttraction
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QMemberAttraction extends EntityPathBase<MemberAttraction> {

private static final long serialVersionUID = -155605282L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QMemberAttraction memberAttraction = new QMemberAttraction("memberAttraction");

public final QAttraction attraction;

public final NumberPath<Long> id = createNumber("id", Long.class);

public final DatePath<java.time.LocalDate> localDate = createDate("localDate", java.time.LocalDate.class);

public final com.dnd.dndtravel.member.domain.QMember member;

public final StringPath memo = createString("memo");

public final StringPath region = createString("region");

public QMemberAttraction(String variable) {
this(MemberAttraction.class, forVariable(variable), INITS);
}

public QMemberAttraction(Path<? extends MemberAttraction> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QMemberAttraction(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QMemberAttraction(PathMetadata metadata, PathInits inits) {
this(MemberAttraction.class, metadata, inits);
}

public QMemberAttraction(Class<? extends MemberAttraction> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.attraction = inits.isInitialized("attraction") ? new QAttraction(forProperty("attraction"), inits.get("attraction")) : null;
this.member = inits.isInitialized("member") ? new com.dnd.dndtravel.member.domain.QMember(forProperty("member")) : null;
}

}

56 changes: 56 additions & 0 deletions src/main/generated/com/dnd/dndtravel/map/domain/QMemberRegion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.dnd.dndtravel.map.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QMemberRegion is a Querydsl query type for MemberRegion
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QMemberRegion extends EntityPathBase<MemberRegion> {

private static final long serialVersionUID = -919485973L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QMemberRegion memberRegion = new QMemberRegion("memberRegion");

public final NumberPath<Long> id = createNumber("id", Long.class);

public final com.dnd.dndtravel.member.domain.QMember member;

public final QRegion region;

public final NumberPath<Integer> visitCount = createNumber("visitCount", Integer.class);

public QMemberRegion(String variable) {
this(MemberRegion.class, forVariable(variable), INITS);
}

public QMemberRegion(Path<? extends MemberRegion> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QMemberRegion(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QMemberRegion(PathMetadata metadata, PathInits inits) {
this(MemberRegion.class, metadata, inits);
}

public QMemberRegion(Class<? extends MemberRegion> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.member = inits.isInitialized("member") ? new com.dnd.dndtravel.member.domain.QMember(forProperty("member")) : null;
this.region = inits.isInitialized("region") ? new QRegion(forProperty("region")) : null;
}

}

53 changes: 53 additions & 0 deletions src/main/generated/com/dnd/dndtravel/map/domain/QPhoto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.dnd.dndtravel.map.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QPhoto is a Querydsl query type for Photo
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QPhoto extends EntityPathBase<Photo> {

private static final long serialVersionUID = 440715541L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QPhoto photo = new QPhoto("photo");

public final NumberPath<Long> id = createNumber("id", Long.class);

public final QMemberAttraction memberAttraction;

public final StringPath url = createString("url");

public QPhoto(String variable) {
this(Photo.class, forVariable(variable), INITS);
}

public QPhoto(Path<? extends Photo> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QPhoto(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QPhoto(PathMetadata metadata, PathInits inits) {
this(Photo.class, metadata, inits);
}

public QPhoto(Class<? extends Photo> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.memberAttraction = inits.isInitialized("memberAttraction") ? new QMemberAttraction(forProperty("memberAttraction"), inits.get("memberAttraction")) : null;
}

}

39 changes: 39 additions & 0 deletions src/main/generated/com/dnd/dndtravel/map/domain/QRegion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.dnd.dndtravel.map.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;


/**
* QRegion is a Querydsl query type for Region
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QRegion extends EntityPathBase<Region> {

private static final long serialVersionUID = 831518833L;

public static final QRegion region = new QRegion("region");

public final NumberPath<Long> id = createNumber("id", Long.class);

public final StringPath name = createString("name");

public QRegion(String variable) {
super(Region.class, forVariable(variable));
}

public QRegion(Path<? extends Region> path) {
super(path.getType(), path.getMetadata());
}

public QRegion(PathMetadata metadata) {
super(Region.class, metadata);
}

}

43 changes: 43 additions & 0 deletions src/main/generated/com/dnd/dndtravel/member/domain/QMember.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.dnd.dndtravel.member.domain;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;


/**
* QMember is a Querydsl query type for Member
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QMember extends EntityPathBase<Member> {

private static final long serialVersionUID = 1458466475L;

public static final QMember member = new QMember("member1");

public final StringPath email = createString("email");

public final NumberPath<Long> id = createNumber("id", Long.class);

public final StringPath name = createString("name");

public final EnumPath<SelectedColor> selectedColor = createEnum("selectedColor", SelectedColor.class);

public QMember(String variable) {
super(Member.class, forVariable(variable));
}

public QMember(Path<? extends Member> path) {
super(path.getType(), path.getMetadata());
}

public QMember(PathMetadata metadata) {
super(Member.class, metadata);
}

}

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.dnd.dndtravel.auth.controller;

import com.dnd.dndtravel.auth.controller.request.AppleWithdrawRequest;
import com.dnd.dndtravel.auth.controller.request.ReIssueTokenRequest;
import com.dnd.dndtravel.auth.controller.swagger.AuthControllerSwagger;
import com.dnd.dndtravel.auth.service.dto.response.AppleIdTokenPayload;
Expand All @@ -8,15 +9,15 @@
import com.dnd.dndtravel.auth.controller.request.AppleLoginRequest;
import com.dnd.dndtravel.auth.service.dto.response.TokenResponse;
import com.dnd.dndtravel.auth.service.dto.response.ReissueTokenResponse;
import com.dnd.dndtravel.config.AuthenticationMember;
import com.dnd.dndtravel.member.domain.Member;
import com.dnd.dndtravel.member.service.MemberService;

import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;

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.RestController;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@RestController
Expand Down Expand Up @@ -48,4 +49,16 @@ public ResponseEntity<TokenResponse> appleOAuthLogin(@RequestBody AppleLoginRequ
public ReissueTokenResponse reissueToken(@RequestBody ReIssueTokenRequest reissueTokenRequest) {
return jwtTokenService.reIssue(reissueTokenRequest.refreshToken());
}

@DeleteMapping("/withdraw")
public void withdraw(@Valid @RequestBody AppleWithdrawRequest withdrawRequest, AuthenticationMember authenticationMember) {
// 1. Apple 서버에서 Access Token 받아오기
String accessToken = appleOAuthService.getAccessToken(withdrawRequest.authorizationCode());

// 2. Apple 서버에 탈퇴 요청
appleOAuthService.revoke(accessToken);

// 3. 자체 회원 탈퇴 진행
memberService.withdrawMember(authenticationMember.id());
}
}
Loading

0 comments on commit 1cbc7be

Please sign in to comment.