-
Notifications
You must be signed in to change notification settings - Fork 0
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 #413 from TEAM-LIAISON/revert-411-feat/local_dev_v2
Revert "[remove] : Remove Attach"
- Loading branch information
Showing
22 changed files
with
1,156 additions
and
26 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
src/main/generated/liaison/linkit/profile/domain/attach/QAttachUrl.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,55 @@ | ||
package liaison.linkit.profile.domain.attach; | ||
|
||
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; | ||
|
||
|
||
/** | ||
* QAttachUrl is a Querydsl query type for AttachUrl | ||
*/ | ||
@Generated("com.querydsl.codegen.DefaultEntitySerializer") | ||
public class QAttachUrl extends EntityPathBase<AttachUrl> { | ||
|
||
private static final long serialVersionUID = 1845519294L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QAttachUrl attachUrl = new QAttachUrl("attachUrl"); | ||
|
||
public final StringPath attachUrlName = createString("attachUrlName"); | ||
|
||
public final StringPath attachUrlPath = createString("attachUrlPath"); | ||
|
||
public final NumberPath<Long> id = createNumber("id", Long.class); | ||
|
||
public final liaison.linkit.profile.domain.QProfile profile; | ||
|
||
public QAttachUrl(String variable) { | ||
this(AttachUrl.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QAttachUrl(Path<? extends AttachUrl> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QAttachUrl(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QAttachUrl(PathMetadata metadata, PathInits inits) { | ||
this(AttachUrl.class, metadata, inits); | ||
} | ||
|
||
public QAttachUrl(Class<? extends AttachUrl> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.profile = inits.isInitialized("profile") ? new liaison.linkit.profile.domain.QProfile(forProperty("profile"), inits.get("profile")) : null; | ||
} | ||
|
||
} | ||
|
53 changes: 53 additions & 0 deletions
53
src/main/generated/liaison/linkit/team/domain/miniprofile/QTeamKeyword.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,53 @@ | ||
package liaison.linkit.team.domain.miniprofile; | ||
|
||
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; | ||
|
||
|
||
/** | ||
* QTeamKeyword is a Querydsl query type for TeamKeyword | ||
*/ | ||
@Generated("com.querydsl.codegen.DefaultEntitySerializer") | ||
public class QTeamKeyword extends EntityPathBase<TeamKeyword> { | ||
|
||
private static final long serialVersionUID = -1972105873L; | ||
|
||
private static final PathInits INITS = PathInits.DIRECT2; | ||
|
||
public static final QTeamKeyword teamKeyword = new QTeamKeyword("teamKeyword"); | ||
|
||
public final NumberPath<Long> id = createNumber("id", Long.class); | ||
|
||
public final liaison.linkit.team.domain.QTeam team; | ||
|
||
public final StringPath teamKeywordNames = createString("teamKeywordNames"); | ||
|
||
public QTeamKeyword(String variable) { | ||
this(TeamKeyword.class, forVariable(variable), INITS); | ||
} | ||
|
||
public QTeamKeyword(Path<? extends TeamKeyword> path) { | ||
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); | ||
} | ||
|
||
public QTeamKeyword(PathMetadata metadata) { | ||
this(metadata, PathInits.getFor(metadata, INITS)); | ||
} | ||
|
||
public QTeamKeyword(PathMetadata metadata, PathInits inits) { | ||
this(TeamKeyword.class, metadata, inits); | ||
} | ||
|
||
public QTeamKeyword(Class<? extends TeamKeyword> type, PathMetadata metadata, PathInits inits) { | ||
super(type, metadata, inits); | ||
this.team = inits.isInitialized("team") ? new liaison.linkit.team.domain.QTeam(forProperty("team"), inits.get("team")) : null; | ||
} | ||
|
||
} | ||
|
52 changes: 52 additions & 0 deletions
52
src/main/java/liaison/linkit/profile/domain/attach/AttachFile.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,52 @@ | ||
//package liaison.linkit.profile.domain.attach; | ||
// | ||
//import jakarta.persistence.*; | ||
//import liaison.linkit.profile.domain.Profile; | ||
//import liaison.linkit.profile.dto.request.attach.AttachFileUpdateRequest; | ||
//import lombok.AccessLevel; | ||
//import lombok.AllArgsConstructor; | ||
//import lombok.Getter; | ||
//import lombok.NoArgsConstructor; | ||
// | ||
//import static jakarta.persistence.CascadeType.ALL; | ||
//import static jakarta.persistence.FetchType.LAZY; | ||
// | ||
//@Entity | ||
//@Getter | ||
//@AllArgsConstructor | ||
//@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
//@Table(name = "attach_file") | ||
//public class AttachFile { | ||
// | ||
// @Id | ||
// @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
// @Column(name = "attach_file_id") | ||
// private Long id; | ||
// | ||
// @ManyToOne(fetch = LAZY, cascade = ALL) | ||
// @JoinColumn(name = "profile_id") | ||
// private Profile profile; | ||
// | ||
// @Column(nullable = false) | ||
// private String attachFileName; | ||
// | ||
// @Column(nullable = false) | ||
// private String attachFilePath; | ||
// | ||
// public static AttachFile of( | ||
// final Profile profile, | ||
// final String attachFileName, | ||
// final String attachFilePath | ||
// ) { | ||
// return new AttachFile( | ||
// null, | ||
// profile, | ||
// attachFileName, | ||
// attachFilePath | ||
// ); | ||
// } | ||
// | ||
// public void update(final AttachFileUpdateRequest updateRequest) { | ||
// this.attachFilePath = updateRequest.getAttachFilePath(); | ||
// } | ||
//} |
54 changes: 54 additions & 0 deletions
54
src/main/java/liaison/linkit/profile/domain/attach/AttachUrl.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,54 @@ | ||
package liaison.linkit.profile.domain.attach; | ||
|
||
import jakarta.persistence.*; | ||
import liaison.linkit.profile.domain.Profile; | ||
import liaison.linkit.profile.dto.request.attach.AttachUrlUpdateRequest; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import static jakarta.persistence.FetchType.LAZY; | ||
import static jakarta.persistence.GenerationType.IDENTITY; | ||
|
||
@Entity | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Table(name = "attach_url") | ||
public class AttachUrl { | ||
|
||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
@Column(name = "attach_url_id") | ||
private Long id; | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@JoinColumn(name = "profile_id") | ||
private Profile profile; | ||
|
||
// 웹 링크 이름 | ||
@Column(nullable = false) | ||
private String attachUrlName; | ||
|
||
@Column(nullable = false) | ||
private String attachUrlPath; | ||
|
||
public static AttachUrl of( | ||
final Profile profile, | ||
final String attachUrlName, | ||
final String attachUrlPath | ||
) { | ||
return new AttachUrl( | ||
null, | ||
profile, | ||
attachUrlName, | ||
attachUrlPath | ||
); | ||
} | ||
|
||
public void update(final AttachUrlUpdateRequest updateRequest) { | ||
this.attachUrlName = updateRequest.getAttachUrlName(); | ||
this.attachUrlPath = updateRequest.getAttachUrlPath(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/liaison/linkit/profile/domain/repository/attach/AttachFileRepository.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,17 @@ | ||
//package liaison.linkit.profile.domain.repository.attach; | ||
// | ||
//import liaison.linkit.profile.domain.attach.AttachFile; | ||
//import org.springframework.data.jpa.repository.JpaRepository; | ||
//import org.springframework.data.jpa.repository.Query; | ||
//import org.springframework.data.repository.query.Param; | ||
// | ||
//import java.util.List; | ||
// | ||
//public interface AttachFileRepository extends JpaRepository<AttachFile, Long> { | ||
// boolean existsByProfileId(final Long profileId); | ||
// | ||
// AttachFile findByProfileId(@Param("profileId") final Long profileId); | ||
// | ||
// @Query("SELECT attachFile FROM AttachFile attachFile WHERE attachFile.profile.id = :profileId") | ||
// List<AttachFile> findAllByProfileId(@Param("profileId") Long profileId); | ||
//} |
8 changes: 8 additions & 0 deletions
8
src/main/java/liaison/linkit/profile/domain/repository/attach/AttachUrlRepository.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,8 @@ | ||
package liaison.linkit.profile.domain.repository.attach; | ||
|
||
import liaison.linkit.profile.domain.attach.AttachUrl; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface AttachUrlRepository extends JpaRepository<AttachUrl, Long>, AttachUrlRepositoryCustom{ | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/liaison/linkit/profile/domain/repository/attach/AttachUrlRepositoryCustom.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,13 @@ | ||
package liaison.linkit.profile.domain.repository.attach; | ||
|
||
import liaison.linkit.profile.domain.attach.AttachUrl; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface AttachUrlRepositoryCustom { | ||
Optional<AttachUrl> findByProfileId(final Long profileId); | ||
boolean existsByProfileId(final Long profileId); | ||
List<AttachUrl> findAllByProfileId(final Long profileId); | ||
void deleteAllByProfileId(final Long profileId); | ||
} |
61 changes: 61 additions & 0 deletions
61
...n/java/liaison/linkit/profile/domain/repository/attach/AttachUrlRepositoryCustomImpl.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,61 @@ | ||
package liaison.linkit.profile.domain.repository.attach; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import liaison.linkit.profile.domain.attach.AttachUrl; | ||
import liaison.linkit.profile.domain.attach.QAttachUrl; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class AttachUrlRepositoryCustomImpl implements AttachUrlRepositoryCustom { | ||
|
||
private final JPAQueryFactory jpaQueryFactory; | ||
|
||
@Override | ||
public Optional<AttachUrl> findByProfileId(Long profileId) { | ||
QAttachUrl attachUrl = QAttachUrl.attachUrl; | ||
|
||
AttachUrl result = jpaQueryFactory | ||
.selectFrom(attachUrl) | ||
.where(attachUrl.profile.id.eq(profileId)) | ||
.fetchOne(); | ||
|
||
return Optional.ofNullable(result); | ||
} | ||
|
||
@Override | ||
public boolean existsByProfileId(final Long profileId) { | ||
QAttachUrl attachUrl = QAttachUrl.attachUrl; | ||
|
||
long count = jpaQueryFactory | ||
.selectFrom(attachUrl) | ||
.where(attachUrl.profile.id.eq(profileId)) | ||
.fetchCount(); // 레코드의 수를 반환 | ||
|
||
return count > 0; // 0보다 크면 true, 그렇지 않으면 false | ||
} | ||
|
||
@Override | ||
public List<AttachUrl> findAllByProfileId(final Long profileId){ | ||
QAttachUrl attachUrl = QAttachUrl.attachUrl; | ||
return jpaQueryFactory.selectFrom(attachUrl) | ||
.where(attachUrl.profile.id.eq(profileId)) | ||
.fetch(); | ||
} | ||
|
||
|
||
@Override | ||
@Transactional | ||
public void deleteAllByProfileId(final Long profileId){ | ||
log.info("Deleting all AttachUrls for profileId: {}", profileId); | ||
QAttachUrl attachUrl = QAttachUrl.attachUrl; | ||
jpaQueryFactory.delete(attachUrl) | ||
.where(attachUrl.profile.id.eq(profileId)) | ||
.execute(); | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/java/liaison/linkit/profile/dto/response/attach/AttachFileResponse.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,23 @@ | ||
//package liaison.linkit.profile.dto.response.attach; | ||
// | ||
//import liaison.linkit.profile.domain.attach.AttachFile; | ||
//import lombok.AllArgsConstructor; | ||
//import lombok.Getter; | ||
// | ||
//@Getter | ||
//@AllArgsConstructor | ||
//public class AttachFileResponse { | ||
// private Long id; | ||
// private String attachFileName; | ||
// private String attachFilePath; | ||
// | ||
// public static AttachFileResponse personalAttachFile( | ||
// final AttachFile attachFile | ||
// ) { | ||
// return new AttachFileResponse( | ||
// attachFile.getId(), | ||
// attachFile.getAttachFileName(), | ||
// attachFile.getAttachFilePath() | ||
// ); | ||
// } | ||
//} |
Oops, something went wrong.