-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Api-v0.1.5
- Loading branch information
Showing
34 changed files
with
963 additions
and
143 deletions.
There are no files selected for viewing
28 changes: 23 additions & 5 deletions
28
...ng-Api/src/main/java/band/gosrock/api/common/aop/hostRole/HostCallTransactionFactory.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,20 +1,38 @@ | ||
package band.gosrock.api.common.aop.hostRole; | ||
|
||
|
||
import lombok.RequiredArgsConstructor; | ||
import band.gosrock.api.common.UserUtils; | ||
import band.gosrock.domain.domains.event.adaptor.EventAdaptor; | ||
import band.gosrock.domain.domains.host.adaptor.HostAdaptor; | ||
import org.springframework.stereotype.Component; | ||
|
||
@RequiredArgsConstructor | ||
@Component | ||
class HostCallTransactionFactory { | ||
|
||
private final HostRoleEventTransaction hostRoleEventTransaction; | ||
private final HostRoleEventTransaction hostRoleEventWithoutTransaction; | ||
|
||
public HostCallTransactionFactory( | ||
UserUtils userUtils, | ||
HostAdaptor hostAdaptor, | ||
EventAdaptor eventAdaptor, | ||
HostRoleEventTransaction hostRoleEventTransaction, | ||
HostRoleHostTransaction hostRoleHostTransaction) { | ||
this.hostRoleEventTransaction = hostRoleEventTransaction; | ||
this.hostRoleEventWithoutTransaction = | ||
new HostRoleEventTransaction(userUtils, eventAdaptor, hostAdaptor); | ||
this.hostRoleHostTransaction = hostRoleHostTransaction; | ||
this.hostRoleHostWithoutTransaction = new HostRoleHostTransaction(userUtils, hostAdaptor); | ||
} | ||
|
||
private final HostRoleHostTransaction hostRoleHostTransaction; | ||
private final HostRoleHostTransaction hostRoleHostWithoutTransaction; | ||
|
||
public HostRoleCallTransaction getCallTransaction(FindHostFrom findHostFrom) { | ||
public HostRoleCallTransaction getCallTransaction( | ||
FindHostFrom findHostFrom, Boolean applyTransaction) { | ||
if (findHostFrom == FindHostFrom.HOST_ID) { | ||
return hostRoleHostTransaction; | ||
return applyTransaction ? hostRoleHostTransaction : hostRoleHostWithoutTransaction; | ||
} | ||
return hostRoleEventTransaction; | ||
return applyTransaction ? hostRoleEventTransaction : hostRoleEventWithoutTransaction; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,6 @@ | |
HostQualification role(); | ||
|
||
FindHostFrom findHostFrom(); | ||
|
||
boolean applyTransaction() default true; | ||
} |
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
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
12 changes: 12 additions & 0 deletions
12
.../java/band/gosrock/domain/domains/host/exception/CannotModifyMasterHostRoleException.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,12 @@ | ||
package band.gosrock.domain.domains.host.exception; | ||
|
||
|
||
import band.gosrock.common.exception.DuDoongCodeException; | ||
|
||
public class CannotModifyMasterHostRoleException extends DuDoongCodeException { | ||
public static final DuDoongCodeException EXCEPTION = new CannotModifyMasterHostRoleException(); | ||
|
||
private CannotModifyMasterHostRoleException() { | ||
super(HostErrorCode.CANNOT_MODIFY_MASTER_HOST_ROLE); | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
...main/java/band/gosrock/domain/domains/host/exception/ForbiddenHostOperationException.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.