Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
f683ac9
feat: adds new route to update folder name
MatheusmPigatto Mar 3, 2025
4fb5395
Merge branch 'develop' into feature/change-folder-name
jhonatapers May 4, 2025
377eadc
feat: delete file use case
Artituis May 29, 2025
a6d52de
Merge branch 'develop' into feature/change-folder-name
jhonatapers May 31, 2025
64ac935
test: initial test delete file usecase
Artituis Jun 2, 2025
30781d1
chore: ignore intellij folder
Artituis Jun 2, 2025
354ea5a
Merge branch 'develop' into feature/delete-file
Artituis Jun 2, 2025
1f99ca3
feat: add RabbitMQ configuration to environment files and build.gradle
jhonatapers Jun 6, 2025
ad63ba4
feat: add RabbitMQ configuration and listener interface
jhonatapers Jun 6, 2025
10f210a
feat: add username and nickname fields to Member, MemberJpaEntity, an…
jhonatapers Jun 6, 2025
c925649
feat: implement CreateMemberInput and DefaultCreateMemberUseCase for …
jhonatapers Jun 6, 2025
fe377e4
feat: replace member creation fallback with NotFoundException in Defa…
jhonatapers Jun 6, 2025
2698506
feat: add MemberCreatedListener to handle member creation events via …
jhonatapers Jun 6, 2025
c10c878
feat: add methods to change nickname and username with validation
jhonatapers Jun 6, 2025
677fc4c
refactor: improve quota request validation logic in Member class
jhonatapers Jun 6, 2025
f02758a
feat: implement DefaultUpdateMemberUseCase for updating member details
jhonatapers Jun 6, 2025
b341251
feat: implement update member use case and related event listeners
jhonatapers Jun 6, 2025
453bcbc
feat: implement member synchronization use case and related input han…
jhonatapers Jun 6, 2025
413da09
feat: implement member synchronization with RabbitMQ configuration an…
jhonatapers Jun 7, 2025
82afcc7
refactor: update RabbitMQ configuration to use TopicExchange and impr…
jhonatapers Jun 7, 2025
2ab1511
refactor: replace synchronize method with update in MemberGateway and…
jhonatapers Jun 7, 2025
e404d91
refactor: update RabbitMQ configuration properties to use messaging n…
jhonatapers Jun 7, 2025
ffee549
refactor: update RabbitMQ configuration and remove unused properties
jhonatapers Jun 8, 2025
d164396
refactor: streamline member synchronization logic and update related …
jhonatapers Jun 8, 2025
63c1773
refactor: update Member creation in tests to use new constructor with…
jhonatapers Jun 8, 2025
4513637
chore: update Spring Boot version to 3.4.6 in build.gradle
jhonatapers Jun 8, 2025
fc02dab
-wip
jhonatapers Jun 8, 2025
9c1dcbc
refactor: remove unused changeNickname and changeUsername methods fro…
jhonatapers Jun 8, 2025
3cf2440
refactor: replace System.err logging with Log4j in MemberSyncListener
jhonatapers Jun 8, 2025
8d0c6f7
chore: update .gitignore to include log.json.gz and log.gz patterns
jhonatapers Jun 8, 2025
b93ef67
refactor: adjust RabbitMQ listener retry configuration for improved p…
jhonatapers Jun 8, 2025
9e8f7ab
refactor: update project name and include syntax in settings.gradle
jhonatapers Jun 8, 2025
89cbab1
test: add unit tests for DefaultSynchronizeMemberUseCase
jhonatapers Jun 8, 2025
15379ac
refactor: update ListRequestQuotaUseCase and related classes to use L…
jhonatapers Jun 8, 2025
7d28ecc
feat: Introduce Validatable interface and refactor ValueObject to imp…
jhonatapers Jun 8, 2025
5119358
refactor: remove unnecessary null suppression annotation from Throwab…
jhonatapers Jun 9, 2025
0811e4a
refactor: rename parameter 'anIn' to 'input' in execute method for co…
jhonatapers Jun 9, 2025
c65b0b5
refactor: rename 'id' to 'memberId' in GetQuotaInput for clarity and …
jhonatapers Jun 9, 2025
017a6f9
refactor: update quota-related classes to improve member information …
jhonatapers Jun 9, 2025
5576338
feat: add AlreadyExistsException handling in member creation and sync…
jhonatapers Jun 9, 2025
f11f1d3
Merge pull request #48 from CallVDois/feature/member-sync-rabbitmq
jhonatapers Jun 9, 2025
56f0cc4
test: added second test
Artituis Jun 9, 2025
805efd1
Merge branch 'develop' into feature/delete-file
Artituis Jun 9, 2025
a25fa13
feat: add system access handling to member and file deletion processes
Artituis Jun 9, 2025
7eed8c0
feat: implement file deletion with system access check and add delete…
jhonatapers Jun 9, 2025
e48e6eb
feat: add hasSystemAccess field to Member and update related tests
jhonatapers Jun 9, 2025
80c6232
style: remove unnecessary blank line in DefaultDeleteFileUseCase
jhonatapers Jun 10, 2025
1cc1b04
refactor: rename ownerId to deleterId in DeleteFileInput and update e…
jhonatapers Jun 10, 2025
c6eb384
style: adjust indentation in DeleteFileInput for consistency
jhonatapers Jun 10, 2025
0429b55
test: add unit test for handling NotFoundException when file ID is in…
jhonatapers Jun 10, 2025
973d802
fix: fix NotAllowedException messages for consistency
jhonatapers Jun 10, 2025
bf7af9e
test: add unit test for handling NotAllowedException when member lack…
jhonatapers Jun 10, 2025
d603adf
refactor: rename ownerId to deleterId in DefaultDeleteFileUseCaseTest…
jhonatapers Jun 10, 2025
99625bf
refactor: rename ownerId to deleterId in DefaultDeleteFileUseCaseTest…
jhonatapers Jun 10, 2025
8f186a4
Merge branch 'feature/delete-file' of github.com:CallVDois/drive-api …
jhonatapers Jun 10, 2025
1a54d0c
Merge branch 'develop' into feature/change-folder-name
jhonatapers Jun 10, 2025
a93b27d
refactor: improve folder name validation and update method parameters…
jhonatapers Jun 10, 2025
c86d5d1
feat: add operation for changing folder name with appropriate responses
jhonatapers Jun 10, 2025
2ad7d97
feat: add delete file functionality with API endpoint and use case in…
Artituis Jun 10, 2025
26d0aac
feat: add delete file functionality with API endpoint and use case in…
Artituis Jun 10, 2025
fe2d25e
Merge branch 'feature/delete-file' of https://github.com/CallVDois/dr…
Artituis Jun 10, 2025
536aae9
fix: add nullable constraint to hasSystemAccess in MemberJpaEntity
jhonatapers Jun 11, 2025
a226eaf
refactor: remove unused imports in test classes
jhonatapers Jun 11, 2025
dac6240
refactor: rename parameter in NotAllowedException constructor for cla…
jhonatapers Jun 11, 2025
020579f
style: add a new line for code formatting consistency in FileGateway …
jhonatapers Jun 11, 2025
0a0b68b
feat: add NotAllowedException handler to GlobalExceptionHandler
jhonatapers Jun 11, 2025
f5ba953
Merge pull request #49 from CallVDois/feature/delete-file
jhonatapers Jun 11, 2025
7e6a01e
refactor: remove SubFolder entity
jhonatapers Jun 13, 2025
49d01f1
test: enhance folder use case tests with additional verifications
jhonatapers Jun 13, 2025
08dd131
feat: update folder response models to include ownerId and isRootFold…
jhonatapers Jun 14, 2025
97717fc
fix: correct spelling of 'validate' in multiple locations across the …
jhonatapers Jun 14, 2025
e8e281b
fix: correct spelling of 'retrive' to 'retrieve' in API response desc…
jhonatapers Jun 14, 2025
4d5bf04
test: fix verification of folder update in DefaultMoveFolderUseCaseTest
jhonatapers Jun 14, 2025
2b63295
Merge pull request #51 from CallVDois/feature/refactor-folder
jhonatapers Jun 14, 2025
cfdf1e9
feat: add AOP module with context and executor classes for handling p…
jhonatapers Aug 3, 2025
a8540fe
refactor: replace generic Executor with specific PostExecutor and Pre…
jhonatapers Aug 3, 2025
e3361af
feat: Introduce InvocationContext and related classes for AOP executi…
jhonatapers Aug 4, 2025
ca6bce5
fix: enhance AbstractInvocationContext to accept PreInvocationContext…
jhonatapers Aug 4, 2025
ce49b42
refactor: consolidate AOP executor chain setup into ApplicationLayerA…
jhonatapers Aug 4, 2025
cfd3e8a
fix: enhance proceed methods in SimplePostInvocationContext to return…
jhonatapers Aug 4, 2025
daf01c6
refactor: mark PreInvocationExecutorChain and SimpleExecutorChainHand…
jhonatapers Aug 4, 2025
608e21d
feat: add DomainLayerAspect and InfrastructureLayerAspect for AOP exe…
jhonatapers Aug 4, 2025
5417029
fix: handle null cases in SimpleExecutorChainHandler constructor by p…
jhonatapers Aug 5, 2025
5252a47
feat: implement toString methods for File, FileID, Folder, FolderID, …
jhonatapers Aug 5, 2025
5efb228
fix: correct logger class reference in LogErrorPostExecutor, LogMetho…
jhonatapers Aug 5, 2025
c8df211
refactor: update executor classes to use static factory methods for i…
jhonatapers Aug 23, 2025
b7527d7
Merge pull request #54 from CallVDois/feature/aop-lib
jhonatapers Aug 23, 2025
9efceb5
Merge branch 'develop' into feature/change-folder-name
jhonatapers Aug 24, 2025
eeb9b0d
refactor: streamline folder name update logic and improve validation …
jhonatapers Aug 24, 2025
2c31098
refactor: update endpoint for changing folder name to use a simplifie…
jhonatapers Aug 24, 2025
7fd4e42
refactor: update endpoint for moving a folder to use a more descripti…
jhonatapers Aug 24, 2025
cfe156d
refactor: clean up API annotations and improve response documentation
jhonatapers Aug 24, 2025
dc25f29
refactor: update FileAPI to use @RequestParam for folderId and change…
jhonatapers Aug 24, 2025
0ec76b2
refactor: update Spring Boot version to 3.5.5 and change deprecated s…
jhonatapers Aug 24, 2025
e43fcff
Merge pull request #21 from CallVDois/feature/change-folder-name
jhonatapers Aug 24, 2025
fd7acb4
refactor: remove Guava dependency from build files and update JUnit v…
jhonatapers Aug 25, 2025
5a84952
refactor: add @NonNull annotation to Jwt parameters in KeycloakAuthor…
jhonatapers Aug 25, 2025
11641d2
refactor: update JUnit and Mockito versions across build files
jhonatapers Aug 25, 2025
19e5390
chore: update dependencies to latest versions
jhonatapers Aug 25, 2025
94fc7d7
chore: remove H2 database dependency from build.gradle
jhonatapers Aug 25, 2025
ee3a6d1
chore: remove unused spring-aop dependency from build.gradle
jhonatapers Aug 25, 2025
03f223b
chore: update JUnit and Mockito versions in build.gradle
jhonatapers Aug 25, 2025
76afe34
Merge pull request #56 from CallVDois/feature/update-dependencies
jhonatapers Aug 25, 2025
94972a7
Merge branch 'develop' into feature/general-adjustments
jhonatapers Aug 25, 2025
de92b76
Merge pull request #62 from CallVDois/feature/general-adjustments
jhonatapers Aug 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ POSTGRES_PASSWORD=postgres

