-
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.
- Loading branch information
1 parent
d80850e
commit 49d9286
Showing
30 changed files
with
178 additions
and
38 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
47 changes: 47 additions & 0 deletions
47
src/main/java/com/gt/genti/adapter/in/web/PictureGenerateRequestPersistenceAdapter.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,47 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import com.gt.genti.domain.PictureGenerateRequest; | ||
import com.gt.genti.domain.User; | ||
import com.gt.genti.repository.PictureGenerateRequestRepository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class PictureGenerateRequestPersistenceAdapter implements PictureGenerateRequestPort { | ||
private final PictureGenerateRequestRepository pictureGenerateRequestRepository; | ||
|
||
@Override | ||
public List<PictureGenerateRequest> findByRequestStatusIsActiveAndUserId_JPQL(Long userId) { | ||
return pictureGenerateRequestRepository.findByRequestStatusIsActiveAndUserId_JPQL(userId); | ||
} | ||
|
||
@Override | ||
public List<PictureGenerateRequest> findAllByRequester(User requester) { | ||
return pictureGenerateRequestRepository.findAllByRequester(requester); | ||
} | ||
|
||
@Override | ||
public Optional<PictureGenerateRequest> findByCreatorAndRequestStatusIsBeforeWorkOrderByCreatedAtAsc(Long userId) { | ||
return pictureGenerateRequestRepository.findByCreatorAndRequestStatusIsBeforeWorkOrderByCreatedAtAsc(userId); | ||
} | ||
|
||
@Override | ||
public List<PictureGenerateRequest> findPendingRequests() { | ||
return pictureGenerateRequestRepository.findPendingRequests(); | ||
} | ||
@Override | ||
public Optional<PictureGenerateRequest> findById(Long id){ | ||
return pictureGenerateRequestRepository.findById(id); | ||
} | ||
|
||
@Override | ||
public PictureGenerateRequest save(PictureGenerateRequest pictureGenerateRequest){ | ||
return pictureGenerateRequestRepository.save(pictureGenerateRequest); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/gt/genti/adapter/in/web/PictureGenerateRequestPort.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,24 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.springframework.data.repository.query.Param; | ||
|
||
import com.gt.genti.domain.PictureGenerateRequest; | ||
import com.gt.genti.domain.User; | ||
|
||
public interface PictureGenerateRequestPort { | ||
|
||
List<PictureGenerateRequest> findByRequestStatusIsActiveAndUserId_JPQL(Long userId); | ||
|
||
List<PictureGenerateRequest> findAllByRequester(User requester); | ||
|
||
Optional<PictureGenerateRequest> findByCreatorAndRequestStatusIsBeforeWorkOrderByCreatedAtAsc(Long userId); | ||
|
||
List<PictureGenerateRequest> findPendingRequests(); | ||
|
||
Optional<PictureGenerateRequest> findById(Long id); | ||
|
||
PictureGenerateRequest save(PictureGenerateRequest pictureGenerateRequest); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/gt/genti/adapter/in/web/PictureGenerateRequestUseCase.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,25 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import java.util.List; | ||
|
||
import com.gt.genti.domain.User; | ||
import com.gt.genti.dto.PictureGenerateRequestDetailResponseDto; | ||
import com.gt.genti.dto.PictureGenerateRequestModifyDto; | ||
import com.gt.genti.dto.PictureGenerateRequestRequestDto; | ||
import com.gt.genti.dto.PictureGenerateRequestResponseDto; | ||
import com.gt.genti.dto.PictureGenerateRequestSimplifiedResponseDto; | ||
|
||
public interface PictureGenerateRequestUseCase { | ||
public List<PictureGenerateRequestDetailResponseDto> getMyActivePictureGenerateRequest(Long userId); | ||
|
||
public PictureGenerateRequestDetailResponseDto getPictureGenerateRequestById(Long id); | ||
|
||
public List<PictureGenerateRequestSimplifiedResponseDto> getAllMyPictureGenerateRequests(User requester); | ||
|
||
public PictureGenerateRequestResponseDto createPictureGenerateRequest(Long requesterId, | ||
PictureGenerateRequestRequestDto pictureGenerateRequestRequestDto); | ||
|
||
public Boolean modifyPictureGenerateRequest(Long userId, | ||
PictureGenerateRequestModifyDto pictureGenerateRequestModifyDto); | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/gt/genti/adapter/in/web/PosePicturePersistenceAdapter.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,26 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import java.util.Optional; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import com.gt.genti.domain.PosePicture; | ||
import com.gt.genti.repository.PosePictureRepository; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class PosePicturePersistenceAdapter implements PosePicturePort { | ||
private final PosePictureRepository posePictureRepository; | ||
|
||
@Override | ||
public Optional<PosePicture> findByUrl(String url) { | ||
return posePictureRepository.findByUrl(url); | ||
} | ||
|
||
@Override | ||
public PosePicture save(PosePicture posePicture) { | ||
return posePictureRepository.save(posePicture); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/gt/genti/adapter/in/web/PosePicturePort.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,11 @@ | ||
package com.gt.genti.adapter.in.web; | ||
|
||
import java.util.Optional; | ||
|
||
import com.gt.genti.domain.PosePicture; | ||
|
||
public interface PosePicturePort { | ||
|
||
Optional<PosePicture> findByUrl(String url); | ||
PosePicture save(PosePicture posePicture); | ||
} |
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...nti/domain_old/common/BaseTimeEntity.java → ...t/genti/domain/common/BaseTimeEntity.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,4 +1,4 @@ | ||
package com.gt.genti.domain_old.common; | ||
package com.gt.genti.domain.common; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
|
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions
20
src/main/java/com/gt/genti/dto/PictureGenerateRequestSimplifiedResponseDto.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,10 +1,10 @@ | ||
// package com.gt.genti.dto; | ||
// | ||
// import com.gt.genti.domain.enums.RequestStatus; | ||
// | ||
// public class PictureGenerateRequestSimplifiedResponseDto { | ||
// Long id; | ||
// String prompt; | ||
// String url; | ||
// RequestStatus requestStatus; | ||
// } | ||
package com.gt.genti.dto; | ||
|
||
import com.gt.genti.domain.enums.RequestStatus; | ||
|
||
public class PictureGenerateRequestSimplifiedResponseDto { | ||
Long id; | ||
String prompt; | ||
String url; | ||
RequestStatus requestStatus; | ||
} |