DB_DDL_AUTO=none

RABBITMQ_VIRTUAL_HOST=/
RABBITMQ_AUTO_CREATE=true
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_USERNAME=admin
RABBITMQ_PASSWORD=admin

STORAGE_LOCATION=/srv/drive/storage/
MAX_FILE_SIZE=2048MB
MAX_REQUEST_SIZE=100MB
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ bin

.vscode

.idea/

*.db


.env

*.log
*log.json
*log.json

*.log.gz
*log.json.gz
30 changes: 30 additions & 0 deletions aop/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id 'java-library'
}

group = 'com.callv2'
version = '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {

implementation 'org.aspectj:aspectjrt:1.9.24'

testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
testImplementation 'org.mockito:mockito-junit-jupiter:5.19.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

tasks.named('test') {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.callv2.aop.context;

import java.time.Instant;
import java.util.concurrent.atomic.AtomicBoolean;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.reflect.SourceLocation;
import org.aspectj.runtime.internal.AroundClosure;

public abstract class AbstractInvocationContext implements InvocationContext {

protected final ProceedingJoinPoint joinPoint;
protected final AtomicBoolean proceeded;
private final Instant contextedAt;

protected AbstractInvocationContext(final ProceedingJoinPoint joinPoint) {
this.joinPoint = joinPoint;
this.proceeded = new AtomicBoolean(false);
this.contextedAt = Instant.now();
}

protected AbstractInvocationContext(final PreInvocationContext preInvocationContext) {
this.joinPoint = preInvocationContext;
this.proceeded = new AtomicBoolean(preInvocationContext.proceeded());
this.contextedAt = preInvocationContext.getContextedAt();
}

@Override
public void set$AroundClosure(AroundClosure arc) {
this.joinPoint.set$AroundClosure(arc);
}

@Override
public String toShortString() {
return this.joinPoint.toShortString();
}

@Override
public String toLongString() {
return this.joinPoint.toLongString();
}

@Override
public Object getThis() {
return this.joinPoint.getThis();
}

@Override
public Object getTarget() {
return this.joinPoint.getTarget();
}

@Override
public Object[] getArgs() {
return this.joinPoint.getArgs();
}

@Override
public Signature getSignature() {
return this.joinPoint.getSignature();
}

@Override
public SourceLocation getSourceLocation() {
return this.joinPoint.getSourceLocation();
}

@Override
public String getKind() {
return this.joinPoint.getKind();
}

@Override
public StaticPart getStaticPart() {
return this.joinPoint.getStaticPart();
}

@Override
public Instant getContextedAt() {
return this.contextedAt;
}

@Override
public boolean proceeded() {
return this.proceeded.get();
}

}
13 changes: 13 additions & 0 deletions aop/src/main/java/com/callv2/aop/context/InvocationContext.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.callv2.aop.context;

import java.time.Instant;

import org.aspectj.lang.ProceedingJoinPoint;

public interface InvocationContext extends ProceedingJoinPoint {

Instant getContextedAt();

boolean proceeded();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.callv2.aop.context;

import java.time.Instant;

public interface PostInvocationContext extends InvocationContext {

Instant getProceededAt();

Object getResult();

Throwable getThrowable();

boolean wasSuccessful();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.callv2.aop.context;

public interface PreInvocationContext extends InvocationContext {

PostInvocationContext proceedWithContext();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package com.callv2.aop.context;

import java.time.Instant;
import java.util.concurrent.atomic.AtomicBoolean;

public final class SimplePostInvocationContext extends AbstractInvocationContext implements PostInvocationContext {

private final Object result;
private final Throwable throwable;
private final Instant proceededAt;
private final AtomicBoolean successful;

private SimplePostInvocationContext(
final PreInvocationContext preInvocationContext,
final Object result,
final Throwable throwable,
final Instant proceededAt,
final boolean successful) {
super(preInvocationContext);
this.result = result;
this.throwable = throwable;
this.proceededAt = proceededAt;
this.successful = new AtomicBoolean(successful);
}

protected static SimplePostInvocationContext from(final PreInvocationContext preInvocationContext) {

Object result;
Throwable throwable;
boolean successful;
final Instant proceededAt;

try {
result = preInvocationContext.proceed();
throwable = null;
successful = true;
} catch (Throwable e) {
result = null;
throwable = e;
successful = false;
} finally {
proceededAt = Instant.now();
}

return new SimplePostInvocationContext(
preInvocationContext,
result,
throwable,
proceededAt,
successful);

}

@Override
public Object proceed() throws Throwable {
if (this.proceeded.get()) {
if (successful.get())
return result;
else
throw throwable;
}

return this.joinPoint.proceed();
}

@Override
public Object proceed(Object[] args) throws Throwable {
if (this.proceeded.get()) {
if (successful.get())
return result;
else
throw throwable;
}

return this.joinPoint.proceed(args);
}

@Override
public Instant getProceededAt() {
return this.proceededAt;
}

@Override
public Object getResult() {
return this.result;
}

@Override
public Throwable getThrowable() {
return this.throwable;
}

@Override
public boolean wasSuccessful() {
return this.successful.get();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.callv2.aop.context;

import org.aspectj.lang.ProceedingJoinPoint;

public final class SimplePreInvocationContext extends AbstractInvocationContext implements PreInvocationContext {

private SimplePreInvocationContext(final ProceedingJoinPoint joinPoint) {
super(joinPoint);
}

public static SimplePreInvocationContext of(final ProceedingJoinPoint joinPoint) {
return new SimplePreInvocationContext(joinPoint);
}

@Override
public Object proceed() throws Throwable {
if (proceeded.getAndSet(true))
throw new IllegalStateException("Method already proceeded");
return joinPoint.proceed();
}

@Override
public Object proceed(Object[] args) throws Throwable {
if (proceeded.getAndSet(true))
throw new IllegalStateException("Method already proceeded");
return joinPoint.proceed(args);
}

@Override
public PostInvocationContext proceedWithContext() {
return SimplePostInvocationContext.from(this);
}

}
10 changes: 10 additions & 0 deletions aop/src/main/java/com/callv2/aop/executor/Executor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.callv2.aop.executor;

import org.aspectj.lang.ProceedingJoinPoint;

@FunctionalInterface
public interface Executor<J extends ProceedingJoinPoint> {

void execute(J joinPoint);

}
7 changes: 7 additions & 0 deletions aop/src/main/java/com/callv2/aop/executor/PostExecutor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.callv2.aop.executor;

import com.callv2.aop.context.PostInvocationContext;

public interface PostExecutor extends Executor<PostInvocationContext> {

}
7 changes: 7 additions & 0 deletions aop/src/main/java/com/callv2/aop/executor/PreExecutor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.callv2.aop.executor;

import com.callv2.aop.context.PreInvocationContext;

public interface PreExecutor extends Executor<PreInvocationContext> {

}
32 changes: 32 additions & 0 deletions aop/src/main/java/com/callv2/aop/executor/chain/ExecutorChain.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.callv2.aop.executor.chain;

import org.aspectj.lang.ProceedingJoinPoint;

import com.callv2.aop.executor.Executor;

public abstract class ExecutorChain<O, J extends ProceedingJoinPoint, E extends Executor<J>> {

private ExecutorChain<O, J, E> next;
private final E executor;

protected ExecutorChain(final E executor) {
this.executor = executor;
}

public ExecutorChain<O, J, E> setNext(final ExecutorChain<O, J, E> executorChain) {
return this.next = executorChain;
}

public final O execute(final J joinpoint) throws Throwable {

this.executor.execute(joinpoint);

if (next != null)
return next.execute(joinpoint);

return resolve(joinpoint);
}

protected abstract O resolve(J joinPoint) throws Throwable;

}
Loading